Mercurial > SimpleWebPresenter
comparison index.php @ 12:a20bb1b51aad
Merge.
| author | Tom Fredrik "BFG" Klaussen <bfg@blenning.no> |
|---|---|
| date | Tue, 29 May 2012 21:08:23 +0200 |
| parents | ba6f0818018b 19dfa6f3e2be |
| children | ee2c31392ea3 |
comparison
equal
deleted
inserted
replaced
| 11:ba6f0818018b | 12:a20bb1b51aad |
|---|---|
| 157 | 157 |
| 158 $body=getElementByTagName($doc,"body"); | 158 $body=getElementByTagName($doc,"body"); |
| 159 $files=$body->getElementsByTagName("file"); | 159 $files=$body->getElementsByTagName("file"); |
| 160 | 160 |
| 161 foreach ($files as $file) { | 161 foreach ($files as $file) { |
| 162 $src=$file->getAttribute("src"); | 162 $script=$file->getAttribute("script"); |
| 163 $file_content=loadFile("${lang}/${src}"); | 163 if ($script) { |
| 164 $src=""; | |
| 165 $cwd=getcwd(); | |
| 166 | |
| 167 $matches=array(); | |
| 168 preg_match('/(.*\/)/', $script, $matches); | |
| 169 $dirname=$matches[0]; | |
| 170 preg_match('/([^\/]*)$/', $script, $matches); | |
| 171 $filename=$matches[0]; | |
| 172 chdir("${lang}/${dirname}"); | |
| 173 $pipe=popen("php ${filename}","r"); | |
| 174 $file_content = stream_get_contents($pipe); | |
| 175 chdir("${cwd}"); | |
| 176 } | |
| 177 else { | |
| 178 $src=$file->getAttribute("src"); | |
| 179 $file_content=loadFile("${lang}/${src}"); | |
| 180 } | |
| 164 if(floatval($file_content)<0) { | 181 if(floatval($file_content)<0) { |
| 165 errorPage("Resource not found '${lang}/${src}'"); | 182 errorPage("Resource not found '${lang}/${src}'"); |
| 166 } | 183 } |
| 167 | 184 |
| 168 $filters=$file->getElementsByTagName("filter"); | 185 $filters=$file->getElementsByTagName("filter"); |
