@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | 'sv' => 'svenska' |
| 38 | 38 | ); |
| 39 | 39 | $_langISO6391 = substr($_SERVER['HTTP_ACCEPT_LANGUAGE'], 0, 2); |
| 40 | -if (! empty($_langFiles[$_langISO6391])) { |
|
| 40 | +if (!empty($_langFiles[$_langISO6391])) { |
|
| 41 | 41 | $install_language = $_langFiles[$_langISO6391]; |
| 42 | 42 | } |
| 43 | 43 | |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | } |
| 52 | 52 | # load language file |
| 53 | 53 | require_once 'lang/english.inc.php'; // As fallback |
| 54 | -require_once 'lang/' . $install_language . '.inc.php'; |
|
| 54 | +require_once 'lang/'.$install_language.'.inc.php'; |
|
| 55 | 55 | |
| 56 | 56 | $manager_language = $install_language; |
| 57 | 57 | |
@@ -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 | { |
@@ -79,7 +79,8 @@ discard block |
||
| 79 | 79 | * @return string |
| 80 | 80 | */ |
| 81 | 81 | public function getParents($id, $path = '') |
| 82 | - { // modx:returns child's parent |
|
| 82 | + { |
|
| 83 | +// modx:returns child's parent |
|
| 83 | 84 | $modx = evolutionCMS(); |
| 84 | 85 | if (empty($this->aliases)) { |
| 85 | 86 | $f = "id, IF(alias='', id, alias) AS alias, parent, alias_visible"; |
@@ -456,7 +457,8 @@ discard block |
||
| 456 | 457 | $_ = trim($_); |
| 457 | 458 | } |
| 458 | 459 | $lastChar = substr($_, -1); |
| 459 | - if (!in_array($lastChar, $chars)) {// ,320,327,288,284,289 |
|
| 460 | + if (!in_array($lastChar, $chars)) { |
|
| 461 | +// ,320,327,288,284,289 |
|
| 460 | 462 | if (!in_array($prev_token, |
| 461 | 463 | array(T_FOREACH, T_WHILE, T_FOR, T_BOOLEAN_AND, T_BOOLEAN_OR, T_DOUBLE_ARROW))) { |
| 462 | 464 | $_ .= ' '; |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | if (isset($this->aliases[$id])) { |
| 98 | 98 | if ($this->aliasVisible[$id] == 1) { |
| 99 | 99 | if ($path != '') { |
| 100 | - $path = $this->aliases[$id] . '/' . $path; |
|
| 100 | + $path = $this->aliases[$id].'/'.$path; |
|
| 101 | 101 | } else { |
| 102 | 102 | $path = $this->aliases[$id]; |
| 103 | 103 | } |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | $modx->messageQuit("Cache path not set."); |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | - $files = glob(realpath($this->cachePath) . '/*.pageCache.php'); |
|
| 124 | + $files = glob(realpath($this->cachePath).'/*.pageCache.php'); |
|
| 125 | 125 | $filesincache = count($files); |
| 126 | 126 | $deletedfiles = array(); |
| 127 | 127 | while ($file = array_shift($files)) { |
@@ -156,9 +156,9 @@ discard block |
||
| 156 | 156 | if (isset($opcache)) { |
| 157 | 157 | echo '<p>Opcache empty.</p>'; |
| 158 | 158 | } |
| 159 | - echo '<p>' . $_lang['cache_files_deleted'] . '</p><ul>'; |
|
| 159 | + echo '<p>'.$_lang['cache_files_deleted'].'</p><ul>'; |
|
| 160 | 160 | foreach ($deletedfiles as $deletedfile) { |
| 161 | - echo '<li>' . $deletedfile . '</li>'; |
|
| 161 | + echo '<li>'.$deletedfile.'</li>'; |
|
| 162 | 162 | } |
| 163 | 163 | echo '</ul>'; |
| 164 | 164 | } |
@@ -177,11 +177,11 @@ discard block |
||
| 177 | 177 | |
| 178 | 178 | |
| 179 | 179 | // write the file |
| 180 | - $content = '<?php' . "\n"; |
|
| 181 | - $content .= '$recent_update=\'' . $this->request_time . '\';' . "\n"; |
|
| 182 | - $content .= '$cacheRefreshTime=\'' . $cacheRefreshTime . '\';' . "\n"; |
|
| 180 | + $content = '<?php'."\n"; |
|
| 181 | + $content .= '$recent_update=\''.$this->request_time.'\';'."\n"; |
|
| 182 | + $content .= '$cacheRefreshTime=\''.$cacheRefreshTime.'\';'."\n"; |
|
| 183 | 183 | |
| 184 | - $filename = $this->cachePath . '/sitePublishing.idx.php'; |
|
| 184 | + $filename = $this->cachePath.'/sitePublishing.idx.php'; |
|
| 185 | 185 | if (!$handle = fopen($filename, 'w')) { |
| 186 | 186 | exit("Cannot open file ({$filename}"); |
| 187 | 187 | } |
@@ -205,7 +205,7 @@ discard block |
||
| 205 | 205 | $timesArr = array(); |
| 206 | 206 | |
| 207 | 207 | $result = $modx->getDatabase()->select('MIN(pub_date) AS minpub', '[+prefix+]site_content', |
| 208 | - 'pub_date>' . $this->request_time); |
|
| 208 | + 'pub_date>'.$this->request_time); |
|
| 209 | 209 | if (!$result) { |
| 210 | 210 | echo "Couldn't determine next publish event!"; |
| 211 | 211 | } |
@@ -216,7 +216,7 @@ discard block |
||
| 216 | 216 | } |
| 217 | 217 | |
| 218 | 218 | $result = $modx->getDatabase()->select('MIN(unpub_date) AS minunpub', '[+prefix+]site_content', |
| 219 | - 'unpub_date>' . $this->request_time); |
|
| 219 | + 'unpub_date>'.$this->request_time); |
|
| 220 | 220 | if (!$result) { |
| 221 | 221 | echo "Couldn't determine next unpublish event!"; |
| 222 | 222 | } |
@@ -255,7 +255,7 @@ discard block |
||
| 255 | 255 | $config = array(); |
| 256 | 256 | $content .= '$c=&$this->config;'; |
| 257 | 257 | while (list($key, $value) = $modx->getDatabase()->getRow($rs, 'num')) { |
| 258 | - $content .= '$c[\'' . $key . '\']="' . $this->escapeDoubleQuotes($value) . '";'; |
|
| 258 | + $content .= '$c[\''.$key.'\']="'.$this->escapeDoubleQuotes($value).'";'; |
|
| 259 | 259 | $config[$key] = $value; |
| 260 | 260 | } |
| 261 | 261 | |
@@ -293,23 +293,23 @@ discard block |
||
| 293 | 293 | $docid = $doc['id']; |
| 294 | 294 | if ($use_alias_path) { |
| 295 | 295 | $tmpPath = $this->getParents($doc['parent']); |
| 296 | - $alias = (strlen($tmpPath) > 0 ? "$tmpPath/" : '') . $doc['alias']; |
|
| 296 | + $alias = (strlen($tmpPath) > 0 ? "$tmpPath/" : '').$doc['alias']; |
|
| 297 | 297 | $key = $alias; |
| 298 | 298 | } else { |
| 299 | 299 | $key = $doc['alias']; |
| 300 | 300 | } |
| 301 | 301 | |
| 302 | 302 | $doc['path'] = $tmpPath; |
| 303 | - $content .= '$a[' . $docid . ']=array(\'id\'=>' . $docid . ',\'alias\'=>\'' . $doc['alias'] . '\',\'path\'=>\'' . $doc['path'] . '\',\'parent\'=>' . $doc['parent'] . ',\'isfolder\'=>' . $doc['isfolder'] . ',\'alias_visible\'=>' . $doc['alias_visible'] . ');'; |
|
| 304 | - $content .= '$d[\'' . $key . '\']=' . $docid . ';'; |
|
| 305 | - $content .= '$m[]=array(' . $doc['parent'] . '=>' . $docid . ');'; |
|
| 303 | + $content .= '$a['.$docid.']=array(\'id\'=>'.$docid.',\'alias\'=>\''.$doc['alias'].'\',\'path\'=>\''.$doc['path'].'\',\'parent\'=>'.$doc['parent'].',\'isfolder\'=>'.$doc['isfolder'].',\'alias_visible\'=>'.$doc['alias_visible'].');'; |
|
| 304 | + $content .= '$d[\''.$key.'\']='.$docid.';'; |
|
| 305 | + $content .= '$m[]=array('.$doc['parent'].'=>'.$docid.');'; |
|
| 306 | 306 | } |
| 307 | 307 | |
| 308 | 308 | // get content types |
| 309 | 309 | $rs = $modx->getDatabase()->select('id, contentType', '[+prefix+]site_content', "contentType!='text/html'"); |
| 310 | 310 | $content .= '$c=&$this->contentTypes;'; |
| 311 | 311 | while ($doc = $modx->getDatabase()->getRow($rs)) { |
| 312 | - $content .= '$c[\'' . $doc['id'] . '\']=\'' . $doc['contentType'] . '\';'; |
|
| 312 | + $content .= '$c[\''.$doc['id'].'\']=\''.$doc['contentType'].'\';'; |
|
| 313 | 313 | } |
| 314 | 314 | |
| 315 | 315 | // WRITE Chunks to cache file |
@@ -319,7 +319,7 @@ discard block |
||
| 319 | 319 | if ($modx->config['minifyphp_incache']) { |
| 320 | 320 | $doc['snippet'] = $this->php_strip_whitespace($doc['snippet']); |
| 321 | 321 | } |
| 322 | - $content .= '$c[\'' . $doc['name'] . '\']=\'' . ($doc['disabled'] ? '' : $this->escapeSingleQuotes($doc['snippet'])) . '\';'; |
|
| 322 | + $content .= '$c[\''.$doc['name'].'\']=\''.($doc['disabled'] ? '' : $this->escapeSingleQuotes($doc['snippet'])).'\';'; |
|
| 323 | 323 | } |
| 324 | 324 | |
| 325 | 325 | // WRITE snippets to cache file |
@@ -330,18 +330,18 @@ discard block |
||
| 330 | 330 | while ($row = $modx->getDatabase()->getRow($rs)) { |
| 331 | 331 | $key = $row['name']; |
| 332 | 332 | if ($row['disabled']) { |
| 333 | - $content .= '$s[\'' . $key . '\']=\'return false;\';'; |
|
| 333 | + $content .= '$s[\''.$key.'\']=\'return false;\';'; |
|
| 334 | 334 | } else { |
| 335 | 335 | $value = trim($row['snippet']); |
| 336 | 336 | if ($modx->config['minifyphp_incache']) { |
| 337 | 337 | $value = $this->php_strip_whitespace($value); |
| 338 | 338 | } |
| 339 | - $content .= '$s[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';'; |
|
| 339 | + $content .= '$s[\''.$key.'\']=\''.$this->escapeSingleQuotes($value).'\';'; |
|
| 340 | 340 | $properties = $modx->parseProperties($row['properties']); |
| 341 | 341 | $sharedproperties = $modx->parseProperties($row['sharedproperties']); |
| 342 | 342 | $properties = array_merge($sharedproperties, $properties); |
| 343 | 343 | if (0 < count($properties)) { |
| 344 | - $content .= '$s[\'' . $key . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';'; |
|
| 344 | + $content .= '$s[\''.$key.'Props\']=\''.$this->escapeSingleQuotes(json_encode($properties)).'\';'; |
|
| 345 | 345 | } |
| 346 | 346 | } |
| 347 | 347 | } |
@@ -359,13 +359,13 @@ discard block |
||
| 359 | 359 | if ($modx->config['minifyphp_incache']) { |
| 360 | 360 | $value = $this->php_strip_whitespace($value); |
| 361 | 361 | } |
| 362 | - $content .= '$p[\'' . $key . '\']=\'' . $this->escapeSingleQuotes($value) . '\';'; |
|
| 362 | + $content .= '$p[\''.$key.'\']=\''.$this->escapeSingleQuotes($value).'\';'; |
|
| 363 | 363 | if ($row['properties'] != '' || $row['sharedproperties'] != '') { |
| 364 | 364 | $properties = $modx->parseProperties($row['properties']); |
| 365 | 365 | $sharedproperties = $modx->parseProperties($row['sharedproperties']); |
| 366 | 366 | $properties = array_merge($sharedproperties, $properties); |
| 367 | 367 | if (0 < count($properties)) { |
| 368 | - $content .= '$p[\'' . $key . 'Props\']=\'' . $this->escapeSingleQuotes(json_encode($properties)) . '\';'; |
|
| 368 | + $content .= '$p[\''.$key.'Props\']=\''.$this->escapeSingleQuotes(json_encode($properties)).'\';'; |
|
| 369 | 369 | } |
| 370 | 370 | } |
| 371 | 371 | } |
@@ -388,14 +388,14 @@ discard block |
||
| 388 | 388 | } |
| 389 | 389 | foreach ($events as $evtname => $pluginnames) { |
| 390 | 390 | $events[$evtname] = $pluginnames; |
| 391 | - $content .= '$e[\'' . $evtname . '\']=array(\'' . implode('\',\'', |
|
| 392 | - $this->escapeSingleQuotes($pluginnames)) . '\');'; |
|
| 391 | + $content .= '$e[\''.$evtname.'\']=array(\''.implode('\',\'', |
|
| 392 | + $this->escapeSingleQuotes($pluginnames)).'\');'; |
|
| 393 | 393 | } |
| 394 | 394 | |
| 395 | 395 | $content .= "\n"; |
| 396 | 396 | |
| 397 | 397 | // close and write the file |
| 398 | - $filename = $this->cachePath . 'siteCache.idx.php'; |
|
| 398 | + $filename = $this->cachePath.'siteCache.idx.php'; |
|
| 399 | 399 | |
| 400 | 400 | // invoke OnBeforeCacheUpdate event |
| 401 | 401 | if ($modx) { |
@@ -406,8 +406,8 @@ discard block |
||
| 406 | 406 | exit("Cannot write main MODX cache file! Make sure the assets/cache directory is writable!"); |
| 407 | 407 | } |
| 408 | 408 | |
| 409 | - if (!is_file($this->cachePath . '/.htaccess')) { |
|
| 410 | - file_put_contents($this->cachePath . '/.htaccess', "order deny,allow\ndeny from all\n"); |
|
| 409 | + if (!is_file($this->cachePath.'/.htaccess')) { |
|
| 410 | + file_put_contents($this->cachePath.'/.htaccess', "order deny,allow\ndeny from all\n"); |
|
| 411 | 411 | } |
| 412 | 412 | |
| 413 | 413 | // invoke OnCacheUpdate event |
@@ -429,7 +429,7 @@ discard block |
||
| 429 | 429 | |
| 430 | 430 | $source = trim($source); |
| 431 | 431 | if (substr($source, 0, 5) !== '<?php') { |
| 432 | - $source = '<?php ' . $source; |
|
| 432 | + $source = '<?php '.$source; |
|
| 433 | 433 | } |
| 434 | 434 | |
| 435 | 435 | $tokens = token_get_all($source); |
@@ -487,7 +487,7 @@ discard block |
||
| 487 | 487 | } |
| 488 | 488 | } |
| 489 | 489 | $source = preg_replace(array('@^<\?php@i', '|\s+|', '|<!--|', '|-->|', '|-->\s+<!--|'), |
| 490 | - array('', ' ', "\n" . '<!--', '-->' . "\n", '-->' . "\n" . '<!--'), $_); |
|
| 490 | + array('', ' ', "\n".'<!--', '-->'."\n", '-->'."\n".'<!--'), $_); |
|
| 491 | 491 | $source = trim($source); |
| 492 | 492 | |
| 493 | 493 | return $source; |
@@ -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); |