@@ -15,7 +15,7 @@ |
||
15 | 15 | * |
16 | 16 | * Please commit your language changes on Transifex (https://www.transifex.com/projects/p/modx-evolution/) or on GitHub (https://github.com/modxcms/evolution). |
17 | 17 | */ |
18 | -setlocale (LC_ALL, 'ru_RU.UTF-8'); |
|
18 | +setlocale(LC_ALL, 'ru_RU.UTF-8'); |
|
19 | 19 | $_lang["agree_to_terms"] = 'Согласиться с условиями лицензии и приступить к установке'; |
20 | 20 | $_lang["alert_database_test_connection"] = 'Вы должны создать базу данных или выбрать базу данных для проверки!'; |
21 | 21 | $_lang["alert_database_test_connection_failed"] = 'Неудачная проверка выбранной базы данных!'; |
@@ -1,21 +1,21 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | //:: EVO Installer Setup file |
3 | 3 | //::::::::::::::::::::::::::::::::::::::::: |
4 | -if (is_file($base_path . 'assets/cache/siteManager.php')) { |
|
5 | - include_once($base_path . 'assets/cache/siteManager.php'); |
|
4 | +if (is_file($base_path.'assets/cache/siteManager.php')) { |
|
5 | + include_once($base_path.'assets/cache/siteManager.php'); |
|
6 | 6 | } |
7 | 7 | if (!defined('MGR_DIR')) { |
8 | 8 | define('MGR_DIR', 'manager'); |
9 | 9 | } |
10 | 10 | |
11 | -require_once(dirname(dirname(dirname(__DIR__))) . '/' . MGR_DIR . '/includes/version.inc.php'); |
|
11 | +require_once(dirname(dirname(dirname(__DIR__))).'/'.MGR_DIR.'/includes/version.inc.php'); |
|
12 | 12 | |
13 | -$chunkPath = $base_path . 'install/assets/chunks'; |
|
14 | -$snippetPath = $base_path . 'install/assets/snippets'; |
|
15 | -$pluginPath = $base_path . 'install/assets/plugins'; |
|
16 | -$modulePath = $base_path . 'install/assets/modules'; |
|
17 | -$templatePath = $base_path . 'install/assets/templates'; |
|
18 | -$tvPath = $base_path . 'install/assets/tvs'; |
|
13 | +$chunkPath = $base_path.'install/assets/chunks'; |
|
14 | +$snippetPath = $base_path.'install/assets/snippets'; |
|
15 | +$pluginPath = $base_path.'install/assets/plugins'; |
|
16 | +$modulePath = $base_path.'install/assets/modules'; |
|
17 | +$templatePath = $base_path.'install/assets/templates'; |
|
18 | +$tvPath = $base_path.'install/assets/tvs'; |
|
19 | 19 | |
20 | 20 | // setup Template template files - array : name, description, type - 0:file or 1:content, parameters, category |
21 | 21 | $mt = &$moduleTemplates; |
@@ -28,8 +28,7 @@ discard block |
||
28 | 28 | $params = parse_docblock($templatePath, $tplfile); |
29 | 29 | if (is_array($params) && (count($params) > 0)) { |
30 | 30 | $description = empty($params['version']) ? $params['description'] : "<strong>{$params['version']}</strong> {$params['description']}"; |
31 | - $mt[] = array |
|
32 | - ( |
|
31 | + $mt[] = array( |
|
33 | 32 | $params['name'], |
34 | 33 | $description, |
35 | 34 | // Don't think this is gonna be used ... but adding it just in case 'type' |
@@ -149,7 +148,7 @@ discard block |
||
149 | 148 | $params['modx_category'], |
150 | 149 | $params['legacy_names'], |
151 | 150 | array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false, |
152 | - (int)$params['disabled'] |
|
151 | + (int) $params['disabled'] |
|
153 | 152 | ); |
154 | 153 | } |
155 | 154 | } |
@@ -174,12 +173,12 @@ discard block |
||
174 | 173 | "$modulePath/{$params['filename']}", |
175 | 174 | $params['properties'], |
176 | 175 | $params['guid'], |
177 | - (int)$params['shareparams'], |
|
176 | + (int) $params['shareparams'], |
|
178 | 177 | $params['modx_category'], |
179 | 178 | array_key_exists('installset', $params) ? preg_split("/\s*,\s*/", $params['installset']) : false |
180 | 179 | ); |
181 | 180 | } |
182 | - if ((int)$params['shareparams'] || !empty($params['dependencies'])) { |
|
181 | + if ((int) $params['shareparams'] || !empty($params['dependencies'])) { |
|
183 | 182 | $dependencies = explode(',', $params['dependencies']); |
184 | 183 | foreach ($dependencies as $dependency) { |
185 | 184 | $dependency = explode(':', $dependency); |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | * |
173 | 173 | * @param string $param |
174 | 174 | * @param array $tvsArray |
175 | - * @return mixed |
|
175 | + * @return string |
|
176 | 176 | */ |
177 | 177 | function parseTvValues($param, $tvsArray) |
178 | 178 | { |
@@ -566,7 +566,7 @@ discard block |
||
566 | 566 | /** |
567 | 567 | * returns an array if a delimiter is present. returns array is a recordset is present |
568 | 568 | * |
569 | - * @param $src |
|
569 | + * @param string $src |
|
570 | 570 | * @param string $delim |
571 | 571 | * @param string $type |
572 | 572 | * @param bool $columns |
@@ -1022,7 +1022,7 @@ discard block |
||
1022 | 1022 | |
1023 | 1023 | if (! function_exists('ParseIntputOptions')) { |
1024 | 1024 | /** |
1025 | - * @param string|array|mysqli_result $v |
|
1025 | + * @param string $v |
|
1026 | 1026 | * @return array |
1027 | 1027 | */ |
1028 | 1028 | function ParseIntputOptions($v) |
@@ -573,7 +573,8 @@ |
||
573 | 573 | * @return array|string |
574 | 574 | */ |
575 | 575 | function parseInput($src, $delim = "||", $type = "string", $columns = true) |
576 | - { // type can be: string, array |
|
576 | + { |
|
577 | +// type can be: string, array |
|
577 | 578 | $modx = evolutionCMS(); |
578 | 579 | if ($modx->getDatabase()->isResult($src)) { |
579 | 580 | // must be a recordset |
@@ -51,7 +51,7 @@ |
||
51 | 51 | $modx->setPlaceholder($rvKey, $rvValue); |
52 | 52 | } |
53 | 53 | $param = $modx->mergePlaceholderContent($param); |
54 | - $rs = $modx->getDatabase()->query("SELECT $param;"); |
|
54 | + $rs = $modx->getDatabase()->query("select $param;"); |
|
55 | 55 | $output = $rs; |
56 | 56 | break; |
57 | 57 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (! function_exists('ProcessTVCommand')) { |
|
3 | +if (!function_exists('ProcessTVCommand')) { |
|
4 | 4 | /** |
5 | 5 | * @param string $value |
6 | 6 | * @param string $name |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | function ProcessTVCommand($value, $name = '', $docid = '', $src = 'docform', $tvsArray = array()) |
13 | 13 | { |
14 | 14 | $modx = evolutionCMS(); |
15 | - $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; |
|
15 | + $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier; |
|
16 | 16 | $nvalue = trim($value); |
17 | 17 | if (substr($nvalue, 0, 1) != '@') { |
18 | 18 | return $value; |
@@ -77,8 +77,8 @@ discard block |
||
77 | 77 | // if an inherited value is found and if there is content following the @INHERIT binding |
78 | 78 | // remove @INHERIT and output that following content. This content could contain other |
79 | 79 | // @ bindings, that are processed in the next step |
80 | - if ((string)$tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) { |
|
81 | - $output = trim(str_replace('@INHERIT', '', (string)$tv['value'])); |
|
80 | + if ((string) $tv['value'] !== '' && !preg_match('%^@INHERIT[\s\n\r]*$%im', $tv['value'])) { |
|
81 | + $output = trim(str_replace('@INHERIT', '', (string) $tv['value'])); |
|
82 | 82 | break 2; |
83 | 83 | } |
84 | 84 | } |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | |
87 | 87 | case 'DIRECTORY' : |
88 | 88 | $files = array(); |
89 | - $path = $modx->config['base_path'] . $param; |
|
89 | + $path = $modx->config['base_path'].$param; |
|
90 | 90 | if (substr($path, -1, 1) != '/') { |
91 | 91 | $path .= '/'; |
92 | 92 | } |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | } |
118 | 118 | } |
119 | 119 | |
120 | -if (! function_exists('ProcessFile')) { |
|
120 | +if (!function_exists('ProcessFile')) { |
|
121 | 121 | /** |
122 | 122 | * @param $file |
123 | 123 | * @return string |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | } |
135 | 135 | } |
136 | 136 | |
137 | -if (! function_exists('ParseCommand')) { |
|
137 | +if (!function_exists('ParseCommand')) { |
|
138 | 138 | /** |
139 | 139 | * ParseCommand - separate @ cmd from params |
140 | 140 | * |
@@ -155,7 +155,7 @@ discard block |
||
155 | 155 | |
156 | 156 | $binding_array = array(); |
157 | 157 | foreach ($BINDINGS as $cmd) { |
158 | - if (strpos($binding_string, '@' . $cmd) === 0) { |
|
158 | + if (strpos($binding_string, '@'.$cmd) === 0) { |
|
159 | 159 | $code = substr($binding_string, strlen($cmd) + 1); |
160 | 160 | $binding_array = array($cmd, trim($code)); |
161 | 161 | break; |
@@ -166,7 +166,7 @@ discard block |
||
166 | 166 | } |
167 | 167 | } |
168 | 168 | |
169 | -if (! function_exists('parseTvValues')) { |
|
169 | +if (!function_exists('parseTvValues')) { |
|
170 | 170 | /** |
171 | 171 | * Parse MODX Template-Variables |
172 | 172 | * |
@@ -197,7 +197,7 @@ discard block |
||
197 | 197 | } |
198 | 198 | } |
199 | 199 | |
200 | -if (! function_exists('getTVDisplayFormat')) { |
|
200 | +if (!function_exists('getTVDisplayFormat')) { |
|
201 | 201 | /** |
202 | 202 | * @param string $name |
203 | 203 | * @param string $value |
@@ -215,7 +215,7 @@ discard block |
||
215 | 215 | $o = ''; |
216 | 216 | |
217 | 217 | // process any TV commands in value |
218 | - $docid = (int)$docid > 0 ? (int)$docid : $modx->documentIdentifier; |
|
218 | + $docid = (int) $docid > 0 ? (int) $docid : $modx->documentIdentifier; |
|
219 | 219 | $value = ProcessTVCommand($value, $name, $docid); |
220 | 220 | |
221 | 221 | $params = array(); |
@@ -254,12 +254,12 @@ discard block |
||
254 | 254 | $attr['align'] = $params['align']; |
255 | 255 | } |
256 | 256 | foreach ($attr as $k => $v) { |
257 | - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); |
|
257 | + $attributes .= ($v ? ' '.$k.'="'.$v.'"' : ''); |
|
258 | 258 | } |
259 | - $attributes .= ' ' . $params['attrib']; |
|
259 | + $attributes .= ' '.$params['attrib']; |
|
260 | 260 | |
261 | 261 | // Output the image with attributes |
262 | - $o .= '<img' . rtrim($attributes) . ' />'; |
|
262 | + $o .= '<img'.rtrim($attributes).' />'; |
|
263 | 263 | } |
264 | 264 | } |
265 | 265 | break; |
@@ -331,12 +331,12 @@ discard block |
||
331 | 331 | 'target' => $params['target'], |
332 | 332 | ); |
333 | 333 | foreach ($attr as $k => $v) { |
334 | - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); |
|
334 | + $attributes .= ($v ? ' '.$k.'="'.$v.'"' : ''); |
|
335 | 335 | } |
336 | - $attributes .= ' ' . $params['attrib']; // add extra |
|
336 | + $attributes .= ' '.$params['attrib']; // add extra |
|
337 | 337 | |
338 | 338 | // Output the link |
339 | - $o .= '<a' . rtrim($attributes) . '>' . ($params['text'] ? $modx->getPhpCompat()->htmlspecialchars($params['text']) : $name) . '</a>'; |
|
339 | + $o .= '<a'.rtrim($attributes).'>'.($params['text'] ? $modx->getPhpCompat()->htmlspecialchars($params['text']) : $name).'</a>'; |
|
340 | 340 | } |
341 | 341 | } |
342 | 342 | break; |
@@ -362,12 +362,12 @@ discard block |
||
362 | 362 | 'style' => $params['style'], |
363 | 363 | ); |
364 | 364 | foreach ($attr as $k => $v) { |
365 | - $attributes .= ($v ? ' ' . $k . '="' . $v . '"' : ''); |
|
365 | + $attributes .= ($v ? ' '.$k.'="'.$v.'"' : ''); |
|
366 | 366 | } |
367 | - $attributes .= ' ' . $params['attrib']; // add extra |
|
367 | + $attributes .= ' '.$params['attrib']; // add extra |
|
368 | 368 | |
369 | 369 | // Output the HTML Tag |
370 | - $o .= '<' . $tagname . rtrim($attributes) . '>' . $tagvalue . '</' . $tagname . '>'; |
|
370 | + $o .= '<'.$tagname.rtrim($attributes).'>'.$tagvalue.'</'.$tagname.'>'; |
|
371 | 371 | } |
372 | 372 | break; |
373 | 373 | |
@@ -376,7 +376,7 @@ discard block |
||
376 | 376 | $w = $params['w'] ? $params['w'] : '100%'; |
377 | 377 | $h = $params['h'] ? $params['h'] : '400px'; |
378 | 378 | $richtexteditor = $params['edt'] ? $params['edt'] : ""; |
379 | - $o = '<div class="MODX_RichTextWidget"><textarea id="' . $id . '" name="' . $id . '" style="width:' . $w . '; height:' . $h . ';">'; |
|
379 | + $o = '<div class="MODX_RichTextWidget"><textarea id="'.$id.'" name="'.$id.'" style="width:'.$w.'; height:'.$h.';">'; |
|
380 | 380 | $o .= $modx->getPhpCompat()->htmlspecialchars($value); |
381 | 381 | $o .= '</textarea></div>'; |
382 | 382 | $replace_richtext = array($id); |
@@ -403,7 +403,7 @@ discard block |
||
403 | 403 | |
404 | 404 | case "viewport": |
405 | 405 | $value = parseInput($value); |
406 | - $id = '_' . time(); |
|
406 | + $id = '_'.time(); |
|
407 | 407 | if (!$params['vpid']) { |
408 | 408 | $params['vpid'] = $id; |
409 | 409 | } |
@@ -417,35 +417,35 @@ discard block |
||
417 | 417 | $h = "100%"; |
418 | 418 | } |
419 | 419 | if ($params['asize'] == 'Yes' || ($params['awidth'] == 'Yes' && $params['aheight'] == 'Yes')) { |
420 | - $autoMode = "3"; //both |
|
420 | + $autoMode = "3"; //both |
|
421 | 421 | } else { |
422 | 422 | if ($params['awidth'] == 'Yes') { |
423 | 423 | $autoMode = "1"; //width only |
424 | 424 | } else { |
425 | 425 | if ($params['aheight'] == 'Yes') { |
426 | - $autoMode = "2"; //height only |
|
426 | + $autoMode = "2"; //height only |
|
427 | 427 | } |
428 | 428 | } |
429 | 429 | } |
430 | 430 | |
431 | - $modx->regClientStartupScript(MODX_MANAGER_URL . "media/script/bin/viewport.js", array( |
|
431 | + $modx->regClientStartupScript(MODX_MANAGER_URL."media/script/bin/viewport.js", array( |
|
432 | 432 | 'name' => 'viewport', |
433 | 433 | 'version' => '0', |
434 | 434 | 'plaintext' => false |
435 | 435 | )); |
436 | - $o = $sTag . " id='" . $params['vpid'] . "' name='" . $params['vpid'] . "' "; |
|
436 | + $o = $sTag." id='".$params['vpid']."' name='".$params['vpid']."' "; |
|
437 | 437 | if ($params['class']) { |
438 | - $o .= " class='" . $params['class'] . "' "; |
|
438 | + $o .= " class='".$params['class']."' "; |
|
439 | 439 | } |
440 | 440 | if ($params['style']) { |
441 | - $o .= " style='" . $params['style'] . "' "; |
|
441 | + $o .= " style='".$params['style']."' "; |
|
442 | 442 | } |
443 | 443 | if ($params['attrib']) { |
444 | - $o .= $params['attrib'] . " "; |
|
444 | + $o .= $params['attrib']." "; |
|
445 | 445 | } |
446 | - $o .= "scrolling='" . ($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto")) . "' "; |
|
447 | - $o .= "src='" . $value . "' frameborder='" . $params['borsize'] . "' "; |
|
448 | - $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'" . $params['vpid'] . "\\'," . $autoMode . ")',100);\" width='" . $w . "' height='" . $h . "' "; |
|
446 | + $o .= "scrolling='".($params['sbar'] == 'No' ? "no" : ($params['sbar'] == 'Yes' ? "yes" : "auto"))."' "; |
|
447 | + $o .= "src='".$value."' frameborder='".$params['borsize']."' "; |
|
448 | + $o .= "onload=\"window.setTimeout('ResizeViewPort(\\'".$params['vpid']."\\',".$autoMode.")',100);\" width='".$w."' height='".$h."' "; |
|
449 | 449 | $o .= ">"; |
450 | 450 | $o .= $eTag; |
451 | 451 | break; |
@@ -497,16 +497,16 @@ discard block |
||
497 | 497 | $o = ''; |
498 | 498 | /* If we are loading a file */ |
499 | 499 | if (substr($params['output'], 0, 5) == "@FILE") { |
500 | - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 6)); |
|
500 | + $file_name = MODX_BASE_PATH.trim(substr($params['output'], 6)); |
|
501 | 501 | if (!file_exists($file_name)) { |
502 | - $widget_output = $file_name . ' does not exist'; |
|
502 | + $widget_output = $file_name.' does not exist'; |
|
503 | 503 | } else { |
504 | 504 | $widget_output = file_get_contents($file_name); |
505 | 505 | } |
506 | 506 | } elseif (substr($params['output'], 0, 8) == '@INCLUDE') { |
507 | - $file_name = MODX_BASE_PATH . trim(substr($params['output'], 9)); |
|
507 | + $file_name = MODX_BASE_PATH.trim(substr($params['output'], 9)); |
|
508 | 508 | if (!file_exists($file_name)) { |
509 | - $widget_output = $file_name . ' does not exist'; |
|
509 | + $widget_output = $file_name.' does not exist'; |
|
510 | 510 | } else { |
511 | 511 | /* The included file needs to set $widget_output. Can be string, array, object */ |
512 | 512 | include $file_name; |
@@ -548,7 +548,7 @@ discard block |
||
548 | 548 | } |
549 | 549 | } |
550 | 550 | |
551 | -if (! function_exists('decodeParamValue')) { |
|
551 | +if (!function_exists('decodeParamValue')) { |
|
552 | 552 | /** |
553 | 553 | * @param string $s |
554 | 554 | * @return string |
@@ -561,7 +561,7 @@ discard block |
||
561 | 561 | } |
562 | 562 | } |
563 | 563 | |
564 | -if (! function_exists('parseInput')) { |
|
564 | +if (!function_exists('parseInput')) { |
|
565 | 565 | /** |
566 | 566 | * returns an array if a delimiter is present. returns array is a recordset is present |
567 | 567 | * |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | } |
594 | 594 | } |
595 | 595 | |
596 | -if (! function_exists('getUnixtimeFromDateString')) { |
|
596 | +if (!function_exists('getUnixtimeFromDateString')) { |
|
597 | 597 | /** |
598 | 598 | * @param string $value |
599 | 599 | * @return bool|false|int |
@@ -621,7 +621,7 @@ discard block |
||
621 | 621 | } |
622 | 622 | } |
623 | 623 | |
624 | -if (! function_exists('renderFormElement')) { |
|
624 | +if (!function_exists('renderFormElement')) { |
|
625 | 625 | /** |
626 | 626 | * DISPLAY FORM ELEMENTS |
627 | 627 | * |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | $field_style = '', |
645 | 645 | $row = array(), |
646 | 646 | $tvsArray = array() |
647 | - ) { |
|
647 | + ){ |
|
648 | 648 | $modx = evolutionCMS(); |
649 | 649 | global $_style; |
650 | 650 | global $_lang; |
@@ -664,22 +664,22 @@ discard block |
||
664 | 664 | |
665 | 665 | case "text": // handler for regular text boxes |
666 | 666 | case "rawtext"; // non-htmlentity converted text boxes |
667 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" />'; |
|
667 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%" />'; |
|
668 | 668 | break; |
669 | 669 | case "email": // handles email input fields |
670 | - $field_html .= '<input type="email" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%"/>'; |
|
670 | + $field_html .= '<input type="email" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%"/>'; |
|
671 | 671 | break; |
672 | 672 | case "number": // handles the input of numbers |
673 | - $field_html .= '<input type="number" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' tvtype="' . $field_type . '" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>'; |
|
673 | + $field_html .= '<input type="number" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' tvtype="'.$field_type.'" onchange="documentDirty=true;" style="width:100%" onkeyup="this.value=this.value.replace(/[^\d-,.+]/,\'\')"/>'; |
|
674 | 674 | break; |
675 | 675 | case "textareamini": // handler for textarea mini boxes |
676 | - $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '</textarea>'; |
|
676 | + $field_html .= '<textarea id="tv'.$field_id.'" name="tv'.$field_id.'" cols="40" rows="5" onchange="documentDirty=true;" style="width:100%">'.$modx->getPhpCompat()->htmlspecialchars($field_value).'</textarea>'; |
|
677 | 677 | break; |
678 | 678 | case "textarea": // handler for textarea boxes |
679 | 679 | case "rawtextarea": // non-htmlentity convertex textarea boxes |
680 | 680 | case "htmlarea": // handler for textarea boxes (deprecated) |
681 | 681 | case "richtext": // handler for textarea boxes |
682 | - $field_html .= '<textarea id="tv' . $field_id . '" name="tv' . $field_id . '" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '</textarea>'; |
|
682 | + $field_html .= '<textarea id="tv'.$field_id.'" name="tv'.$field_id.'" cols="40" rows="15" onchange="documentDirty=true;" style="width:100%">'.$modx->getPhpCompat()->htmlspecialchars($field_value).'</textarea>'; |
|
683 | 683 | break; |
684 | 684 | case "date": |
685 | 685 | $field_id = str_replace(array( |
@@ -689,12 +689,12 @@ discard block |
||
689 | 689 | if ($field_value == '') { |
690 | 690 | $field_value = 0; |
691 | 691 | } |
692 | - $field_html .= '<input id="tv' . $field_id . '" name="tv' . $field_id . '" class="DatePicker" type="text" value="' . ($field_value == 0 || !isset($field_value) ? "" : $field_value) . '" onblur="documentDirty=true;" />'; |
|
693 | - $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].value=\'\';document.forms[\'mutate\'].elements[\'tv' . $field_id . '\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="' . $_style["actions_calendar_delete"] . '"></i></a>'; |
|
692 | + $field_html .= '<input id="tv'.$field_id.'" name="tv'.$field_id.'" class="DatePicker" type="text" value="'.($field_value == 0 || !isset($field_value) ? "" : $field_value).'" onblur="documentDirty=true;" />'; |
|
693 | + $field_html .= ' <a onclick="document.forms[\'mutate\'].elements[\'tv'.$field_id.'\'].value=\'\';document.forms[\'mutate\'].elements[\'tv'.$field_id.'\'].onblur(); return true;" onmouseover="window.status=\'clear the date\'; return true;" onmouseout="window.status=\'\'; return true;" style="cursor:pointer; cursor:hand"><i class="'.$_style["actions_calendar_delete"].'"></i></a>'; |
|
694 | 694 | |
695 | 695 | break; |
696 | 696 | case "dropdown": // handler for select boxes |
697 | - $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" size="1" onchange="documentDirty=true;">'; |
|
697 | + $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'" size="1" onchange="documentDirty=true;">'; |
|
698 | 698 | $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', |
699 | 699 | $tvsArray)); |
700 | 700 | while (list($item, $itemvalue) = each($index_list)) { |
@@ -702,12 +702,12 @@ discard block |
||
702 | 702 | if (strlen($itemvalue) == 0) { |
703 | 703 | $itemvalue = $item; |
704 | 704 | } |
705 | - $field_html .= '<option value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($item) . '</option>'; |
|
705 | + $field_html .= '<option value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'"'.($itemvalue == $field_value ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($item).'</option>'; |
|
706 | 706 | } |
707 | 707 | $field_html .= "</select>"; |
708 | 708 | break; |
709 | 709 | case "listbox": // handler for select boxes |
710 | - $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '" onchange="documentDirty=true;" size="8">'; |
|
710 | + $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'" onchange="documentDirty=true;" size="8">'; |
|
711 | 711 | $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', |
712 | 712 | $tvsArray)); |
713 | 713 | while (list($item, $itemvalue) = each($index_list)) { |
@@ -715,13 +715,13 @@ discard block |
||
715 | 715 | if (strlen($itemvalue) == 0) { |
716 | 716 | $itemvalue = $item; |
717 | 717 | } |
718 | - $field_html .= '<option value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '"' . ($itemvalue == $field_value ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($item) . '</option>'; |
|
718 | + $field_html .= '<option value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'"'.($itemvalue == $field_value ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($item).'</option>'; |
|
719 | 719 | } |
720 | 720 | $field_html .= "</select>"; |
721 | 721 | break; |
722 | 722 | case "listbox-multiple": // handler for select boxes where you can choose multiple items |
723 | 723 | $field_value = explode("||", $field_value); |
724 | - $field_html .= '<select id="tv' . $field_id . '" name="tv' . $field_id . '[]" multiple="multiple" onchange="documentDirty=true;" size="8">'; |
|
724 | + $field_html .= '<select id="tv'.$field_id.'" name="tv'.$field_id.'[]" multiple="multiple" onchange="documentDirty=true;" size="8">'; |
|
725 | 725 | $index_list = ParseIntputOptions(ProcessTVCommand($field_elements, $field_id, '', 'tvform', |
726 | 726 | $tvsArray)); |
727 | 727 | while (list($item, $itemvalue) = each($index_list)) { |
@@ -729,8 +729,8 @@ discard block |
||
729 | 729 | if (strlen($itemvalue) == 0) { |
730 | 730 | $itemvalue = $item; |
731 | 731 | } |
732 | - $field_html .= '<option value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '"' . (in_array($itemvalue, |
|
733 | - $field_value) ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($item) . '</option>'; |
|
732 | + $field_html .= '<option value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'"'.(in_array($itemvalue, |
|
733 | + $field_value) ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($item).'</option>'; |
|
734 | 734 | } |
735 | 735 | $field_html .= "</select>"; |
736 | 736 | break; |
@@ -742,17 +742,17 @@ discard block |
||
742 | 742 | 'ftp://' => 'ftp://', |
743 | 743 | 'mailto:' => 'mailto:' |
744 | 744 | ); |
745 | - $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv' . $field_id . '_prefix" name="tv' . $field_id . '_prefix" onchange="documentDirty=true;">'; |
|
745 | + $field_html = '<table border="0" cellspacing="0" cellpadding="0"><tr><td><select id="tv'.$field_id.'_prefix" name="tv'.$field_id.'_prefix" onchange="documentDirty=true;">'; |
|
746 | 746 | foreach ($urls as $k => $v) { |
747 | 747 | if (strpos($field_value, $v) === false) { |
748 | - $field_html .= '<option value="' . $v . '">' . $k . '</option>'; |
|
748 | + $field_html .= '<option value="'.$v.'">'.$k.'</option>'; |
|
749 | 749 | } else { |
750 | 750 | $field_value = str_replace($v, '', $field_value); |
751 | - $field_html .= '<option value="' . $v . '" selected="selected">' . $k . '</option>'; |
|
751 | + $field_html .= '<option value="'.$v.'" selected="selected">'.$k.'</option>'; |
|
752 | 752 | } |
753 | 753 | } |
754 | 754 | $field_html .= '</select></td><td>'; |
755 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" width="100" ' . $field_style . ' onchange="documentDirty=true;" /></td></tr></table>'; |
|
755 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" width="100" '.$field_style.' onchange="documentDirty=true;" /></td></tr></table>'; |
|
756 | 756 | break; |
757 | 757 | case 'checkbox': // handles check boxes |
758 | 758 | $values = !is_array($field_value) ? explode('||', $field_value) : $field_value; |
@@ -794,7 +794,7 @@ discard block |
||
794 | 794 | if (strlen($itemvalue) == 0) { |
795 | 795 | $itemvalue = $item; |
796 | 796 | } |
797 | - $field_html .= '<input type="radio" value="' . $modx->getPhpCompat()->htmlspecialchars($itemvalue) . '" id="tv_' . $i . '" name="tv' . $field_id . '" ' . ($itemvalue == $field_value ? 'checked="checked"' : '') . ' onchange="documentDirty=true;" /><label for="tv_' . $i . '" class="radio">' . $item . '</label><br />'; |
|
797 | + $field_html .= '<input type="radio" value="'.$modx->getPhpCompat()->htmlspecialchars($itemvalue).'" id="tv_'.$i.'" name="tv'.$field_id.'" '.($itemvalue == $field_value ? 'checked="checked"' : '').' onchange="documentDirty=true;" /><label for="tv_'.$i.'" class="radio">'.$item.'</label><br />'; |
|
798 | 798 | $i++; |
799 | 799 | } |
800 | 800 | break; |
@@ -824,13 +824,13 @@ discard block |
||
824 | 824 | lastImageCtrl = ctrl; |
825 | 825 | var w = screen.width * 0.5; |
826 | 826 | var h = screen.height * 0.5; |
827 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
827 | + OpenServerBrowser('" . MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
828 | 828 | } |
829 | 829 | function BrowseFileServer(ctrl) { |
830 | 830 | lastFileCtrl = ctrl; |
831 | 831 | var w = screen.width * 0.5; |
832 | 832 | var h = screen.height * 0.5; |
833 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
833 | + OpenServerBrowser('".MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
834 | 834 | } |
835 | 835 | function SetUrlChange(el) { |
836 | 836 | if ('createEvent' in document) { |
@@ -864,7 +864,7 @@ discard block |
||
864 | 864 | </script>"; |
865 | 865 | $ResourceManagerLoaded = true; |
866 | 866 | } |
867 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseServer(\'tv' . $field_id . '\')" />'; |
|
867 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$field_value.'" '.$field_style.' onchange="documentDirty=true;" /><input type="button" value="'.$_lang['insert'].'" onclick="BrowseServer(\'tv'.$field_id.'\')" />'; |
|
868 | 868 | break; |
869 | 869 | case "file": // handles the input of file uploads |
870 | 870 | /* Modified by Timon for use with resource browser */ |
@@ -894,13 +894,13 @@ discard block |
||
894 | 894 | lastImageCtrl = ctrl; |
895 | 895 | var w = screen.width * 0.5; |
896 | 896 | var h = screen.height * 0.5; |
897 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
897 | + OpenServerBrowser('" . MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=images', w, h); |
|
898 | 898 | } |
899 | 899 | function BrowseFileServer(ctrl) { |
900 | 900 | lastFileCtrl = ctrl; |
901 | 901 | var w = screen.width * 0.5; |
902 | 902 | var h = screen.height * 0.5; |
903 | - OpenServerBrowser('" . MODX_MANAGER_URL . "media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
903 | + OpenServerBrowser('".MODX_MANAGER_URL."media/browser/{$which_browser}/browser.php?Type=files', w, h); |
|
904 | 904 | } |
905 | 905 | function SetUrlChange(el) { |
906 | 906 | if ('createEvent' in document) { |
@@ -934,7 +934,7 @@ discard block |
||
934 | 934 | </script>"; |
935 | 935 | $ResourceManagerLoaded = true; |
936 | 936 | } |
937 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $field_value . '" ' . $field_style . ' onchange="documentDirty=true;" /><input type="button" value="' . $_lang['insert'] . '" onclick="BrowseFileServer(\'tv' . $field_id . '\')" />'; |
|
937 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$field_value.'" '.$field_style.' onchange="documentDirty=true;" /><input type="button" value="'.$_lang['insert'].'" onclick="BrowseFileServer(\'tv'.$field_id.'\')" />'; |
|
938 | 938 | |
939 | 939 | break; |
940 | 940 | |
@@ -942,16 +942,16 @@ discard block |
||
942 | 942 | $custom_output = ''; |
943 | 943 | /* If we are loading a file */ |
944 | 944 | if (substr($field_elements, 0, 5) == "@FILE") { |
945 | - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 6)); |
|
945 | + $file_name = MODX_BASE_PATH.trim(substr($field_elements, 6)); |
|
946 | 946 | if (!file_exists($file_name)) { |
947 | - $custom_output = $file_name . ' does not exist'; |
|
947 | + $custom_output = $file_name.' does not exist'; |
|
948 | 948 | } else { |
949 | 949 | $custom_output = file_get_contents($file_name); |
950 | 950 | } |
951 | 951 | } elseif (substr($field_elements, 0, 8) == '@INCLUDE') { |
952 | - $file_name = MODX_BASE_PATH . trim(substr($field_elements, 9)); |
|
952 | + $file_name = MODX_BASE_PATH.trim(substr($field_elements, 9)); |
|
953 | 953 | if (!file_exists($file_name)) { |
954 | - $custom_output = $file_name . ' does not exist'; |
|
954 | + $custom_output = $file_name.' does not exist'; |
|
955 | 955 | } else { |
956 | 956 | ob_start(); |
957 | 957 | include $file_name; |
@@ -962,7 +962,7 @@ discard block |
||
962 | 962 | $chunk_name = trim(substr($field_elements, 7)); |
963 | 963 | $chunk_body = $modx->getChunk($chunk_name); |
964 | 964 | if ($chunk_body == false) { |
965 | - $custom_output = $_lang['chunk_no_exist'] . '(' . $_lang['htmlsnippet_name'] . ':' . $chunk_name . ')'; |
|
965 | + $custom_output = $_lang['chunk_no_exist'].'('.$_lang['htmlsnippet_name'].':'.$chunk_name.')'; |
|
966 | 966 | } else { |
967 | 967 | $custom_output = $chunk_body; |
968 | 968 | } |
@@ -987,15 +987,15 @@ discard block |
||
987 | 987 | break; |
988 | 988 | |
989 | 989 | default: // the default handler -- for errors, mostly |
990 | - $field_html .= '<input type="text" id="tv' . $field_id . '" name="tv' . $field_id . '" value="' . $modx->getPhpCompat()->htmlspecialchars($field_value) . '" ' . $field_style . ' onchange="documentDirty=true;" />'; |
|
990 | + $field_html .= '<input type="text" id="tv'.$field_id.'" name="tv'.$field_id.'" value="'.$modx->getPhpCompat()->htmlspecialchars($field_value).'" '.$field_style.' onchange="documentDirty=true;" />'; |
|
991 | 991 | |
992 | 992 | } // end switch statement |
993 | 993 | } else { |
994 | 994 | $custom = explode(":", $field_type); |
995 | 995 | $custom_output = ''; |
996 | - $file_name = MODX_BASE_PATH . 'assets/tvs/' . $custom['1'] . '/' . $custom['1'] . '.customtv.php'; |
|
996 | + $file_name = MODX_BASE_PATH.'assets/tvs/'.$custom['1'].'/'.$custom['1'].'.customtv.php'; |
|
997 | 997 | if (!file_exists($file_name)) { |
998 | - $custom_output = $file_name . ' does not exist'; |
|
998 | + $custom_output = $file_name.' does not exist'; |
|
999 | 999 | } else { |
1000 | 1000 | ob_start(); |
1001 | 1001 | include $file_name; |
@@ -1019,7 +1019,7 @@ discard block |
||
1019 | 1019 | } // end renderFormElement function |
1020 | 1020 | } |
1021 | 1021 | |
1022 | -if (! function_exists('ParseIntputOptions')) { |
|
1022 | +if (!function_exists('ParseIntputOptions')) { |
|
1023 | 1023 | /** |
1024 | 1024 | * @param string|array|mysqli_result $v |
1025 | 1025 | * @return array |
@@ -237,7 +237,7 @@ |
||
237 | 237 | /** |
238 | 238 | * build siteCache file |
239 | 239 | * @param DocumentParser $modx |
240 | - * @return boolean success |
|
240 | + * @return null|boolean success |
|
241 | 241 | */ |
242 | 242 | public function buildCache($modx) |
243 | 243 | { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | if (isset($this->aliases[$id])) { |
101 | 101 | if ($this->aliasVisible[$id] == 1) { |
102 | 102 | if ($path != '') { |
103 | - $path = $this->aliases[$id] . '/' . $path; |
|
103 | + $path = $this->aliases[$id].'/'.$path; |
|
104 | 104 | } else { |
105 | 105 | $path = $this->aliases[$id]; |
106 | 106 | } |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | $modx->messageQuit("Cache path not set."); |
125 | 125 | } |
126 | 126 | |
127 | - $files = glob(realpath($this->cachePath) . '/*.pageCache.php'); |
|
127 | + $files = glob(realpath($this->cachePath).'/*.pageCache.php'); |
|
128 | 128 | $filesincache = count($files); |
129 | 129 | $deletedfiles = array(); |
130 | 130 | while ($file = array_shift($files)) { |
@@ -159,9 +159,9 @@ discard block |
||
159 | 159 | if (isset($opcache)) { |
160 | 160 | echo '<p>Opcache empty.</p>'; |
161 | 161 | } |
162 | - echo '<p>' . $_lang['cache_files_deleted'] . '</p><ul>'; |
|
162 | + echo '<p>'.$_lang['cache_files_deleted'].'</p><ul>'; |
|
163 | 163 | foreach ($deletedfiles as $deletedfile) { |
164 | - echo '<li>' . $deletedfile . '</li>'; |
|
164 | + echo '<li>'.$deletedfile.'</li>'; |
|
165 | 165 | } |
166 | 166 | echo '</ul>'; |
167 | 167 | } |
@@ -180,11 +180,11 @@ discard block |
||
180 | 180 | |
181 | 181 | |
182 | 182 | // write the file |
183 | - $content = '<?php' . "\n"; |
|
184 | - $content .= '$recent_update=\'' . $this->request_time . '\';' . "\n"; |
|
185 | - $content .= '$cacheRefreshTime=\'' . $cacheRefreshTime . '\';' . "\n"; |
|
183 | + $content = '<?php'."\n"; |
|
184 | + $content .= '$recent_update=\''.$this->request_time.'\';'."\n"; |
|
185 | + $content .= '$cacheRefreshTime=\''.$cacheRefreshTime.'\';'."\n"; |
|
186 | 186 | |
187 | - $filename = $this->cachePath . '/sitePublishing.idx.php'; |
|
187 | + $filename = $this->cachePath.'/sitePublishing.idx.php'; |
|
188 | 188 | if (!$handle = fopen($filename, 'w')) { |
189 | 189 | exit("Cannot open file ({$filename}"); |
190 | 190 | } |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | $result = $modx->getDatabase()->select( |
211 | 211 | 'MIN(pub_date) AS minpub', |
212 | 212 | $modx->getDatabase()->getFullTableName('site_content'), |
213 | - 'pub_date>' . $this->request_time |
|
213 | + 'pub_date>'.$this->request_time |
|
214 | 214 | ); |
215 | 215 | if (!$result) { |
216 | 216 | echo "Couldn't determine next publish event!"; |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | $result = $modx->getDatabase()->select( |
225 | 225 | 'MIN(unpub_date) AS minunpub', |
226 | 226 | $modx->getDatabase()->getFullTableName('site_content'), |
227 | - 'unpub_date>' . $this->request_time |
|
227 | + 'unpub_date>'.$this->request_time |
|
228 | 228 | ); |
229 | 229 | if (!$result) { |
230 | 230 | echo "Couldn't determine next unpublish event!"; |
@@ -264,7 +264,7 @@ discard block |
||
264 | 264 | $config = array(); |
265 | 265 | $content .= '$c=&$this->config;'; |
266 | 266 | while (list($key, $value) = $modx->getDatabase()->getRow($rs, 'num')) { |
267 | - $content .= '$c[\'' . $key . '\']="' . $this->escapeDoubleQuotes($value) . '";'; |
|
267 | + $content .= '$c[\''.$key.'\']="'.$this->escapeDoubleQuotes($value).'";'; |
|
268 | 268 | $config[$key] = $value; |
269 | 269 | } |
270 | 270 | |
@@ -285,8 +285,8 @@ discard block |
||
285 | 285 | $f['isfolder'] = 'c.isfolder'; |
286 | 286 | $f['alias_visible'] = 'c.alias_visible'; |
287 | 287 | $from = array(); |
288 | - $from[] = $modx->getDatabase()->getFullTableName('site_content') . ' c'; |
|
289 | - $from[] = 'LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_content') . ' p ON p.id=c.parent'; |
|
288 | + $from[] = $modx->getDatabase()->getFullTableName('site_content').' c'; |
|
289 | + $from[] = 'LEFT JOIN '.$modx->getDatabase()->getFullTableName('site_content').' p ON p.id=c.parent'; |
|
290 | 290 | $where = 'c.deleted=0 AND (c.isfolder=1 OR p.alias_visible=0)'; |
291 | 291 | $rs = $modx->getDatabase()->select($f, $from, $where, 'c.parent, c.menuindex'); |
292 | 292 | } else { |
@@ -308,16 +308,16 @@ discard block |
||
308 | 308 | $docid = $doc['id']; |
309 | 309 | if ($use_alias_path) { |
310 | 310 | $tmpPath = $this->getParents($doc['parent']); |
311 | - $alias = (strlen($tmpPath) > 0 ? "$tmpPath/" : '') . $doc['alias']; |
|
311 | + $alias = (strlen($tmpPath) > 0 ? "$tmpPath/" : '').$doc['alias']; |
|
312 | 312 | $key = $alias; |
313 | 313 | } else { |
314 | 314 | $key = $doc['alias']; |
315 | 315 | } |
316 | 316 | |
317 | 317 | $doc['path'] = $tmpPath; |
318 | - $content .= '$a[' . $docid . ']=array(\'id\'=>' . $docid . ',\'alias\'=>\'' . $doc['alias'] . '\',\'path\'=>\'' . $doc['path'] . '\',\'parent\'=>' . $doc['parent'] . ',\'isfolder\'=>' . $doc['isfolder'] . ',\'alias_visible\'=>' . $doc['alias_visible'] . ');'; |
|
319 | - $content .= '$d[\'' . $key . '\']=' . $docid . ';'; |
|
320 | - $content .= '$m[]=array(' . $doc['parent'] . '=>' . $docid . ');'; |
|
318 | + $content .= '$a['.$docid.']=array(\'id\'=>'.$docid.',\'alias\'=>\''.$doc['alias'].'\',\'path\'=>\''.$doc['path'].'\',\'parent\'=>'.$doc['parent'].',\'isfolder\'=>'.$doc['isfolder'].',\'alias_visible\'=>'.$doc['alias_visible'].');'; |
|
319 | + $content .= '$d[\''.$key.'\']='.$docid.';'; |
|
320 | + $content .= '$m[]=array('.$doc['parent'].'=>'.$docid.');'; |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | // get content types |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | ); |
329 | 329 | $content .= '$c=&$this->contentTypes;'; |
330 | 330 | while ($doc = $modx->getDatabase()->getRow($rs)) { |
331 | - $content .= '$c[\'' . $doc['id'] . '\']=\'' . $doc['contentType'] . '\';'; |
|
331 | + $content .= '$c[\''.$doc['id'].'\']=\''.$doc['contentType'].'\';'; |
|
332 | 332 | } |
333 | 333 | |
334 | 334 | // WRITE Chunks to cache file |
@@ -338,30 +338,30 @@ discard block |
||
338 | 338 | if ($modx->config['minifyphp_incache']) { |
339 | 339 | $doc['snippet'] = $this->php_strip_whitespace($doc['snippet']); |
340 | 340 | } |
341 | - $content .= '$c[\'' . $doc['name'] . '\']=\'' . ($doc['disabled'] ? '' : $this->escapeSingleQuotes($doc['snippet'])) . '\';'; |
|
341 | + $content .= '$c[\''.$doc['name'].'\']=\''.($doc['disabled'] ? '' : $this->escapeSingleQuotes($doc['snippet'])).'\';'; |
|
342 | 342 | } |
343 | 343 | |
344 | 344 | // WRITE snippets to cache file |
345 | 345 | $f = 'ss.*, sm.properties as sharedproperties'; |
346 | - $from = $modx->getDatabase()->getFullTableName('site_snippets') . ' ss LEFT JOIN ' . |
|
347 | - $modx->getDatabase()->getFullTableName('site_modules') . ' sm on sm.guid=ss.moduleguid'; |
|
346 | + $from = $modx->getDatabase()->getFullTableName('site_snippets').' ss LEFT JOIN '. |
|
347 | + $modx->getDatabase()->getFullTableName('site_modules').' sm on sm.guid=ss.moduleguid'; |
|
348 | 348 | $rs = $modx->getDatabase()->select($f, $from); |
349 | 349 | $content .= '$s=&$this->snippetCache;'; |
350 | 350 | while ($row = $modx->getDatabase()->getRow($rs)) { |
351 | 351 | $key = $row['name']; |
352 | 352 | if ($row['disabled']) { |
353 | - $content .= '$s[\'' . $key . '\']=\'return false;\';'; |
|
353 | + $content .= '$s[\''.$key.'\']=\'return false;\';'; |
|
354 | 354 | } else { |
355 | 355 | $value = trim($row['snippet']); |
356 | 356 | if ($modx->config['minifyphp_incache']) { |
357 | 357 | $value = $this->php_strip_whitespace($value); |
358 | 358 | } |
359 | - $content .= '$s[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';'; |
|
359 | + $content .= '$s[\''.$key.'\']=\''.$this->escapeSingleQuotes($value).'\';'; |
|
360 | 360 | $properties = $modx->parseProperties($row['properties']); |
361 | 361 | $sharedproperties = $modx->parseProperties($row['sharedproperties']); |
362 | 362 | $properties = array_merge($sharedproperties, $properties); |
363 | 363 | if (0 < count($properties)) { |
364 | - $content .= '$s[\'' . $key . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';'; |
|
364 | + $content .= '$s[\''.$key.'Props\']=\''.$this->escapeSingleQuotes(json_encode($properties)).'\';'; |
|
365 | 365 | } |
366 | 366 | } |
367 | 367 | } |
@@ -369,8 +369,8 @@ discard block |
||
369 | 369 | // WRITE plugins to cache file |
370 | 370 | $f = 'sp.*, sm.properties as sharedproperties'; |
371 | 371 | $from = array(); |
372 | - $from[] = $modx->getDatabase()->getFullTableName('site_plugins') . ' sp'; |
|
373 | - $from[] = 'LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_modules') . ' sm on sm.guid=sp.moduleguid'; |
|
372 | + $from[] = $modx->getDatabase()->getFullTableName('site_plugins').' sp'; |
|
373 | + $from[] = 'LEFT JOIN '.$modx->getDatabase()->getFullTableName('site_modules').' sm on sm.guid=sp.moduleguid'; |
|
374 | 374 | $rs = $modx->getDatabase()->select($f, $from, 'sp.disabled=0'); |
375 | 375 | $content .= '$p=&$this->pluginCache;'; |
376 | 376 | while ($row = $modx->getDatabase()->getRow($rs)) { |
@@ -379,13 +379,13 @@ discard block |
||
379 | 379 | if ($modx->config['minifyphp_incache']) { |
380 | 380 | $value = $this->php_strip_whitespace($value); |
381 | 381 | } |
382 | - $content .= '$p[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';'; |
|
382 | + $content .= '$p[\''.$key.'\']=\''.$this->escapeSingleQuotes($value).'\';'; |
|
383 | 383 | if ($row['properties'] != '' || $row['sharedproperties'] != '') { |
384 | 384 | $properties = $modx->parseProperties($row['properties']); |
385 | 385 | $sharedproperties = $modx->parseProperties($row['sharedproperties']); |
386 | 386 | $properties = array_merge($sharedproperties, $properties); |
387 | 387 | if (0 < count($properties)) { |
388 | - $content .= '$p[\'' . $key . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';'; |
|
388 | + $content .= '$p[\''.$key.'Props\']=\''.$this->escapeSingleQuotes(json_encode($properties)).'\';'; |
|
389 | 389 | } |
390 | 390 | } |
391 | 391 | } |
@@ -393,9 +393,9 @@ discard block |
||
393 | 393 | // WRITE system event triggers |
394 | 394 | $f = 'sysevt.name as evtname, event.pluginid, plugin.name as pname'; |
395 | 395 | $from = array(); |
396 | - $from[] = $modx->getDatabase()->getFullTableName('system_eventnames') . ' sysevt'; |
|
397 | - $from[] = 'INNER JOIN ' . $modx->getDatabase()->getFullTableName('site_plugin_events') . ' event ON event.evtid=sysevt.id'; |
|
398 | - $from[] = 'INNER JOIN ' . $modx->getDatabase()->getFullTableName('site_plugins') . ' plugin ON plugin.id=event.pluginid'; |
|
396 | + $from[] = $modx->getDatabase()->getFullTableName('system_eventnames').' sysevt'; |
|
397 | + $from[] = 'INNER JOIN '.$modx->getDatabase()->getFullTableName('site_plugin_events').' event ON event.evtid=sysevt.id'; |
|
398 | + $from[] = 'INNER JOIN '.$modx->getDatabase()->getFullTableName('site_plugins').' plugin ON plugin.id=event.pluginid'; |
|
399 | 399 | $rs = $modx->getDatabase()->select($f, $from, 'plugin.disabled=0', 'sysevt.name, event.priority'); |
400 | 400 | $content .= '$e=&$this->pluginEvent;'; |
401 | 401 | $events = array(); |
@@ -408,14 +408,14 @@ discard block |
||
408 | 408 | } |
409 | 409 | foreach ($events as $evtname => $pluginnames) { |
410 | 410 | $events[$evtname] = $pluginnames; |
411 | - $content .= '$e[\'' . $evtname . '\']=array(\'' . implode('\',\'', |
|
412 | - $this->escapeSingleQuotes($pluginnames)) . '\');'; |
|
411 | + $content .= '$e[\''.$evtname.'\']=array(\''.implode('\',\'', |
|
412 | + $this->escapeSingleQuotes($pluginnames)).'\');'; |
|
413 | 413 | } |
414 | 414 | |
415 | 415 | $content .= "\n"; |
416 | 416 | |
417 | 417 | // close and write the file |
418 | - $filename = $this->cachePath . 'siteCache.idx.php'; |
|
418 | + $filename = $this->cachePath.'siteCache.idx.php'; |
|
419 | 419 | |
420 | 420 | // invoke OnBeforeCacheUpdate event |
421 | 421 | if ($modx) { |
@@ -426,8 +426,8 @@ discard block |
||
426 | 426 | exit("Cannot write main MODX cache file! Make sure the assets/cache directory is writable!"); |
427 | 427 | } |
428 | 428 | |
429 | - if (!is_file($this->cachePath . '/.htaccess')) { |
|
430 | - file_put_contents($this->cachePath . '/.htaccess', "order deny,allow\ndeny from all\n"); |
|
429 | + if (!is_file($this->cachePath.'/.htaccess')) { |
|
430 | + file_put_contents($this->cachePath.'/.htaccess', "order deny,allow\ndeny from all\n"); |
|
431 | 431 | } |
432 | 432 | |
433 | 433 | // invoke OnCacheUpdate event |
@@ -449,7 +449,7 @@ discard block |
||
449 | 449 | |
450 | 450 | $source = trim($source); |
451 | 451 | if (substr($source, 0, 5) !== '<?php') { |
452 | - $source = '<?php ' . $source; |
|
452 | + $source = '<?php '.$source; |
|
453 | 453 | } |
454 | 454 | |
455 | 455 | $tokens = token_get_all($source); |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | } |
508 | 508 | } |
509 | 509 | $source = preg_replace(array('@^<\?php@i', '|\s+|', '|<!--|', '|-->|', '|-->\s+<!--|'), |
510 | - array('', ' ', "\n" . '<!--', '-->' . "\n", '-->' . "\n" . '<!--'), $_); |
|
510 | + array('', ' ', "\n".'<!--', '-->'."\n", '-->'."\n".'<!--'), $_); |
|
511 | 511 | $source = trim($source); |
512 | 512 | |
513 | 513 | return $source; |
@@ -82,7 +82,8 @@ discard block |
||
82 | 82 | * @return string |
83 | 83 | */ |
84 | 84 | public function getParents($id, $path = '') |
85 | - { // modx:returns child's parent |
|
85 | + { |
|
86 | +// modx:returns child's parent |
|
86 | 87 | $modx = evolutionCMS(); |
87 | 88 | if (empty($this->aliases)) { |
88 | 89 | $rs = $modx->getDatabase()->select( |
@@ -481,7 +482,8 @@ discard block |
||
481 | 482 | $_ = trim($_); |
482 | 483 | } |
483 | 484 | $lastChar = substr($_, -1); |
484 | - if (!in_array($lastChar, $chars)) {// ,320,327,288,284,289 |
|
485 | + if (!in_array($lastChar, $chars)) { |
|
486 | +// ,320,327,288,284,289 |
|
485 | 487 | if (!in_array($prev_token, |
486 | 488 | array(T_FOREACH, T_WHILE, T_FOR, T_BOOLEAN_AND, T_BOOLEAN_OR, T_DOUBLE_ARROW))) { |
487 | 489 | $_ .= ' '; |
@@ -63,7 +63,7 @@ |
||
63 | 63 | } |
64 | 64 | |
65 | 65 | /** |
66 | - * @return mixed |
|
66 | + * @return string |
|
67 | 67 | */ |
68 | 68 | public function getOutput() |
69 | 69 | { |
@@ -35,7 +35,7 @@ |
||
35 | 35 | if (is_array($SystemAlertMsgQueque)) { |
36 | 36 | $title = ''; |
37 | 37 | if ($this->name && $this->activePlugin) { |
38 | - $title = "<div><b>" . $this->activePlugin . "</b> - <span style='color:maroon;'>" . $this->name . "</span></div>"; |
|
38 | + $title = "<div><b>".$this->activePlugin."</b> - <span style='color:maroon;'>".$this->name."</span></div>"; |
|
39 | 39 | } |
40 | 40 | $SystemAlertMsgQueque[] = "$title<div style='margin-left:10px;margin-top:3px;'>$msg</div>"; |
41 | 41 | } |
@@ -278,8 +278,7 @@ discard block |
||
278 | 278 | /** |
279 | 279 | * Sets the width attribute of each column in the array. |
280 | 280 | * |
281 | - * @param array $value An Array of column widths in the order of the keys in the |
|
282 | - * source table array. |
|
281 | + * @param string[] $widthArray |
|
283 | 282 | */ |
284 | 283 | public function setColumnWidths($widthArray) |
285 | 284 | { |
@@ -289,7 +288,6 @@ discard block |
||
289 | 288 | /** |
290 | 289 | * An optional array of values that can be preselected when using |
291 | 290 | * |
292 | - * @param array $value Indicates the INPUT form element type attribute. |
|
293 | 291 | */ |
294 | 292 | public function setSelectedValues($valueArray) |
295 | 293 | { |
@@ -326,7 +324,7 @@ discard block |
||
326 | 324 | /** |
327 | 325 | * Determines what class the current row should have applied. |
328 | 326 | * |
329 | - * @param int $value The position of the current row being rendered. |
|
327 | + * @param integer $position |
|
330 | 328 | * @return string |
331 | 329 | */ |
332 | 330 | public function determineRowClass($position) |
@@ -353,7 +351,6 @@ discard block |
||
353 | 351 | * Generates an onclick action applied to the current cell, to execute |
354 | 352 | * any specified cell actions. |
355 | 353 | * |
356 | - * @param string $value Indicates the INPUT form element type attribute. |
|
357 | 354 | * @return string |
358 | 355 | */ |
359 | 356 | public function getCellAction($currentActionFieldValue) |
@@ -395,7 +392,7 @@ discard block |
||
395 | 392 | /** |
396 | 393 | * Function to prepare a link generated in the table cell/link actions. |
397 | 394 | * |
398 | - * @param string $value Indicates the INPUT form element type attribute. |
|
395 | + * @param string $link |
|
399 | 396 | * @return string |
400 | 397 | */ |
401 | 398 | public function prepareLink($link) |
@@ -414,7 +411,7 @@ discard block |
||
414 | 411 | * |
415 | 412 | * @param array $fieldsArray The associative array representing the table rows |
416 | 413 | * and columns. |
417 | - * @param array $fieldHeadersArray An optional array of values for providing |
|
414 | + * @param string[] $fieldHeadersArray An optional array of values for providing |
|
418 | 415 | * alternative field headers; this is an associative arrays of keys from |
419 | 416 | * the $fieldsArray where the values represent the alt heading content |
420 | 417 | * for each column. |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | public function setTableWidth($value) |
132 | 132 | { |
133 | - $this->tableWidth = (int)$value; |
|
133 | + $this->tableWidth = (int) $value; |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | /** |
@@ -317,7 +317,7 @@ discard block |
||
317 | 317 | { |
318 | 318 | $currentWidth = ''; |
319 | 319 | if (is_array($this->columnWidths)) { |
320 | - $currentWidth = $this->columnWidths[$columnPosition] ? ' width="' . $this->columnWidths[$columnPosition] . '" ' : ''; |
|
320 | + $currentWidth = $this->columnWidths[$columnPosition] ? ' width="'.$this->columnWidths[$columnPosition].'" ' : ''; |
|
321 | 321 | } |
322 | 322 | |
323 | 323 | return $currentWidth; |
@@ -346,7 +346,7 @@ discard block |
||
346 | 346 | $currentClass = $this->rowAlternateClass; |
347 | 347 | } |
348 | 348 | |
349 | - return ' class="' . $currentClass . '"'; |
|
349 | + return ' class="'.$currentClass.'"'; |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | /** |
@@ -360,7 +360,7 @@ discard block |
||
360 | 360 | { |
361 | 361 | $cellAction = ''; |
362 | 362 | if ($this->cellAction) { |
363 | - $cellAction = ' onClick="javascript:window.location=\'' . $this->cellAction . $this->actionField . '=' . urlencode($currentActionFieldValue) . '\'" '; |
|
363 | + $cellAction = ' onClick="javascript:window.location=\''.$this->cellAction.$this->actionField.'='.urlencode($currentActionFieldValue).'\'" '; |
|
364 | 364 | } |
365 | 365 | |
366 | 366 | return $cellAction; |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | { |
378 | 378 | $cell = $value; |
379 | 379 | if ($this->linkAction) { |
380 | - $cell = '<a href="' . $this->linkAction . $this->actionField . '=' . urlencode($currentActionFieldValue) . '">' . $cell . '</a>'; |
|
380 | + $cell = '<a href="'.$this->linkAction.$this->actionField.'='.urlencode($currentActionFieldValue).'">'.$cell.'</a>'; |
|
381 | 381 | } |
382 | 382 | |
383 | 383 | return $cell; |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | $end = '?'; |
407 | 407 | } |
408 | 408 | |
409 | - return $link . $end; |
|
409 | + return $link.$end; |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | /** |
@@ -426,7 +426,7 @@ discard block |
||
426 | 426 | if (is_array($fieldsArray)) { |
427 | 427 | $i = 0; |
428 | 428 | foreach ($fieldsArray as $fieldName => $fieldValue) { |
429 | - $table .= "\t<tr" . $this->determineRowClass($i) . ">\n"; |
|
429 | + $table .= "\t<tr".$this->determineRowClass($i).">\n"; |
|
430 | 430 | $currentActionFieldValue = $fieldValue[$this->actionField]; |
431 | 431 | if (is_array($this->selectedValues)) { |
432 | 432 | $isChecked = array_search($currentActionFieldValue, $this->selectedValues) === false ? 0 : 1; |
@@ -437,15 +437,15 @@ discard block |
||
437 | 437 | $colPosition = 0; |
438 | 438 | foreach ($fieldValue as $key => $value) { |
439 | 439 | if (!in_array($key, $this->excludeFields)) { |
440 | - $table .= "\t\t<td" . $this->getCellAction($currentActionFieldValue) . ">"; |
|
440 | + $table .= "\t\t<td".$this->getCellAction($currentActionFieldValue).">"; |
|
441 | 441 | $table .= $this->createCellText($currentActionFieldValue, $value); |
442 | 442 | $table .= "</td>\n"; |
443 | 443 | if ($i == 0) { |
444 | 444 | if (empty ($header) && $this->formElementType) { |
445 | - $header .= "\t\t<th style=\"width:32px\" " . ($this->thClass ? 'class="' . $this->thClass . '"' : '') . ">" . ($this->allOption ? '<a href="javascript:clickAll()">all</a>' : '') . "</th>\n"; |
|
445 | + $header .= "\t\t<th style=\"width:32px\" ".($this->thClass ? 'class="'.$this->thClass.'"' : '').">".($this->allOption ? '<a href="javascript:clickAll()">all</a>' : '')."</th>\n"; |
|
446 | 446 | } |
447 | 447 | $headerText = array_key_exists($key, $fieldHeadersArray) ? $fieldHeadersArray[$key] : $key; |
448 | - $header .= "\t\t<th" . $this->getColumnWidth($colPosition) . ($this->thClass ? ' class="' . $this->thClass . '" ' : '') . ">" . $headerText . "</th>\n"; |
|
448 | + $header .= "\t\t<th".$this->getColumnWidth($colPosition).($this->thClass ? ' class="'.$this->thClass.'" ' : '').">".$headerText."</th>\n"; |
|
449 | 449 | } |
450 | 450 | $colPosition++; |
451 | 451 | } |
@@ -453,9 +453,9 @@ discard block |
||
453 | 453 | $i++; |
454 | 454 | $table .= "\t</tr>\n"; |
455 | 455 | } |
456 | - $table = "\n" . '<table' . ($this->tableWidth > 0 ? ' width="' . $this->tableWidth . '"' : '') . ($this->tableClass ? ' class="' . $this->tableClass . '"' : '') . ($this->tableID ? ' id="' . $this->tableID . '"' : '') . ">\n" . ($header ? "\t<thead>\n\t<tr class=\"" . $this->rowHeaderClass . "\">\n" . $header . "\t</tr>\n\t</thead>\n" : '') . $table . "</table>\n"; |
|
456 | + $table = "\n".'<table'.($this->tableWidth > 0 ? ' width="'.$this->tableWidth.'"' : '').($this->tableClass ? ' class="'.$this->tableClass.'"' : '').($this->tableID ? ' id="'.$this->tableID.'"' : '').">\n".($header ? "\t<thead>\n\t<tr class=\"".$this->rowHeaderClass."\">\n".$header."\t</tr>\n\t</thead>\n" : '').$table."</table>\n"; |
|
457 | 457 | if ($this->formElementType) { |
458 | - $table = "\n" . '<form id="' . $this->formName . '" name="' . $this->formName . '" action="' . $this->formAction . '" method="POST">' . $table; |
|
458 | + $table = "\n".'<form id="'.$this->formName.'" name="'.$this->formName.'" action="'.$this->formAction.'" method="POST">'.$table; |
|
459 | 459 | } |
460 | 460 | if (strlen($this->pageNav) > 1) {//changed to display the pagination if exists. |
461 | 461 | /* commented this part because of cookie |
@@ -469,7 +469,7 @@ discard block |
||
469 | 469 | |
470 | 470 | $table .= '</select>'.$_lang["pagination_table_perpage"].'</div>'; |
471 | 471 | */ |
472 | - $table .= '<div id="pagination" class="paginate">' . $_lang["pagination_table_gotopage"] . '<ul>' . $this->pageNav . '</ul></div>'; |
|
472 | + $table .= '<div id="pagination" class="paginate">'.$_lang["pagination_table_gotopage"].'<ul>'.$this->pageNav.'</ul></div>'; |
|
473 | 473 | //$table .= '<script language="javascript">function updatePageSize(size){window.location = \''.$this->prepareLink($linkpage).'pageSize=\'+size;}</script>'; |
474 | 474 | |
475 | 475 | } |
@@ -478,7 +478,7 @@ discard block |
||
478 | 478 | <script language="javascript"> |
479 | 479 | toggled = 0; |
480 | 480 | function clickAll() { |
481 | - myform = document.getElementById("' . $this->formName . '"); |
|
481 | + myform = document.getElementById("' . $this->formName.'"); |
|
482 | 482 | for(i=0;i<myform.length;i++) { |
483 | 483 | if(myform.elements[i].type==\'checkbox\') { |
484 | 484 | myform.elements[i].checked=(toggled?false:true); |
@@ -490,9 +490,9 @@ discard block |
||
490 | 490 | } |
491 | 491 | if ($this->formElementType) { |
492 | 492 | if ($this->extra) { |
493 | - $table .= "\n" . $this->extra . "\n"; |
|
493 | + $table .= "\n".$this->extra."\n"; |
|
494 | 494 | } |
495 | - $table .= "\n" . '</form>' . "\n"; |
|
495 | + $table .= "\n".'</form>'."\n"; |
|
496 | 496 | } |
497 | 497 | |
498 | 498 | return $table; |
@@ -515,7 +515,7 @@ discard block |
||
515 | 515 | $numPages = ceil($numRecords / MAX_DISPLAY_RECORDS_NUM); |
516 | 516 | $nav = ''; |
517 | 517 | if ($numPages > 1) { |
518 | - $currentURL = empty($qs) ? '' : '?' . $qs; |
|
518 | + $currentURL = empty($qs) ? '' : '?'.$qs; |
|
519 | 519 | if ($currentPage > 6) { |
520 | 520 | $nav .= $this->createPageLink($currentURL, 1, $_lang["pagination_table_first"]); |
521 | 521 | } |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | $nav .= $this->createPageLink($currentURL, $numPages, $_lang["pagination_table_last"]); |
541 | 541 | } |
542 | 542 | } |
543 | - $this->pageNav = ' ' . $nav; |
|
543 | + $this->pageNav = ' '.$nav; |
|
544 | 544 | } |
545 | 545 | |
546 | 546 | /** |
@@ -556,14 +556,14 @@ discard block |
||
556 | 556 | public function createPageLink($link = '', $pageNum, $displayText, $currentPage = false, $qs = '') |
557 | 557 | { |
558 | 558 | $modx = evolutionCMS(); |
559 | - $orderBy = !empty($_GET['orderby']) ? '&orderby=' . $_GET['orderby'] : ''; |
|
560 | - $orderDir = !empty($_GET['orderdir']) ? '&orderdir=' . $_GET['orderdir'] : ''; |
|
559 | + $orderBy = !empty($_GET['orderby']) ? '&orderby='.$_GET['orderby'] : ''; |
|
560 | + $orderDir = !empty($_GET['orderdir']) ? '&orderdir='.$_GET['orderdir'] : ''; |
|
561 | 561 | if (!empty($qs)) { |
562 | 562 | $qs = "?$qs"; |
563 | 563 | } |
564 | 564 | $link = empty($link) ? $modx->makeUrl($modx->documentIdentifier, $modx->documentObject['alias'], |
565 | - $qs . "page=$pageNum$orderBy$orderDir") : $this->prepareLink($link) . "page=$pageNum"; |
|
566 | - $nav = '<li' . ($currentPage ? ' class="currentPage"' : '') . '><a' . ($currentPage ? ' class="currentPage"' : '') . ' href="' . $link . '">' . $displayText . '</a></li>' . "\n"; |
|
565 | + $qs."page=$pageNum$orderBy$orderDir") : $this->prepareLink($link)."page=$pageNum"; |
|
566 | + $nav = '<li'.($currentPage ? ' class="currentPage"' : '').'><a'.($currentPage ? ' class="currentPage"' : '').' href="'.$link.'">'.$displayText.'</a></li>'."\n"; |
|
567 | 567 | |
568 | 568 | return $nav; |
569 | 569 | } |
@@ -581,7 +581,7 @@ discard block |
||
581 | 581 | $field = ''; |
582 | 582 | if ($this->formElementType) { |
583 | 583 | $checked = $isChecked ? "checked " : ""; |
584 | - $field = "\t\t" . '<td><input type="' . $this->formElementType . '" name="' . ($this->formElementName ? $this->formElementName : $value) . '" value="' . $value . '" ' . $checked . '/></td>' . "\n"; |
|
584 | + $field = "\t\t".'<td><input type="'.$this->formElementType.'" name="'.($this->formElementName ? $this->formElementName : $value).'" value="'.$value.'" '.$checked.'/></td>'."\n"; |
|
585 | 585 | } |
586 | 586 | |
587 | 587 | return $field; |
@@ -595,7 +595,7 @@ discard block |
||
595 | 595 | public function handlePaging() |
596 | 596 | { |
597 | 597 | $offset = (is_numeric($_GET['page']) && $_GET['page'] > 0) ? $_GET['page'] - 1 : 0; |
598 | - $limitClause = ' LIMIT ' . ($offset * MAX_DISPLAY_RECORDS_NUM) . ', ' . MAX_DISPLAY_RECORDS_NUM; |
|
598 | + $limitClause = ' LIMIT '.($offset * MAX_DISPLAY_RECORDS_NUM).', '.MAX_DISPLAY_RECORDS_NUM; |
|
599 | 599 | |
600 | 600 | return $limitClause; |
601 | 601 | } |
@@ -610,10 +610,10 @@ discard block |
||
610 | 610 | public function handleSorting($natural_order = false) |
611 | 611 | { |
612 | 612 | $orderByClause = ''; |
613 | - if ((bool)$natural_order === false) { |
|
613 | + if ((bool) $natural_order === false) { |
|
614 | 614 | $orderby = !empty($_GET['orderby']) ? $_GET['orderby'] : "id"; |
615 | 615 | $orderdir = !empty($_GET['orderdir']) ? $_GET['orderdir'] : "DESC"; |
616 | - $orderByClause = !empty($orderby) ? ' ORDER BY ' . $orderby . ' ' . $orderdir . ' ' : ""; |
|
616 | + $orderByClause = !empty($orderby) ? ' ORDER BY '.$orderby.' '.$orderdir.' ' : ""; |
|
617 | 617 | } |
618 | 618 | |
619 | 619 | return $orderByClause; |
@@ -642,7 +642,7 @@ discard block |
||
642 | 642 | } |
643 | 643 | } |
644 | 644 | |
645 | - return '<a href="[~' . $modx->documentIdentifier . '~]?' . $qs . 'orderby=' . $key . $orderDir . '">' . $text . '</a>'; |
|
645 | + return '<a href="[~'.$modx->documentIdentifier.'~]?'.$qs.'orderby='.$key.$orderDir.'">'.$text.'</a>'; |
|
646 | 646 | } |
647 | 647 | |
648 | 648 | } |
@@ -457,7 +457,8 @@ |
||
457 | 457 | if ($this->formElementType) { |
458 | 458 | $table = "\n" . '<form id="' . $this->formName . '" name="' . $this->formName . '" action="' . $this->formAction . '" method="POST">' . $table; |
459 | 459 | } |
460 | - if (strlen($this->pageNav) > 1) {//changed to display the pagination if exists. |
|
460 | + if (strlen($this->pageNav) > 1) { |
|
461 | +//changed to display the pagination if exists. |
|
461 | 462 | /* commented this part because of cookie |
462 | 463 | $table .= '<div id="max-display-records" ><select style="display:inline" onchange="javascript:updatePageSize(this[this.selectedIndex].value);">'; |
463 | 464 | $pageSizes= array (10, 25, 50, 100, 250); |
@@ -149,7 +149,7 @@ |
||
149 | 149 | /** |
150 | 150 | * This function returns the current page number. |
151 | 151 | * |
152 | - * @return int |
|
152 | + * @return string |
|
153 | 153 | */ |
154 | 154 | public function getCurrentPage() |
155 | 155 | { |
@@ -101,14 +101,14 @@ discard block |
||
101 | 101 | $array_paging['total'] = $this->int_nbr_row; |
102 | 102 | |
103 | 103 | if ($this->int_cur_position != 0) { |
104 | - $array_paging['first_link'] = "<a href=\"$PHP_SELF?int_cur_position=0" . $this->str_ext_argv . "\">"; |
|
105 | - $array_paging['previous_link'] = "<a href=\"$PHP_SELF?int_cur_position=" . ($this->int_cur_position - $this->int_num_result) . $this->str_ext_argv . "\">"; |
|
104 | + $array_paging['first_link'] = "<a href=\"$PHP_SELF?int_cur_position=0".$this->str_ext_argv."\">"; |
|
105 | + $array_paging['previous_link'] = "<a href=\"$PHP_SELF?int_cur_position=".($this->int_cur_position - $this->int_num_result).$this->str_ext_argv."\">"; |
|
106 | 106 | } |
107 | 107 | |
108 | 108 | if (($this->int_nbr_row - $this->int_cur_position) > $this->int_num_result) { |
109 | 109 | $int_new_position = $this->int_cur_position + $this->int_num_result; |
110 | - $array_paging['last_link'] = "<a href=\"$PHP_SELF?int_cur_position=" . $this->int_nbr_row . $this->str_ext_argv . "\">"; |
|
111 | - $array_paging['next_link'] = "<a href=\"$PHP_SELF?int_cur_position=$int_new_position" . $this->str_ext_argv . "\">"; |
|
110 | + $array_paging['last_link'] = "<a href=\"$PHP_SELF?int_cur_position=".$this->int_nbr_row.$this->str_ext_argv."\">"; |
|
111 | + $array_paging['next_link'] = "<a href=\"$PHP_SELF?int_cur_position=$int_new_position".$this->str_ext_argv."\">"; |
|
112 | 112 | } |
113 | 113 | |
114 | 114 | return $array_paging; |
@@ -126,10 +126,10 @@ discard block |
||
126 | 126 | for ($i = 0; $i < $this->getNumberOfPage(); $i++) { |
127 | 127 | // if current page, do not make a link |
128 | 128 | if ($i == $this->getCurrentPage()) { |
129 | - $array_all_page[$i] = "<b>" . ($i + 1) . "</b> "; |
|
129 | + $array_all_page[$i] = "<b>".($i + 1)."</b> "; |
|
130 | 130 | } else { |
131 | 131 | $int_new_position = ($i * $this->int_num_result); |
132 | - $array_all_page[$i] = "<a href=\"" . $PHP_SELF . "?int_cur_position=$int_new_position$this->str_ext_argv\">" . ($i + 1) . "</a> "; |
|
132 | + $array_all_page[$i] = "<a href=\"".$PHP_SELF."?int_cur_position=$int_new_position$this->str_ext_argv\">".($i + 1)."</a> "; |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 |
@@ -5,7 +5,7 @@ |
||
5 | 5 | * @deprecated EvolutionCMS\Legacy\ErrorHandler |
6 | 6 | * @todo could be unnecessary |
7 | 7 | */ |
8 | -class errorHandler extends EvolutionCMS\Legacy\ErrorHandler { |
|
8 | +class errorHandler extends EvolutionCMS\Legacy\ErrorHandler{ |
|
9 | 9 | public function include_lang($context = 'common') |
10 | 10 | { |
11 | 11 | parent::includeLang($context); |
@@ -5,7 +5,8 @@ |
||
5 | 5 | * @deprecated EvolutionCMS\Legacy\ErrorHandler |
6 | 6 | * @todo could be unnecessary |
7 | 7 | */ |
8 | -class errorHandler extends EvolutionCMS\Legacy\ErrorHandler { |
|
8 | +class errorHandler extends EvolutionCMS\Legacy\ErrorHandler |
|
9 | +{ |
|
9 | 10 | public function include_lang($context = 'common') |
10 | 11 | { |
11 | 12 | parent::includeLang($context); |
@@ -3,4 +3,6 @@ |
||
3 | 3 | /** |
4 | 4 | * @deprecated use EvolutionCMS\Legacy\LogHandler |
5 | 5 | */ |
6 | -class logHandler extends EvolutionCMS\Legacy\LogHandler{} |
|
6 | +class logHandler extends EvolutionCMS\Legacy\LogHandler |
|
7 | +{ |
|
8 | +} |