@@ -39,6 +39,9 @@ |
||
39 | 39 | } |
40 | 40 | |
41 | 41 | |
42 | +/** |
|
43 | + * @param string $path |
|
44 | + */ |
|
42 | 45 | function testforbom($path) |
43 | 46 | { |
44 | 47 | $filestart = file_get_contents($path, false, null, 0, 2); |
@@ -7,7 +7,7 @@ discard block |
||
7 | 7 | * Searches for Unicode byte order marks in code and template files |
8 | 8 | ***************************************************************************/ |
9 | 9 | |
10 | -chdir(__DIR__ . '/../../htdocs'); |
|
10 | +chdir(__DIR__.'/../../htdocs'); |
|
11 | 11 | require_once 'lib2/cli.inc.php'; |
12 | 12 | |
13 | 13 | |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | $hDir = opendir($dir); |
26 | 26 | if ($hDir !== false) { |
27 | 27 | while (($file = readdir($hDir)) !== false) { |
28 | - $path = $dir . '/' . $file; |
|
28 | + $path = $dir.'/'.$file; |
|
29 | 29 | if (is_dir($path) && substr($file, 0, 1) !== '.' && $subdirs) { |
30 | 30 | scan($path, $subdirs); |
31 | 31 | } else { |
@@ -1281,11 +1281,19 @@ |
||
1281 | 1281 | } |
1282 | 1282 | } |
1283 | 1283 | |
1284 | +/** |
|
1285 | + * @param string $recordtype |
|
1286 | + * @param string $info |
|
1287 | + */ |
|
1284 | 1288 | function importError($recordtype, $uuid, $r, $info) |
1285 | 1289 | { |
1286 | 1290 | echo 'error: ' . $recordtype . ' (' . $uuid . '): ' . $info . "\n"; |
1287 | 1291 | } |
1288 | 1292 | |
1293 | +/** |
|
1294 | + * @param string $recordtype |
|
1295 | + * @param string $info |
|
1296 | + */ |
|
1289 | 1297 | function importWarn($recordtype, $uuid, $r, $info) |
1290 | 1298 | { |
1291 | 1299 | echo 'warn: ' . $recordtype . ' (' . $uuid . '): ' . $info . "\n"; |
@@ -27,12 +27,12 @@ discard block |
||
27 | 27 | * - Test mit aktuellem OC.de-Stand |
28 | 28 | ***************************************************************************/ |
29 | 29 | |
30 | -$rootpath = __DIR__ . '/../../htdocs/'; |
|
30 | +$rootpath = __DIR__.'/../../htdocs/'; |
|
31 | 31 | |
32 | 32 | // chdir to proper directory (needed for cronjobs) |
33 | 33 | chdir(substr(realpath($_SERVER['PHP_SELF']), 0, strrpos(realpath($_SERVER['PHP_SELF']), '/'))); |
34 | 34 | |
35 | -require_once $rootpath . 'lib/clicompatbase.inc.php'; |
|
35 | +require_once $rootpath.'lib/clicompatbase.inc.php'; |
|
36 | 36 | require_once 'xml2array.inc.php'; |
37 | 37 | require_once 'settings.php'; |
38 | 38 | |
@@ -67,16 +67,16 @@ discard block |
||
67 | 67 | $nFileNr = 0; |
68 | 68 | $rs = sql('SELECT `id`, `url` FROM `pictures` WHERE `local`=0'); |
69 | 69 | while ($r = sql_fetch_array($rs)) { |
70 | - $nFileNr ++; |
|
70 | + $nFileNr++; |
|
71 | 71 | $fileparts = mb_split('/', $r['url']); |
72 | 72 | $filename = $fileparts[count($fileparts) - 1]; |
73 | 73 | |
74 | - echo 'Downloading file ' . $nFileNr . ' of ' . $rCount['c'] . ': ' . $filename . "\n"; |
|
74 | + echo 'Downloading file '.$nFileNr.' of '.$rCount['c'].': '.$filename."\n"; |
|
75 | 75 | |
76 | 76 | $success = true; |
77 | - if (!file_exists($opt['pictures']['directory'] . $filename)) { |
|
78 | - if (!@copy($r['url'], $opt['pictures']['directory'] . $filename)) { |
|
79 | - echo 'error: Download nicht erfolgreich' . "\n"; |
|
77 | + if (!file_exists($opt['pictures']['directory'].$filename)) { |
|
78 | + if (!@copy($r['url'], $opt['pictures']['directory'].$filename)) { |
|
79 | + echo 'error: Download nicht erfolgreich'."\n"; |
|
80 | 80 | $success = false; |
81 | 81 | } |
82 | 82 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | if ($success == true) { |
85 | 85 | sql( |
86 | 86 | "UPDATE `pictures` SET `local`=1, `url`='&1' WHERE `id`='&2'", |
87 | - $opt['pictures']['url'] . $filename, |
|
87 | + $opt['pictures']['url'].$filename, |
|
88 | 88 | $r['id'] |
89 | 89 | ); |
90 | 90 | } |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | |
197 | 197 | if ($opt['session'] == 1) { |
198 | 198 | // records abfragen |
199 | - $sessionfile = $opt['tmpdir'] . 'session.xml'; |
|
199 | + $sessionfile = $opt['tmpdir'].'session.xml'; |
|
200 | 200 | if (file_exists($sessionfile)) { |
201 | 201 | unlink($sessionfile); |
202 | 202 | } |
@@ -215,21 +215,21 @@ discard block |
||
215 | 215 | $recordscount += $session['OCXMLSESSION']['RECORDS']['PICTURE']; |
216 | 216 | $recordscount += $session['OCXMLSESSION']['RECORDS']['REMOVEOBJECT']; |
217 | 217 | |
218 | - echo 'Abruf seit ' . $lastUpdate . "\n"; |
|
218 | + echo 'Abruf seit '.$lastUpdate."\n"; |
|
219 | 219 | echo "------------------------\n"; |
220 | - echo 'Session-Id: ' . $sessionid . "\n"; |
|
221 | - echo 'User: ' . $session['OCXMLSESSION']['RECORDS']['USER'] . "\n"; |
|
222 | - echo 'Cache: ' . $session['OCXMLSESSION']['RECORDS']['CACHE'] . "\n"; |
|
223 | - echo 'Cachdesc: ' . $session['OCXMLSESSION']['RECORDS']['CACHEDESC'] . "\n"; |
|
224 | - echo 'Cachelog: ' . $session['OCXMLSESSION']['RECORDS']['CACHELOG'] . "\n"; |
|
225 | - echo 'Picture: ' . $session['OCXMLSESSION']['RECORDS']['PICTURE'] . "\n"; |
|
226 | - echo 'Removedobject: ' . $session['OCXMLSESSION']['RECORDS']['REMOVEOBJECT'] . "\n"; |
|
220 | + echo 'Session-Id: '.$sessionid."\n"; |
|
221 | + echo 'User: '.$session['OCXMLSESSION']['RECORDS']['USER']."\n"; |
|
222 | + echo 'Cache: '.$session['OCXMLSESSION']['RECORDS']['CACHE']."\n"; |
|
223 | + echo 'Cachdesc: '.$session['OCXMLSESSION']['RECORDS']['CACHEDESC']."\n"; |
|
224 | + echo 'Cachelog: '.$session['OCXMLSESSION']['RECORDS']['CACHELOG']."\n"; |
|
225 | + echo 'Picture: '.$session['OCXMLSESSION']['RECORDS']['PICTURE']."\n"; |
|
226 | + echo 'Removedobject: '.$session['OCXMLSESSION']['RECORDS']['REMOVEOBJECT']."\n"; |
|
227 | 227 | echo "------------------------\n"; |
228 | - echo 'Summe: ' . $recordscount . "\n"; |
|
228 | + echo 'Summe: '.$recordscount."\n"; |
|
229 | 229 | |
230 | 230 | $filescount = ($recordscount + (500 - $recordscount % 500)) / 500; |
231 | 231 | |
232 | - echo 'Anzahl der Pakete: ' . $filescount . "\n"; |
|
232 | + echo 'Anzahl der Pakete: '.$filescount."\n"; |
|
233 | 233 | echo "\n"; |
234 | 234 | |
235 | 235 | if ($recordscount == 0) { |
@@ -237,20 +237,20 @@ discard block |
||
237 | 237 | exit; |
238 | 238 | } |
239 | 239 | |
240 | - for ($i = 1; $i <= $filescount; $i ++) { |
|
241 | - echo "Download Paket: " . $i . ' von ' . $filescount . "\n"; |
|
240 | + for ($i = 1; $i <= $filescount; $i++) { |
|
241 | + echo "Download Paket: ".$i.' von '.$filescount."\n"; |
|
242 | 242 | |
243 | 243 | $fileurl = $opt['url_getsession']; |
244 | 244 | $fileurl = mb_ereg_replace('{sessionid}', $sessionid, $fileurl); |
245 | 245 | $fileurl = mb_ereg_replace('{file}', $i, $fileurl); |
246 | 246 | $fileurl = mb_ereg_replace('{zip}', $opt['zip'], $fileurl); |
247 | - $target = $opt['tmpdir'] . $sessionid . '-' . sprintf('%04d', $i) . $fileext; |
|
247 | + $target = $opt['tmpdir'].$sessionid.'-'.sprintf('%04d', $i).$fileext; |
|
248 | 248 | |
249 | 249 | copy($fileurl, $target); |
250 | 250 | } |
251 | 251 | } else { |
252 | - echo 'Download ...' . "\n"; |
|
253 | - $target = $opt['tmpdir'] . date('YmdHis') . $fileext; |
|
252 | + echo 'Download ...'."\n"; |
|
253 | + $target = $opt['tmpdir'].date('YmdHis').$fileext; |
|
254 | 254 | copy($url, $target); |
255 | 255 | } |
256 | 256 | } |
@@ -262,24 +262,24 @@ discard block |
||
262 | 262 | // alle zips entpacken |
263 | 263 | $hDir = opendir($opt['tmpdir']); |
264 | 264 | while (false !== ($file = readdir($hDir))) { |
265 | - if (is_file($opt['tmpdir'] . $file)) { |
|
265 | + if (is_file($opt['tmpdir'].$file)) { |
|
266 | 266 | $bCopy = false; |
267 | 267 | if (mb_substr($file, mb_strrpos($file, '.')) == '.zip') { |
268 | - echo 'Unzipping file ' . $file . "\n"; |
|
268 | + echo 'Unzipping file '.$file."\n"; |
|
269 | 269 | system( |
270 | - $opt['unzip'] . ' --type=zip --src="' . $opt['rel_tmpdir'] . '/' . $file . '" --dst="' . $opt['rel_tmpdir'] . '"' |
|
270 | + $opt['unzip'].' --type=zip --src="'.$opt['rel_tmpdir'].'/'.$file.'" --dst="'.$opt['rel_tmpdir'].'"' |
|
271 | 271 | ); |
272 | 272 | } else { |
273 | 273 | if (mb_substr($file, mb_strrpos($file, '.')) == '.gz') { |
274 | - echo 'Unzipping file ' . $file . "\n"; |
|
274 | + echo 'Unzipping file '.$file."\n"; |
|
275 | 275 | system( |
276 | - $opt['unzip'] . ' --type=gzip --src="' . $opt['rel_tmpdir'] . '/' . $file . '" --dst="' . $opt['rel_tmpdir'] . '"' |
|
276 | + $opt['unzip'].' --type=gzip --src="'.$opt['rel_tmpdir'].'/'.$file.'" --dst="'.$opt['rel_tmpdir'].'"' |
|
277 | 277 | ); |
278 | 278 | } else { |
279 | 279 | if (mb_substr($file, mb_strrpos($file, '.')) == '.bz2') { |
280 | - echo 'Unzipping file ' . $file . "\n"; |
|
280 | + echo 'Unzipping file '.$file."\n"; |
|
281 | 281 | system( |
282 | - $opt['unzip'] . ' --type=bzip2 --src="' . $opt['rel_tmpdir'] . '/' . $file . '" --dst="' . $opt['rel_tmpdir'] . '"' |
|
282 | + $opt['unzip'].' --type=bzip2 --src="'.$opt['rel_tmpdir'].'/'.$file.'" --dst="'.$opt['rel_tmpdir'].'"' |
|
283 | 283 | ); |
284 | 284 | } else { |
285 | 285 | if (mb_substr($file, mb_strrpos($file, '.')) == '.xml') { |
@@ -291,16 +291,16 @@ discard block |
||
291 | 291 | |
292 | 292 | // und jetzt die gezippte Datei verschieben |
293 | 293 | $archivdir = $opt['archivdir']; |
294 | - $archivdir .= $opt['curdb'] . '/'; |
|
294 | + $archivdir .= $opt['curdb'].'/'; |
|
295 | 295 | |
296 | 296 | if (!is_dir($archivdir)) { |
297 | 297 | mkdir($archivdir); |
298 | 298 | } |
299 | 299 | |
300 | 300 | if ($bCopy == true) { |
301 | - copy($opt['tmpdir'] . $file, $archivdir . '/' . $file); |
|
301 | + copy($opt['tmpdir'].$file, $archivdir.'/'.$file); |
|
302 | 302 | } else { |
303 | - rename($opt['tmpdir'] . $file, $archivdir . '/' . $file); |
|
303 | + rename($opt['tmpdir'].$file, $archivdir.'/'.$file); |
|
304 | 304 | } |
305 | 305 | } |
306 | 306 | } |
@@ -315,9 +315,9 @@ discard block |
||
315 | 315 | |
316 | 316 | $hDir = opendir($opt['tmpdir']); |
317 | 317 | while (false !== ($file = readdir($hDir))) { |
318 | - if (is_file($opt['tmpdir'] . $file)) { |
|
318 | + if (is_file($opt['tmpdir'].$file)) { |
|
319 | 319 | if ($file != '.cvsignore') { |
320 | - $files[] = $opt['tmpdir'] . $file; |
|
320 | + $files[] = $opt['tmpdir'].$file; |
|
321 | 321 | } |
322 | 322 | } |
323 | 323 | } |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | |
332 | 332 | function importxmlfile($file) |
333 | 333 | { |
334 | - echo 'Importing file ' . $file . "\n"; |
|
334 | + echo 'Importing file '.$file."\n"; |
|
335 | 335 | |
336 | 336 | $xmlReader = new xmlReader(); |
337 | 337 | $xmlReader->open($file); |
@@ -411,11 +411,11 @@ discard block |
||
411 | 411 | if ($sSubElement != '') { |
412 | 412 | // vorheriges element zuerst schlißen |
413 | 413 | $sSubElement = ''; |
414 | - $nRecursionLevel --; |
|
414 | + $nRecursionLevel--; |
|
415 | 415 | } |
416 | 416 | |
417 | 417 | $sSubElement = mb_strtoupper($xmlReader->name); |
418 | - $nRecursionLevel ++; |
|
418 | + $nRecursionLevel++; |
|
419 | 419 | |
420 | 420 | // attribute auslesen |
421 | 421 | if ($xmlReader->moveToFirstAttribute()) { |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | } else { |
433 | 433 | if ($xmlReader->nodeType == XMLReader::END_ELEMENT) { |
434 | 434 | $sSubElement = ''; |
435 | - $nRecursionLevel --; |
|
435 | + $nRecursionLevel--; |
|
436 | 436 | } |
437 | 437 | } |
438 | 438 | } |
@@ -459,7 +459,7 @@ discard block |
||
459 | 459 | ImportRemovedObjectArray($node['REMOVEDOBJECT']); |
460 | 460 | break; |
461 | 461 | default: |
462 | - echo 'Unknown Element "' . $xmlReader->name . '", skipping' . "\n"; |
|
462 | + echo 'Unknown Element "'.$xmlReader->name.'", skipping'."\n"; |
|
463 | 463 | break; |
464 | 464 | } |
465 | 465 | } |
@@ -481,9 +481,9 @@ discard block |
||
481 | 481 | |
482 | 482 | $hDir = opendir($opt['tmpdir']); |
483 | 483 | while (false !== ($file = readdir($hDir))) { |
484 | - if (is_file($opt['tmpdir'] . $file)) { |
|
484 | + if (is_file($opt['tmpdir'].$file)) { |
|
485 | 485 | if ($file != '.cvsignore') { |
486 | - unlink($opt['tmpdir'] . $file); |
|
486 | + unlink($opt['tmpdir'].$file); |
|
487 | 487 | } |
488 | 488 | } |
489 | 489 | } |
@@ -501,14 +501,14 @@ discard block |
||
501 | 501 | // andere DB connecten? |
502 | 502 | if (mb_substr($arg, 0, 5) == '--db=') { |
503 | 503 | if (!is_numeric(mb_substr($arg, 5))) { |
504 | - die('invalid alternative DB' . "\n"); |
|
504 | + die('invalid alternative DB'."\n"); |
|
505 | 505 | } |
506 | 506 | |
507 | 507 | $nDb = mb_substr($arg, 5); |
508 | 508 | |
509 | 509 | if ($nDb != 0) { |
510 | 510 | if (!isset($opt['db'][$nDb])) { |
511 | - die('invalid alternative DB' . "\n"); |
|
511 | + die('invalid alternative DB'."\n"); |
|
512 | 512 | } |
513 | 513 | |
514 | 514 | mysql_close($dblink); |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | sql("SET NAMES 'utf8'"); |
518 | 518 | sql('USE `&1`', $opt['db'][1]['name']); |
519 | 519 | } else { |
520 | - die('Connect to alternative DB failed' . "\n"); |
|
520 | + die('Connect to alternative DB failed'."\n"); |
|
521 | 521 | } |
522 | 522 | |
523 | 523 | $opt['curdb'] = $nDb; |
@@ -531,7 +531,7 @@ discard block |
||
531 | 531 | sql("SET NAMES 'utf8'"); |
532 | 532 | sql('USE `&1`', $dbname); |
533 | 533 | } else { |
534 | - die('Connect to alternative DB failed' . "\n"); |
|
534 | + die('Connect to alternative DB failed'."\n"); |
|
535 | 535 | } |
536 | 536 | } |
537 | 537 | } |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | !isset($r['USERNAME']['__DATA']) || |
545 | 545 | !isset($r['LASTMODIFIED']['__DATA']) |
546 | 546 | ) { |
547 | - echo 'warn: ImportUserArray required element not defined' . "\n"; |
|
547 | + echo 'warn: ImportUserArray required element not defined'."\n"; |
|
548 | 548 | |
549 | 549 | return; |
550 | 550 | } |
@@ -637,7 +637,7 @@ discard block |
||
637 | 637 | !isset($r['DATECREATED']['__DATA']) || |
638 | 638 | !isset($r['LASTMODIFIED']['__DATA']) |
639 | 639 | ) { |
640 | - echo 'warn: ImportCacheArray required element not defined' . "\n"; |
|
640 | + echo 'warn: ImportCacheArray required element not defined'."\n"; |
|
641 | 641 | |
642 | 642 | return; |
643 | 643 | } |
@@ -808,7 +808,7 @@ discard block |
||
808 | 808 | !isset($r['LANGUAGE']['__ATTR']['ID']) || |
809 | 809 | !isset($r['LASTMODIFIED']['__DATA']) |
810 | 810 | ) { |
811 | - echo 'error: ImportCacheDescArray required element not defined' . "\n"; |
|
811 | + echo 'error: ImportCacheDescArray required element not defined'."\n"; |
|
812 | 812 | |
813 | 813 | return; |
814 | 814 | } |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | !isset($r['DATECREATED']['__DATA']) || |
966 | 966 | !isset($r['LASTMODIFIED']['__DATA']) |
967 | 967 | ) { |
968 | - echo 'error: ImportCachelogArray required element not defined' . "\n"; |
|
968 | + echo 'error: ImportCachelogArray required element not defined'."\n"; |
|
969 | 969 | |
970 | 970 | return; |
971 | 971 | } |
@@ -996,7 +996,7 @@ discard block |
||
996 | 996 | |
997 | 997 | // logtype gültig? |
998 | 998 | if (sqlValue( |
999 | - "SELECT COUNT(*) FROM `log_types` WHERE `id`='" . sql_escape($r['LOGTYPE']['__ATTR']['ID']) . "'", |
|
999 | + "SELECT COUNT(*) FROM `log_types` WHERE `id`='".sql_escape($r['LOGTYPE']['__ATTR']['ID'])."'", |
|
1000 | 1000 | 0 |
1001 | 1001 | ) == 0 |
1002 | 1002 | ) { |
@@ -1070,7 +1070,7 @@ discard block |
||
1070 | 1070 | !isset($r['DATECREATED']['__DATA']) || |
1071 | 1071 | !isset($r['LASTMODIFIED']['__DATA']) |
1072 | 1072 | ) { |
1073 | - echo 'error: ImportPictureArray required element not defined ' . "\n"; |
|
1073 | + echo 'error: ImportPictureArray required element not defined '."\n"; |
|
1074 | 1074 | |
1075 | 1075 | return; |
1076 | 1076 | } |
@@ -1171,7 +1171,7 @@ discard block |
||
1171 | 1171 | !isset($r['OBJECT']['__DATA']) || |
1172 | 1172 | !isset($r['REMOVEDDATE']['__DATA']) |
1173 | 1173 | ) { |
1174 | - echo 'error: ImportRemovedObjectArray required element not defined' . "\n"; |
|
1174 | + echo 'error: ImportRemovedObjectArray required element not defined'."\n"; |
|
1175 | 1175 | |
1176 | 1176 | return; |
1177 | 1177 | } |
@@ -1283,12 +1283,12 @@ discard block |
||
1283 | 1283 | |
1284 | 1284 | function importError($recordtype, $uuid, $r, $info) |
1285 | 1285 | { |
1286 | - echo 'error: ' . $recordtype . ' (' . $uuid . '): ' . $info . "\n"; |
|
1286 | + echo 'error: '.$recordtype.' ('.$uuid.'): '.$info."\n"; |
|
1287 | 1287 | } |
1288 | 1288 | |
1289 | 1289 | function importWarn($recordtype, $uuid, $r, $info) |
1290 | 1290 | { |
1291 | - echo 'warn: ' . $recordtype . ' (' . $uuid . '): ' . $info . "\n"; |
|
1291 | + echo 'warn: '.$recordtype.' ('.$uuid.'): '.$info."\n"; |
|
1292 | 1292 | } |
1293 | 1293 | |
1294 | 1294 | function restorevalues() |
@@ -26,6 +26,9 @@ |
||
26 | 26 | $this->stack_ref =& $this->stack[count($this->stack) - 1]; |
27 | 27 | } |
28 | 28 | |
29 | + /** |
|
30 | + * @param false|string $strInputXML |
|
31 | + */ |
|
29 | 32 | public function parse($strInputXML) |
30 | 33 | { |
31 | 34 |
@@ -16,14 +16,14 @@ |
||
16 | 16 | |
17 | 17 | public function push_pos(&$pos) |
18 | 18 | { |
19 | - $this->stack[count($this->stack)] =& $pos; |
|
20 | - $this->stack_ref =& $pos; |
|
19 | + $this->stack[count($this->stack)] = & $pos; |
|
20 | + $this->stack_ref = & $pos; |
|
21 | 21 | } |
22 | 22 | |
23 | 23 | public function pop_pos() |
24 | 24 | { |
25 | 25 | unset($this->stack[count($this->stack) - 1]); |
26 | - $this->stack_ref =& $this->stack[count($this->stack) - 1]; |
|
26 | + $this->stack_ref = & $this->stack[count($this->stack) - 1]; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | public function parse($strInputXML) |
@@ -19,9 +19,12 @@ discard block |
||
19 | 19 | require $stylepath . '/editdesc.inc.php'; |
20 | 20 | |
21 | 21 | // check for old-style parameters |
22 | - if (isset($_REQUEST['cacheid']) && isset($_REQUEST['desclang']) && !isset($_REQUEST['descid'])) // Ocprop |
|
22 | + if (isset($_REQUEST['cacheid']) && isset($_REQUEST['desclang']) && !isset($_REQUEST['descid'])) { |
|
23 | + // Ocprop |
|
23 | 24 | { |
24 | - $cache_id = $_REQUEST['cacheid']; // Ocprop |
|
25 | + $cache_id = $_REQUEST['cacheid']; |
|
26 | + } |
|
27 | + // Ocprop |
|
25 | 28 | $desc_lang = $_REQUEST['desclang']; // Ocprop |
26 | 29 | |
27 | 30 | $rs = sql("SELECT `id` FROM `cache_desc` WHERE `cache_id`='&1' AND `language`='&2'", $cache_id, $desc_lang); |
@@ -87,10 +90,13 @@ discard block |
||
87 | 90 | $show_all_langs = false; |
88 | 91 | |
89 | 92 | //save to DB? |
90 | - if (isset($_POST['post'])) // Ocprop |
|
93 | + if (isset($_POST['post'])) { |
|
94 | + // Ocprop |
|
91 | 95 | { |
92 | 96 | //here we read all used information from the form if submitted |
93 | - $descMode = isset($_POST['descMode']) ? $_POST['descMode'] + 0 : 1; // Ocprop |
|
97 | + $descMode = isset($_POST['descMode']) ? $_POST['descMode'] + 0 : 1; |
|
98 | + } |
|
99 | + // Ocprop |
|
94 | 100 | |
95 | 101 | // fuer alte Versionen von OCProp |
96 | 102 | if (isset($_POST['submit']) && !isset($_POST['version2'])) { |
@@ -147,7 +153,8 @@ discard block |
||
147 | 153 | |
148 | 154 | $desc = processEditorInput($oldDescMode, $descMode, $desc); |
149 | 155 | |
150 | - if (isset($_POST['submitform'])) // Ocprop |
|
156 | + if (isset($_POST['submitform'])) { |
|
157 | + // Ocprop |
|
151 | 158 | { |
152 | 159 | // prüfen, ob sprache nicht schon vorhanden |
153 | 160 | $rs = sql( |
@@ -160,6 +167,7 @@ discard block |
||
160 | 167 | $descid, |
161 | 168 | $desclang |
162 | 169 | ); |
170 | + } |
|
163 | 171 | $r = sql_fetch_array($rs); |
164 | 172 | if ($r['count'] > 0) { |
165 | 173 | tpl_errorMsg('editdesc', $error_desc_exists); |
@@ -224,8 +232,7 @@ discard block |
||
224 | 232 | |
225 | 233 | if ($oldDescMode == 0) { |
226 | 234 | $desc = processEditorInput($oldDescMode, $descMode, $desc_record['desc']); |
227 | - } |
|
228 | - else { |
|
235 | + } else { |
|
229 | 236 | $desc = $desc_record['desc']; |
230 | 237 | } |
231 | 238 | } |
@@ -9,20 +9,20 @@ discard block |
||
9 | 9 | * Unicode Reminder メモ |
10 | 10 | *****************************************************************************/ |
11 | 11 | |
12 | -require_once __DIR__ . '/lib/consts.inc.php'; |
|
12 | +require_once __DIR__.'/lib/consts.inc.php'; |
|
13 | 13 | $opt['gui'] = GUI_HTML; |
14 | -require_once __DIR__ . '/lib/common.inc.php'; |
|
15 | -require_once __DIR__ . '/lib2/edithelper.inc.php'; |
|
14 | +require_once __DIR__.'/lib/common.inc.php'; |
|
15 | +require_once __DIR__.'/lib2/edithelper.inc.php'; |
|
16 | 16 | |
17 | 17 | // Preprocessing |
18 | 18 | if ($error == false) { |
19 | - require $stylepath . '/editdesc.inc.php'; |
|
19 | + require $stylepath.'/editdesc.inc.php'; |
|
20 | 20 | |
21 | 21 | // check for old-style parameters |
22 | 22 | if (isset($_REQUEST['cacheid']) && isset($_REQUEST['desclang']) && !isset($_REQUEST['descid'])) // Ocprop |
23 | 23 | { |
24 | - $cache_id = $_REQUEST['cacheid']; // Ocprop |
|
25 | - $desc_lang = $_REQUEST['desclang']; // Ocprop |
|
24 | + $cache_id = $_REQUEST['cacheid']; // Ocprop |
|
25 | + $desc_lang = $_REQUEST['desclang']; // Ocprop |
|
26 | 26 | |
27 | 27 | $rs = sql("SELECT `id` FROM `cache_desc` WHERE `cache_id`='&1' AND `language`='&2'", $cache_id, $desc_lang); |
28 | 28 | if (mysql_num_rows($rs) == 1) { |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | $tplname = 'login'; |
44 | 44 | |
45 | 45 | tpl_set_var('username', ''); |
46 | - tpl_set_var('target', htmlspecialchars('editdesc.php?descid=' . urlencode($descid), ENT_COMPAT, 'UTF-8')); |
|
46 | + tpl_set_var('target', htmlspecialchars('editdesc.php?descid='.urlencode($descid), ENT_COMPAT, 'UTF-8')); |
|
47 | 47 | tpl_set_var('message_start', ""); |
48 | 48 | tpl_set_var('message_end', ""); |
49 | 49 | tpl_set_var('message', $login_required); |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | if (isset($_POST['post'])) // Ocprop |
91 | 91 | { |
92 | 92 | //here we read all used information from the form if submitted |
93 | - $descMode = isset($_POST['descMode']) ? $_POST['descMode'] + 0 : 1; // Ocprop |
|
93 | + $descMode = isset($_POST['descMode']) ? $_POST['descMode'] + 0 : 1; // Ocprop |
|
94 | 94 | |
95 | 95 | // fuer alte Versionen von OCProp |
96 | 96 | if (isset($_POST['submit']) && !isset($_POST['version2'])) { |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $oldDescMode = $descMode; |
124 | 124 | } |
125 | 125 | |
126 | - $short_desc = $_POST['short_desc']; // Ocprop |
|
126 | + $short_desc = $_POST['short_desc']; // Ocprop |
|
127 | 127 | $hint = htmlspecialchars($_POST['hints'], ENT_COMPAT, 'UTF-8'); |
128 | 128 | $desclang = $_POST['desclang']; |
129 | 129 | $show_all_langs = isset($_POST['show_all_langs_value']) ? $_POST['show_all_langs_value'] : 0; |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | } |
139 | 139 | |
140 | 140 | // Text from textarea |
141 | - $desc = $_POST['desc']; // Ocprop |
|
141 | + $desc = $_POST['desc']; // Ocprop |
|
142 | 142 | |
143 | 143 | // fuer alte Versionen von OCProp |
144 | 144 | if (isset($_POST['submit']) && !isset($_POST['version2'])) { |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | db_slave_exclude(); |
208 | 208 | |
209 | 209 | // redirect to cachepage |
210 | - tpl_redirect('editcache.php?cacheid=' . urlencode($desc_record['cache_id'])); |
|
210 | + tpl_redirect('editcache.php?cacheid='.urlencode($desc_record['cache_id'])); |
|
211 | 211 | exit; |
212 | 212 | } elseif (isset($_POST['show_all_langs'])) { |
213 | 213 | $show_all_langs = true; |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | ($show_all_langs == true) ? 1 : 0); |
278 | 278 | while ($rLanguage = sql_fetch_assoc($rsLanguages)) { |
279 | 279 | $sSelected = ($rLanguage['short'] == $desc_lang) ? ' selected="selected"' : ''; |
280 | - $languages .= '<option value="' . $rLanguage['short'] . '"' . $sSelected . '>' . htmlspecialchars($rLanguage['name'], ENT_COMPAT, 'UTF-8') . '</option>' . "\n"; |
|
280 | + $languages .= '<option value="'.$rLanguage['short'].'"'.$sSelected.'>'.htmlspecialchars($rLanguage['name'], ENT_COMPAT, 'UTF-8').'</option>'."\n"; |
|
281 | 281 | } |
282 | 282 | sql_free_result($rsLanguages); |
283 | 283 | |
@@ -297,20 +297,20 @@ discard block |
||
297 | 297 | tpl_set_var('desclang', htmlspecialchars($desc_lang, ENT_COMPAT, 'UTF-8')); |
298 | 298 | tpl_set_var('desclang_name', htmlspecialchars(db_LanguageFromShort($desc_lang), ENT_COMPAT, 'UTF-8')); |
299 | 299 | tpl_set_var('cachename', htmlspecialchars($desc_record['name'], ENT_COMPAT, 'UTF-8')); |
300 | - tpl_set_var('reset', $reset); // obsolete |
|
300 | + tpl_set_var('reset', $reset); // obsolete |
|
301 | 301 | tpl_set_var('submit', $submit); |
302 | 302 | |
303 | 303 | // Text / normal HTML / HTML editor |
304 | 304 | tpl_set_var('use_tinymce', ($desc_htmledit == 1) ? 1 : 0); |
305 | 305 | |
306 | - $headers = tpl_get_var('htmlheaders') . "\n"; |
|
306 | + $headers = tpl_get_var('htmlheaders')."\n"; |
|
307 | 307 | if (($desc_html == 1) && ($desc_htmledit == 1)) { |
308 | 308 | // TinyMCE |
309 | - $headers = tpl_get_var('htmlheaders') . "\n"; |
|
310 | - $headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/tiny_mce_gzip.js"></script>' . "\n"; |
|
311 | - $headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/config/desc.js.php?cacheid=' . ($desc_record['cache_id'] + 0) . '&lang=' . strtolower($locale) . '"></script>' . "\n"; |
|
309 | + $headers = tpl_get_var('htmlheaders')."\n"; |
|
310 | + $headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/tiny_mce_gzip.js"></script>'."\n"; |
|
311 | + $headers .= '<script language="javascript" type="text/javascript" src="resource2/tinymce/config/desc.js.php?cacheid='.($desc_record['cache_id'] + 0).'&lang='.strtolower($locale).'"></script>'."\n"; |
|
312 | 312 | } |
313 | - $headers .= '<script language="javascript" type="text/javascript" src="' . editorJsPath() . '"></script>' . "\n"; |
|
313 | + $headers .= '<script language="javascript" type="text/javascript" src="'.editorJsPath().'"></script>'."\n"; |
|
314 | 314 | tpl_set_var('htmlheaders', $headers); |
315 | 315 | } else { |
316 | 316 | // @todo: not the owner |
@@ -32,7 +32,7 @@ |
||
32 | 32 | if (!isset($counter[$name])) { |
33 | 33 | $counter[$name] = 0; |
34 | 34 | } |
35 | - $counter[$name] ++; |
|
35 | + $counter[$name]++; |
|
36 | 36 | |
37 | 37 | if ($smarty->_cache_including) { |
38 | 38 | $param = isset($smarty->_cache_info['cached_vars'][$name][$counter[$name]]) ? $smarty->_cache_info['cached_vars'][$name][$counter[$name]] : []; |
@@ -80,7 +80,7 @@ |
||
80 | 80 | ]; |
81 | 81 | |
82 | 82 | $nTimestamp = time(); |
83 | - for ($nIndex = 0; $nIndex < count($seasons); $nIndex ++) { |
|
83 | + for ($nIndex = 0; $nIndex < count($seasons); $nIndex++) { |
|
84 | 84 | if (strtotime($seasons[$nIndex][0]) > $nTimestamp) { |
85 | 85 | return $params['winter']; |
86 | 86 | } //''; |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | 'DATA_LICENSE_URL' => $opt['page']['absolute_url'] . $opt['logic']['license']['terms'], |
34 | 34 | 'DEBUG' => ($opt['debug'] & DEBUG_DEVELOPER != 0), |
35 | 35 | 'DEBUG_PREVENT_SEMAPHORES' |
36 | - => !$opt['php']['semaphores'], # not available on old developer system |
|
36 | + => !$opt['php']['semaphores'], # not available on old developer system |
|
37 | 37 | 'DB_SERVER' => $opt['db']['servername'], |
38 | 38 | 'DB_NAME' => $opt['db']['placeholder']['db'], |
39 | 39 | 'DB_USERNAME' => $opt['db']['username'], |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | 'OC_NODE_ID' => $opt['logic']['node']['id'], |
55 | 55 | 'OC_COOKIE_NAME' => $opt['session']['cookiename'] . 'data', |
56 | 56 | 'OCDE_HTML_PURIFIER_SETTINGS' |
57 | - => $opt['html_purifier'], |
|
57 | + => $opt['html_purifier'], |
|
58 | 58 | 'GITHUB_ACCESS_TOKEN' => $opt['okapi']['github_access_token'], |
59 | 59 | ); |
60 | 60 | } |
@@ -16,24 +16,24 @@ discard block |
||
16 | 16 | # [3] http://code.google.com/p/opencaching-api/issues/detail?id=132 |
17 | 17 | |
18 | 18 | $opt['rootpath'] = $GLOBALS['rootpath']; |
19 | - require $opt['rootpath'] . 'lib2/const.inc.php'; # (into the *local* scope!) |
|
20 | - require $opt['rootpath'] . 'config2/settings-dist.inc.php'; |
|
21 | - require $opt['rootpath'] . 'config2/settings.inc.php'; |
|
19 | + require $opt['rootpath'].'lib2/const.inc.php'; # (into the *local* scope!) |
|
20 | + require $opt['rootpath'].'config2/settings-dist.inc.php'; |
|
21 | + require $opt['rootpath'].'config2/settings.inc.php'; |
|
22 | 22 | |
23 | 23 | return array( |
24 | 24 | |
25 | 25 | # Settings which ARE NOT present in settings.inc.php: |
26 | 26 | |
27 | - 'OC_BRANCH' => 'oc.de', # Tell OKAPI to work in "OCDE mode". |
|
27 | + 'OC_BRANCH' => 'oc.de', # Tell OKAPI to work in "OCDE mode". |
|
28 | 28 | |
29 | 29 | # Settings which ARE present in settings.inc.php: |
30 | 30 | |
31 | 31 | 'ADMINS' => array($opt['db']['warn']['mail'], '[email protected]'), |
32 | 32 | 'FROM_FIELD' => $opt['mail']['contact'], |
33 | - 'DATA_LICENSE_URL' => $opt['page']['absolute_url'] . $opt['logic']['license']['terms'], |
|
33 | + 'DATA_LICENSE_URL' => $opt['page']['absolute_url'].$opt['logic']['license']['terms'], |
|
34 | 34 | 'DEBUG' => ($opt['debug'] & DEBUG_DEVELOPER != 0), |
35 | 35 | 'DEBUG_PREVENT_SEMAPHORES' |
36 | - => !$opt['php']['semaphores'], # not available on old developer system |
|
36 | + => !$opt['php']['semaphores'], # not available on old developer system |
|
37 | 37 | 'DB_SERVER' => $opt['db']['servername'], |
38 | 38 | 'DB_NAME' => $opt['db']['placeholder']['db'], |
39 | 39 | 'DB_USERNAME' => $opt['db']['username'], |
@@ -43,16 +43,16 @@ discard block |
||
43 | 43 | 'TIMEZONE' => $opt['php']['timezone'], |
44 | 44 | 'SITE_URL' => $opt['page']['absolute_url'], |
45 | 45 | 'REGISTRATION_URL' => $opt['page']['https']['mode'] != HTTPS_DISABLED |
46 | - ? 'https://' . $opt['page']['domain'] . '/register.php' |
|
47 | - : $opt['page']['absolute_url'] . 'register.php', |
|
46 | + ? 'https://'.$opt['page']['domain'].'/register.php' |
|
47 | + : $opt['page']['absolute_url'].'register.php', |
|
48 | 48 | 'VAR_DIR' => $opt['okapi']['var_dir'], |
49 | 49 | 'IMAGES_DIR' => rtrim($opt['logic']['pictures']['dir'], '/'), |
50 | 50 | 'IMAGES_URL' => rtrim($opt['logic']['pictures']['url'], '/').'/', |
51 | 51 | 'IMAGE_MAX_UPLOAD_SIZE' => 2 * $opt['logic']['pictures']['maxsize'], |
52 | - 'IMAGE_MAX_PIXEL_COUNT' => 786432, # 1024 x 768; TODO: move PICTURE_MAX_LONG_SIDE to settings |
|
53 | - 'SITE_LOGO' => $opt['page']['absolute_url'] . 'resource2/' . $opt['template']['default']['style'] . '/images/oclogo/oc_logo_alpha3.png', |
|
52 | + 'IMAGE_MAX_PIXEL_COUNT' => 786432, # 1024 x 768; TODO: move PICTURE_MAX_LONG_SIDE to settings |
|
53 | + 'SITE_LOGO' => $opt['page']['absolute_url'].'resource2/'.$opt['template']['default']['style'].'/images/oclogo/oc_logo_alpha3.png', |
|
54 | 54 | 'OC_NODE_ID' => $opt['logic']['node']['id'], |
55 | - 'OC_COOKIE_NAME' => $opt['session']['cookiename'] . 'data', |
|
55 | + 'OC_COOKIE_NAME' => $opt['session']['cookiename'].'data', |
|
56 | 56 | 'OCDE_HTML_PURIFIER_SETTINGS' |
57 | 57 | => $opt['html_purifier'], |
58 | 58 | 'GITHUB_ACCESS_TOKEN' => $opt['okapi']['github_access_token'], |
@@ -1,10 +1,10 @@ |
||
1 | 1 | <?php |
2 | - if (isset($_REQUEST['lang'])) { |
|
2 | + if (isset($_REQUEST['lang'])) { |
|
3 | 3 | $lang = $_REQUEST['lang']; |
4 | - } |
|
5 | - else { |
|
4 | + } |
|
5 | + else { |
|
6 | 6 | $lang = 'de'; |
7 | - } |
|
7 | + } |
|
8 | 8 | ?> |
9 | 9 | tinyMCE_GZ.init({ |
10 | 10 | plugins : 'advhr,contextmenu,emotions,insertdatetime,paste,table', |
@@ -47,7 +47,7 @@ |
||
47 | 47 | |
48 | 48 | function imageBrowser(field_name, url, type, win) |
49 | 49 | { |
50 | - window.open('../../../../imagebrowser.php?logid=<?php echo isset($_REQUEST['logid']) ? ($_REQUEST['logid']+0) : 0; ?>', '', 'width=450,height=550,menubar=no,scrollbars=yes,status=no,location=no,resizable=yes,status=no,dependent'); |
|
50 | + window.open('../../../../imagebrowser.php?logid=<?php echo isset($_REQUEST['logid']) ? ($_REQUEST['logid'] + 0) : 0; ?>', '', 'width=450,height=550,menubar=no,scrollbars=yes,status=no,location=no,resizable=yes,status=no,dependent'); |
|
51 | 51 | fileBrowserWin = win; |
52 | 52 | fileBrowserFieldName = field_name; |
53 | 53 | } |
@@ -1,8 +1,7 @@ |
||
1 | 1 | <?php |
2 | 2 | if (isset($_REQUEST['lang'])) { |
3 | 3 | $lang = $_REQUEST['lang']; |
4 | - } |
|
5 | - else { |
|
4 | + } else { |
|
6 | 5 | $lang = 'de'; |
7 | 6 | } |
8 | 7 | ?> |
@@ -1,16 +1,16 @@ |
||
1 | 1 | <?php |
2 | - if (isset($_REQUEST['cacheid'])) { |
|
2 | + if (isset($_REQUEST['cacheid'])) { |
|
3 | 3 | $cacheID = $_REQUEST['cacheid']; |
4 | - } |
|
5 | - else { |
|
4 | + } |
|
5 | + else { |
|
6 | 6 | $cacheID = 0; |
7 | - } |
|
8 | - if (isset($_REQUEST['lang'])) { |
|
7 | + } |
|
8 | + if (isset($_REQUEST['lang'])) { |
|
9 | 9 | $lang = $_REQUEST['lang']; |
10 | - } |
|
11 | - else { |
|
10 | + } |
|
11 | + else { |
|
12 | 12 | $lang = 'de'; |
13 | - } |
|
13 | + } |
|
14 | 14 | ?> |
15 | 15 | tinyMCE_GZ.init({ |
16 | 16 | plugins : 'advhr,contextmenu,emotions,insertdatetime,paste,table', |
@@ -53,7 +53,7 @@ |
||
53 | 53 | |
54 | 54 | function imageBrowser(field_name, url, type, win) |
55 | 55 | { |
56 | - window.open('../../../../imagebrowser.php?cacheid=<?php echo $cacheID+0; ?>', '', 'width=450,height=550,menubar=no,scrollbars=yes,status=no,location=no,resizable=yes,status=no,dependent'); |
|
56 | + window.open('../../../../imagebrowser.php?cacheid=<?php echo $cacheID + 0; ?>', '', 'width=450,height=550,menubar=no,scrollbars=yes,status=no,location=no,resizable=yes,status=no,dependent'); |
|
57 | 57 | fileBrowserWin = win; |
58 | 58 | fileBrowserFieldName = field_name; |
59 | 59 | } |
@@ -1,14 +1,12 @@ |
||
1 | 1 | <?php |
2 | 2 | if (isset($_REQUEST['cacheid'])) { |
3 | 3 | $cacheID = $_REQUEST['cacheid']; |
4 | - } |
|
5 | - else { |
|
4 | + } else { |
|
6 | 5 | $cacheID = 0; |
7 | 6 | } |
8 | 7 | if (isset($_REQUEST['lang'])) { |
9 | 8 | $lang = $_REQUEST['lang']; |
10 | - } |
|
11 | - else { |
|
9 | + } else { |
|
12 | 10 | $lang = 'de'; |
13 | 11 | } |
14 | 12 | ?> |