@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | // MySQL Dump Parser |
4 | 4 | // SNUFFKIN/ Alex 2004 |
5 | 5 | |
6 | -class SqlParser { |
|
6 | +class SqlParser{ |
|
7 | 7 | public $host; |
8 | 8 | public $dbname; |
9 | 9 | public $prefix; |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | public $ignoreDuplicateErrors; |
29 | 29 | public $autoTemplateLogic; |
30 | 30 | |
31 | - public function __construct($host, $user, $password, $db, $prefix='modx_', $adminname, $adminemail, $adminpass, $connection_charset= 'utf8', $managerlanguage='english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent') { |
|
31 | + public function __construct($host, $user, $password, $db, $prefix = 'modx_', $adminname, $adminemail, $adminpass, $connection_charset = 'utf8', $managerlanguage = 'english', $connection_method = 'SET CHARACTER SET', $auto_template_logic = 'parent'){ |
|
32 | 32 | $this->host = $host; |
33 | 33 | $this->dbname = $db; |
34 | 34 | $this->prefix = $prefix; |
@@ -44,28 +44,28 @@ discard block |
||
44 | 44 | $this->autoTemplateLogic = $auto_template_logic; |
45 | 45 | } |
46 | 46 | |
47 | - public function connect() { |
|
47 | + public function connect(){ |
|
48 | 48 | $this->conn = mysqli_connect($this->host, $this->user, $this->password); |
49 | 49 | mysqli_select_db($this->conn, $this->dbname); |
50 | 50 | if (function_exists('mysqli_set_charset')) mysqli_set_charset($this->conn, $this->connection_charset); |
51 | 51 | |
52 | 52 | $this->dbVersion = 3.23; // assume version 3.23 |
53 | - if(function_exists("mysqli_get_server_info")) { |
|
53 | + if (function_exists("mysqli_get_server_info")) { |
|
54 | 54 | $ver = mysqli_get_server_info($this->conn); |
55 | - $this->dbMODx = version_compare($ver,"4.0.2"); |
|
55 | + $this->dbMODx = version_compare($ver, "4.0.2"); |
|
56 | 56 | $this->dbVersion = (float) $ver; // Typecasting (float) instead of floatval() [PHP < 4.2] |
57 | 57 | } |
58 | 58 | |
59 | - mysqli_query($this->conn,"{$this->connection_method} {$this->connection_charset}"); |
|
59 | + mysqli_query($this->conn, "{$this->connection_method} {$this->connection_charset}"); |
|
60 | 60 | } |
61 | 61 | |
62 | - public function process($filename) { |
|
62 | + public function process($filename){ |
|
63 | 63 | global $custom_placeholders; |
64 | 64 | |
65 | 65 | // check to make sure file exists |
66 | 66 | if (!file_exists($filename)) { |
67 | 67 | $this->mysqlErrors[] = array("error" => "File '$filename' not found"); |
68 | - $this->installFailed = true ; |
|
68 | + $this->installFailed = true; |
|
69 | 69 | return false; |
70 | 70 | } |
71 | 71 | |
@@ -82,10 +82,10 @@ discard block |
||
82 | 82 | // check if in upgrade mode |
83 | 83 | if ($this->mode === 'upd') { |
84 | 84 | // remove non-upgradeable parts |
85 | - $s = strpos($idata,'non-upgrade-able[['); |
|
86 | - $e = strpos($idata,']]non-upgrade-able') + 17; |
|
87 | - if($s && $e) { |
|
88 | - $idata = str_replace(substr($idata, $s,$e-$s),' Removed non upgradeable items', $idata); |
|
85 | + $s = strpos($idata, 'non-upgrade-able[['); |
|
86 | + $e = strpos($idata, ']]non-upgrade-able') + 17; |
|
87 | + if ($s && $e) { |
|
88 | + $idata = str_replace(substr($idata, $s, $e - $s), ' Removed non upgradeable items', $idata); |
|
89 | 89 | } |
90 | 90 | } |
91 | 91 | |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | /*$idata = str_replace('{VERSION}', $modx_version, $idata);*/ |
103 | 103 | |
104 | 104 | // Replace custom placeholders |
105 | - foreach($custom_placeholders as $key=>$val) { |
|
105 | + foreach ($custom_placeholders as $key=>$val) { |
|
106 | 106 | if (strpos($idata, '{'.$key.'}') !== false) { |
107 | 107 | $idata = str_replace('{'.$key.'}', $val, $idata); |
108 | 108 | } |
@@ -111,14 +111,14 @@ discard block |
||
111 | 111 | $sql_array = explode("\n\n", $idata); |
112 | 112 | |
113 | 113 | $num = 0; |
114 | - foreach($sql_array as $sql_entry) { |
|
114 | + foreach ($sql_array as $sql_entry) { |
|
115 | 115 | $sql_do = trim($sql_entry, "\r\n; "); |
116 | 116 | |
117 | 117 | if (preg_match('/^\#/', $sql_do)) continue; |
118 | 118 | |
119 | 119 | // strip out comments and \n for mysql 3.x |
120 | - if ($this->dbVersion <4.0) { |
|
121 | - $sql_do = preg_replace("~COMMENT.*[^']?'.*[^']?'~","",$sql_do); |
|
120 | + if ($this->dbVersion < 4.0) { |
|
121 | + $sql_do = preg_replace("~COMMENT.*[^']?'.*[^']?'~", "", $sql_do); |
|
122 | 122 | $sql_do = str_replace('\r', "", $sql_do); |
123 | 123 | $sql_do = str_replace('\n', "", $sql_do); |
124 | 124 | } |
@@ -126,10 +126,10 @@ discard block |
||
126 | 126 | |
127 | 127 | $num = $num + 1; |
128 | 128 | if ($sql_do) mysqli_query($this->conn, $sql_do); |
129 | - if(mysqli_error($this->conn)) { |
|
129 | + if (mysqli_error($this->conn)) { |
|
130 | 130 | // Ignore duplicate and drop errors - Raymond |
131 | - if ($this->ignoreDuplicateErrors){ |
|
132 | - if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 ||mysqli_errno($this->conn) == 1091) continue; |
|
131 | + if ($this->ignoreDuplicateErrors) { |
|
132 | + if (mysqli_errno($this->conn) == 1060 || mysqli_errno($this->conn) == 1061 || mysqli_errno($this->conn) == 1062 || mysqli_errno($this->conn) == 1091) continue; |
|
133 | 133 | } |
134 | 134 | // End Ignore duplicate |
135 | 135 | $this->mysqlErrors[] = array("error" => mysqli_error($this->conn), "sql" => $sql_do); |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | } |
139 | 139 | } |
140 | 140 | |
141 | - public function close() { |
|
141 | + public function close(){ |
|
142 | 142 | mysqli_close($this->conn); |
143 | 143 | } |
144 | 144 | } |
@@ -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); |
@@ -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); |
@@ -71,11 +71,11 @@ |
||
71 | 71 | } |
72 | 72 | |
73 | 73 | if ($context === 'common') { |
74 | - $lang_path = MODX_MANAGER_PATH . 'includes/lang/'; |
|
74 | + $lang_path = MODX_MANAGER_PATH.'includes/lang/'; |
|
75 | 75 | } else { |
76 | - $lang_path = MODX_MANAGER_PATH . "includes/lang/{$context}/"; |
|
76 | + $lang_path = MODX_MANAGER_PATH."includes/lang/{$context}/"; |
|
77 | 77 | } |
78 | - include_once($lang_path . 'english.inc.php'); |
|
78 | + include_once($lang_path.'english.inc.php'); |
|
79 | 79 | $manager_language = $modx->config['manager_language']; |
80 | 80 | if (is_file("{$lang_path}{$manager_language}.inc.php")) { |
81 | 81 | include_once("{$lang_path}{$manager_language}.inc.php"); |
@@ -90,14 +90,14 @@ discard block |
||
90 | 90 | $countChild++; |
91 | 91 | $id = $value[0]; |
92 | 92 | $ph['id'] = $id; |
93 | - $ph['li_class'] = $this->getItemClass($id) . $value[10]; |
|
93 | + $ph['li_class'] = $this->getItemClass($id).$value[10]; |
|
94 | 94 | $ph['href'] = $value[3]; |
95 | 95 | $ph['alt'] = $value[4]; |
96 | 96 | $ph['target'] = $value[7]; |
97 | 97 | $ph['onclick'] = $value[5]; |
98 | 98 | $ph['a_class'] = $this->getLinkClass($id); |
99 | 99 | $ph['LinkAttr'] = $this->getLinkAttr($id); |
100 | - $ph['itemName'] = $value[2] . $this->getItemName($id); |
|
100 | + $ph['itemName'] = $value[2].$this->getItemName($id); |
|
101 | 101 | |
102 | 102 | $ph['DrawSub'] = ''; |
103 | 103 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | public function getLinkClass($id) |
146 | 146 | { |
147 | 147 | if (isset($this->menu[$id])) { |
148 | - return ' class="' . $this->defaults['parentLinkClass'] . '"'; |
|
148 | + return ' class="'.$this->defaults['parentLinkClass'].'"'; |
|
149 | 149 | } else { |
150 | 150 | return ''; |
151 | 151 | } |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | public function getItemClass($id) |
172 | 172 | { |
173 | 173 | if (isset($this->menu[$id])) { |
174 | - return $this->defaults['parentClass'] . ' '; |
|
174 | + return $this->defaults['parentClass'].' '; |
|
175 | 175 | } else { |
176 | 176 | return ''; |
177 | 177 | } |
@@ -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 |
@@ -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 | } |