@@ -37,7 +37,7 @@ discard block |
||
| 37 | 37 | /** |
| 38 | 38 | * @param string $string |
| 39 | 39 | * @param string $charset |
| 40 | - * @return mixed |
|
| 40 | + * @return string |
|
| 41 | 41 | */ |
| 42 | 42 | function entities($string, $charset = 'UTF-8') |
| 43 | 43 | { |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | if (! function_exists('get_by_key')) { |
| 49 | 49 | /** |
| 50 | 50 | * @param mixed $data |
| 51 | - * @param string|int $key |
|
| 51 | + * @param string $key |
|
| 52 | 52 | * @param mixed $default |
| 53 | 53 | * @param Closure $validate |
| 54 | 54 | * @return mixed |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if(!function_exists('createGUID')) { |
|
| 3 | +if (!function_exists('createGUID')) { |
|
| 4 | 4 | /** |
| 5 | 5 | * create globally unique identifiers (guid) |
| 6 | 6 | * |
@@ -8,22 +8,22 @@ discard block |
||
| 8 | 8 | */ |
| 9 | 9 | function createGUID() |
| 10 | 10 | { |
| 11 | - srand((double)microtime() * 1000000); |
|
| 11 | + srand((double) microtime() * 1000000); |
|
| 12 | 12 | $r = rand(); |
| 13 | - $u = uniqid(getmypid() . $r . (double)microtime() * 1000000, 1); |
|
| 13 | + $u = uniqid(getmypid().$r.(double) microtime() * 1000000, 1); |
|
| 14 | 14 | $m = md5($u); |
| 15 | 15 | |
| 16 | 16 | return $m; |
| 17 | 17 | } |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | -if(!function_exists('generate_password')) { |
|
| 20 | +if (!function_exists('generate_password')) { |
|
| 21 | 21 | // Generate password |
| 22 | 22 | function generate_password($length = 10) |
| 23 | 23 | { |
| 24 | 24 | $allowable_characters = "abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789"; |
| 25 | 25 | $ps_len = strlen($allowable_characters); |
| 26 | - mt_srand((double)microtime() * 1000000); |
|
| 26 | + mt_srand((double) microtime() * 1000000); |
|
| 27 | 27 | $pass = ""; |
| 28 | 28 | for ($i = 0; $i < $length; $i++) { |
| 29 | 29 | $pass .= $allowable_characters[mt_rand(0, $ps_len - 1)]; |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | -if (! function_exists('entities')) { |
|
| 36 | +if (!function_exists('entities')) { |
|
| 37 | 37 | /** |
| 38 | 38 | * @param string $string |
| 39 | 39 | * @param string $charset |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | } |
| 47 | 47 | |
| 48 | -if (! function_exists('get_by_key')) { |
|
| 48 | +if (!function_exists('get_by_key')) { |
|
| 49 | 49 | /** |
| 50 | 50 | * @param mixed $data |
| 51 | 51 | * @param string|int $key |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | if (is_array($data) && (is_int($key) || is_string($key)) && $key !== '' && array_key_exists($key, $data)) { |
| 60 | 60 | $out = $data[$key]; |
| 61 | 61 | } |
| 62 | - if (! empty($validate) && is_callable($validate)) { |
|
| 62 | + if (!empty($validate) && is_callable($validate)) { |
|
| 63 | 63 | $out = (($validate($out) === true) ? $out : $default); |
| 64 | 64 | } |
| 65 | 65 | return $out; |
@@ -212,7 +212,6 @@ discard block |
||
| 212 | 212 | |
| 213 | 213 | /** |
| 214 | 214 | * @param array $services |
| 215 | - * @param array $parameters |
|
| 216 | 215 | */ |
| 217 | 216 | public function __construct(array $services = array()) |
| 218 | 217 | { |
@@ -282,6 +281,9 @@ discard block |
||
| 282 | 281 | return $service; |
| 283 | 282 | } |
| 284 | 283 | |
| 284 | + /** |
|
| 285 | + * @param string $name |
|
| 286 | + */ |
|
| 285 | 287 | private function checkServiceAlias($name){ |
| 286 | 288 | foreach ($this->providerAliases as $alias => $interface) { |
| 287 | 289 | if($name === $interface) { |
@@ -319,7 +321,7 @@ discard block |
||
| 319 | 321 | * |
| 320 | 322 | * @param object $service The service. |
| 321 | 323 | * @param string $name The service name. |
| 322 | - * @param array $callDefinitions The service calls definition. |
|
| 324 | + * @param boolean $callDefinitions The service calls definition. |
|
| 323 | 325 | * |
| 324 | 326 | * @throws Exceptions\ContainerException On failure. |
| 325 | 327 | */ |
@@ -561,7 +563,7 @@ discard block |
||
| 561 | 563 | * @param int $count_attempts |
| 562 | 564 | * @param string $type $type |
| 563 | 565 | * @param string $responseCode |
| 564 | - * @return bool|null |
|
| 566 | + * @return false|null |
|
| 565 | 567 | * @global string $base_url |
| 566 | 568 | * @global string $site_url |
| 567 | 569 | */ |
@@ -1262,7 +1264,7 @@ discard block |
||
| 1262 | 1264 | } |
| 1263 | 1265 | |
| 1264 | 1266 | /** |
| 1265 | - * @param $contents |
|
| 1267 | + * @param string $contents |
|
| 1266 | 1268 | * @return mixed |
| 1267 | 1269 | */ |
| 1268 | 1270 | public function RecoveryEscapedTags($contents) |
@@ -1286,7 +1288,7 @@ discard block |
||
| 1286 | 1288 | } |
| 1287 | 1289 | |
| 1288 | 1290 | /** |
| 1289 | - * @param $tstart |
|
| 1291 | + * @param double $tstart |
|
| 1290 | 1292 | * @return array |
| 1291 | 1293 | */ |
| 1292 | 1294 | public function getTimerStats($tstart) |
@@ -2052,7 +2054,7 @@ discard block |
||
| 2052 | 2054 | |
| 2053 | 2055 | /** |
| 2054 | 2056 | * Remove Comment-Tags from output like <!--@- Comment -@--> |
| 2055 | - * @param $content |
|
| 2057 | + * @param string $content |
|
| 2056 | 2058 | * @param string $left |
| 2057 | 2059 | * @param string $right |
| 2058 | 2060 | * @return mixed |
@@ -2228,7 +2230,7 @@ discard block |
||
| 2228 | 2230 | /** |
| 2229 | 2231 | * Run snippets as per the tags in $documentSource and replace the tags with the returned values. |
| 2230 | 2232 | * |
| 2231 | - * @param $content |
|
| 2233 | + * @param string $content |
|
| 2232 | 2234 | * @return string |
| 2233 | 2235 | * @internal param string $documentSource |
| 2234 | 2236 | */ |
@@ -3263,7 +3265,7 @@ discard block |
||
| 3263 | 3265 | |
| 3264 | 3266 | /** |
| 3265 | 3267 | * @param $templateID |
| 3266 | - * @return mixed |
|
| 3268 | + * @return string |
|
| 3267 | 3269 | */ |
| 3268 | 3270 | public function _getTemplateCodeFromDB($templateID) |
| 3269 | 3271 | { |
@@ -3306,7 +3308,7 @@ discard block |
||
| 3306 | 3308 | /** |
| 3307 | 3309 | * @param $id |
| 3308 | 3310 | * @param int $top |
| 3309 | - * @return mixed |
|
| 3311 | + * @return string |
|
| 3310 | 3312 | */ |
| 3311 | 3313 | public function getUltimateParentId($id, $top = 0) |
| 3312 | 3314 | { |
@@ -3646,7 +3648,7 @@ discard block |
||
| 3646 | 3648 | * |
| 3647 | 3649 | * @param int $type Types: 1=template, 2=tv, 3=chunk, 4=snippet, 5=plugin, 6=module, 7=resource, 8=role |
| 3648 | 3650 | * @param int $id Element- / Resource-id |
| 3649 | - * @return bool |
|
| 3651 | + * @return false|null |
|
| 3650 | 3652 | */ |
| 3651 | 3653 | public function lockElement($type, $id) |
| 3652 | 3654 | { |
@@ -3668,7 +3670,7 @@ discard block |
||
| 3668 | 3670 | * @param int $type Types: 1=template, 2=tv, 3=chunk, 4=snippet, 5=plugin, 6=module, 7=resource, 8=role |
| 3669 | 3671 | * @param int $id Element- / Resource-id |
| 3670 | 3672 | * @param bool $includeAllUsers true = Deletes not only own user-locks |
| 3671 | - * @return bool |
|
| 3673 | + * @return false|null |
|
| 3672 | 3674 | */ |
| 3673 | 3675 | public function unlockElement($type, $id, $includeAllUsers = false) |
| 3674 | 3676 | { |
@@ -4181,7 +4183,7 @@ discard block |
||
| 4181 | 4183 | * Default: 1 |
| 4182 | 4184 | * @param string $fields List of fields |
| 4183 | 4185 | * Default: id, pagetitle, description, alias |
| 4184 | - * @return boolean|array |
|
| 4186 | + * @return string |
|
| 4185 | 4187 | */ |
| 4186 | 4188 | public function getPageInfo($pageid = -1, $active = 1, $fields = 'id, pagetitle, description, alias') |
| 4187 | 4189 | { |
@@ -4273,7 +4275,7 @@ discard block |
||
| 4273 | 4275 | * |
| 4274 | 4276 | * @param string $type |
| 4275 | 4277 | * @param bool $report |
| 4276 | - * @return bool |
|
| 4278 | + * @return boolean|null |
|
| 4277 | 4279 | */ |
| 4278 | 4280 | public function clearCache($type = '', $report = false) |
| 4279 | 4281 | { |
@@ -4463,7 +4465,7 @@ discard block |
||
| 4463 | 4465 | * Note: most code accesses the config array directly and we will continue to support this. |
| 4464 | 4466 | * |
| 4465 | 4467 | * @param string $name |
| 4466 | - * @param mixed $default |
|
| 4468 | + * @param string $default |
|
| 4467 | 4469 | * @return bool|string |
| 4468 | 4470 | */ |
| 4469 | 4471 | public function getConfig($name = '', $default = null) |
@@ -4636,7 +4638,7 @@ discard block |
||
| 4636 | 4638 | * - Placeholders prefix. Default: '{'. |
| 4637 | 4639 | * @param string $suffix {string} |
| 4638 | 4640 | * - Placeholders suffix. Default: '}'. |
| 4639 | - * @return bool|mixed|string {string; false} - Parsed chunk or false if $chunkArr is not array. |
|
| 4641 | + * @return false|string {string; false} - Parsed chunk or false if $chunkArr is not array. |
|
| 4640 | 4642 | * - Parsed chunk or false if $chunkArr is not array. |
| 4641 | 4643 | */ |
| 4642 | 4644 | public function parseChunk($chunkName, $chunkArr, $prefix = '{', $suffix = '}') |
@@ -5608,7 +5610,7 @@ discard block |
||
| 5608 | 5610 | * Remove event listener - only for use within the current execution cycle |
| 5609 | 5611 | * |
| 5610 | 5612 | * @param string $evtName |
| 5611 | - * @return boolean |
|
| 5613 | + * @return false|null |
|
| 5612 | 5614 | */ |
| 5613 | 5615 | public function removeEventListener($evtName) |
| 5614 | 5616 | { |
@@ -5632,7 +5634,7 @@ discard block |
||
| 5632 | 5634 | * |
| 5633 | 5635 | * @param string $evtName |
| 5634 | 5636 | * @param array $extParams Parameters available to plugins. Each array key will be the PHP variable name, and the array value will be the variable value. |
| 5635 | - * @return boolean|array |
|
| 5637 | + * @return false|null |
|
| 5636 | 5638 | */ |
| 5637 | 5639 | public function invokeEvent($evtName, $extParams = array()) |
| 5638 | 5640 | { |
@@ -6277,7 +6279,7 @@ discard block |
||
| 6277 | 6279 | |
| 6278 | 6280 | /** |
| 6279 | 6281 | * @param string $str |
| 6280 | - * @return bool|mixed|string |
|
| 6282 | + * @return string |
|
| 6281 | 6283 | */ |
| 6282 | 6284 | public function atBindFileContent($str = '') |
| 6283 | 6285 | { |
@@ -6328,8 +6330,8 @@ discard block |
||
| 6328 | 6330 | } |
| 6329 | 6331 | |
| 6330 | 6332 | /** |
| 6331 | - * @param $str |
|
| 6332 | - * @return bool|string |
|
| 6333 | + * @param string $str |
|
| 6334 | + * @return false|string |
|
| 6333 | 6335 | */ |
| 6334 | 6336 | public function getExtFromFilename($str) |
| 6335 | 6337 | { |
@@ -6357,7 +6359,7 @@ discard block |
||
| 6357 | 6359 | * @param string $text Error message |
| 6358 | 6360 | * @param string $file File where the error was detected |
| 6359 | 6361 | * @param string $line Line number within $file |
| 6360 | - * @return boolean |
|
| 6362 | + * @return boolean|null |
|
| 6361 | 6363 | */ |
| 6362 | 6364 | public function phpError($nr, $text, $file, $line) |
| 6363 | 6365 | { |
@@ -6409,7 +6411,7 @@ discard block |
||
| 6409 | 6411 | * @param string $text |
| 6410 | 6412 | * @param string $line |
| 6411 | 6413 | * @param string $output |
| 6412 | - * @return bool |
|
| 6414 | + * @return null|boolean |
|
| 6413 | 6415 | */ |
| 6414 | 6416 | public function messageQuit($msg = 'unspecified error', $query = '', $is_error = true, $nr = '', $file = '', $source = '', $text = '', $line = '', $output = '') |
| 6415 | 6417 | { |
@@ -6824,7 +6826,7 @@ discard block |
||
| 6824 | 6826 | |
| 6825 | 6827 | /** |
| 6826 | 6828 | * @param string $str |
| 6827 | - * @return bool|mixed|string |
|
| 6829 | + * @return string |
|
| 6828 | 6830 | */ |
| 6829 | 6831 | public function atBindInclude($str = '') |
| 6830 | 6832 | { |
@@ -6875,7 +6877,7 @@ discard block |
||
| 6875 | 6877 | * @param $str |
| 6876 | 6878 | * @param int $flags |
| 6877 | 6879 | * @param string $encode |
| 6878 | - * @return mixed |
|
| 6880 | + * @return null|string |
|
| 6879 | 6881 | */ |
| 6880 | 6882 | public function htmlspecialchars($str, $flags = ENT_COMPAT, $encode = '') |
| 6881 | 6883 | { |
@@ -6883,7 +6885,7 @@ discard block |
||
| 6883 | 6885 | } |
| 6884 | 6886 | |
| 6885 | 6887 | /** |
| 6886 | - * @param $string |
|
| 6888 | + * @param string $string |
|
| 6887 | 6889 | * @param bool $returnData |
| 6888 | 6890 | * @return bool|mixed |
| 6889 | 6891 | */ |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | $pre = null, |
| 34 | 34 | $charset = '', |
| 35 | 35 | $connection_method = 'SET CHARACTER SET' |
| 36 | - ) { |
|
| 36 | + ){ |
|
| 37 | 37 | $this->config['host'] = $host ? $host : $GLOBALS['database_server']; |
| 38 | 38 | $this->config['dbase'] = $dbase ? $dbase : $GLOBALS['dbase']; |
| 39 | 39 | $this->config['user'] = $uid ? $uid : $GLOBALS['database_user']; |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | $ua = $modx->getPhpCompat()->htmlspecialchars($_SERVER['HTTP_USER_AGENT']); |
| 74 | 74 | $referer = $modx->getPhpCompat()->htmlspecialchars($_SERVER['HTTP_REFERER']); |
| 75 | 75 | $modx->sendmail(array( |
| 76 | - 'subject' => 'Missing to create the database connection! from ' . $modx->getPhpCompat()->entities($modx->config['site_name']), |
|
| 76 | + 'subject' => 'Missing to create the database connection! from '.$modx->getPhpCompat()->entities($modx->config['site_name']), |
|
| 77 | 77 | 'body' => "{$logtitle}\n{$request_uri}\n{$ua}\n{$referer}", |
| 78 | 78 | 'type' => 'text' |
| 79 | 79 | )); |
@@ -88,8 +88,8 @@ discard block |
||
| 88 | 88 | $tend = $modx->getMicroTime(); |
| 89 | 89 | $totaltime = $tend - $tstart; |
| 90 | 90 | if ($modx->dumpSQL) { |
| 91 | - $modx->queryCode .= "<fieldset style='text-align:left'><legend>Database connection</legend>" . sprintf("Database connection was created in %2.4f s", |
|
| 92 | - $totaltime) . "</fieldset><br />"; |
|
| 91 | + $modx->queryCode .= "<fieldset style='text-align:left'><legend>Database connection</legend>".sprintf("Database connection was created in %2.4f s", |
|
| 92 | + $totaltime)."</fieldset><br />"; |
|
| 93 | 93 | } |
| 94 | 94 | $this->conn->set_charset($this->config['charset']); |
| 95 | 95 | $this->isConnected = true; |
@@ -122,7 +122,7 @@ discard block |
||
| 122 | 122 | if (1000 < $safeCount) { |
| 123 | 123 | exit("Too many loops '{$safeCount}'"); |
| 124 | 124 | } |
| 125 | - if ( ! ($this->conn instanceof mysqli)) { |
|
| 125 | + if (!($this->conn instanceof mysqli)) { |
|
| 126 | 126 | $this->connect(); |
| 127 | 127 | } |
| 128 | 128 | if (is_array($s)) { |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | public function query($sql, $watchError = true) |
| 149 | 149 | { |
| 150 | 150 | $modx = evolutionCMS(); |
| 151 | - if ( ! ($this->conn instanceof mysqli)) { |
|
| 151 | + if (!($this->conn instanceof mysqli)) { |
|
| 152 | 152 | $this->connect(); |
| 153 | 153 | } |
| 154 | 154 | $tStart = $modx->getMicroTime(); |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | case 1091: |
| 169 | 169 | break; |
| 170 | 170 | default: |
| 171 | - $modx->messageQuit('Execution of a query to the database failed - ' . $this->getLastError(), $sql); |
|
| 171 | + $modx->messageQuit('Execution of a query to the database failed - '.$this->getLastError(), $sql); |
|
| 172 | 172 | } |
| 173 | 173 | } else { |
| 174 | 174 | $tend = $modx->getMicroTime(); |
@@ -182,24 +182,24 @@ discard block |
||
| 182 | 182 | $debug_path[] = $line['function']; |
| 183 | 183 | } |
| 184 | 184 | $debug_path = implode(' > ', array_reverse($debug_path)); |
| 185 | - $modx->queryCode .= "<fieldset style='text-align:left'><legend>Query " . ($modx->executedQueries + 1) . " - " . sprintf("%2.2f ms", |
|
| 186 | - $totalTime * 1000) . "</legend>"; |
|
| 187 | - $modx->queryCode .= $sql . '<br><br>'; |
|
| 185 | + $modx->queryCode .= "<fieldset style='text-align:left'><legend>Query ".($modx->executedQueries + 1)." - ".sprintf("%2.2f ms", |
|
| 186 | + $totalTime * 1000)."</legend>"; |
|
| 187 | + $modx->queryCode .= $sql.'<br><br>'; |
|
| 188 | 188 | if ($modx->event->name) { |
| 189 | - $modx->queryCode .= 'Current Event => ' . $modx->event->name . '<br>'; |
|
| 189 | + $modx->queryCode .= 'Current Event => '.$modx->event->name.'<br>'; |
|
| 190 | 190 | } |
| 191 | 191 | if ($modx->event->activePlugin) { |
| 192 | - $modx->queryCode .= 'Current Plugin => ' . $modx->event->activePlugin . '<br>'; |
|
| 192 | + $modx->queryCode .= 'Current Plugin => '.$modx->event->activePlugin.'<br>'; |
|
| 193 | 193 | } |
| 194 | 194 | if ($modx->currentSnippet) { |
| 195 | - $modx->queryCode .= 'Current Snippet => ' . $modx->currentSnippet . '<br>'; |
|
| 195 | + $modx->queryCode .= 'Current Snippet => '.$modx->currentSnippet.'<br>'; |
|
| 196 | 196 | } |
| 197 | 197 | if (stripos($sql, 'select') === 0) { |
| 198 | - $modx->queryCode .= 'Record Count => ' . $this->getRecordCount($result) . '<br>'; |
|
| 198 | + $modx->queryCode .= 'Record Count => '.$this->getRecordCount($result).'<br>'; |
|
| 199 | 199 | } else { |
| 200 | - $modx->queryCode .= 'Affected Rows => ' . $this->getAffectedRows() . '<br>'; |
|
| 200 | + $modx->queryCode .= 'Affected Rows => '.$this->getAffectedRows().'<br>'; |
|
| 201 | 201 | } |
| 202 | - $modx->queryCode .= 'Functions Path => ' . $debug_path . '<br>'; |
|
| 202 | + $modx->queryCode .= 'Functions Path => '.$debug_path.'<br>'; |
|
| 203 | 203 | $modx->queryCode .= "</fieldset><br />"; |
| 204 | 204 | } |
| 205 | 205 | $modx->executedQueries++; |
@@ -306,9 +306,9 @@ discard block |
||
| 306 | 306 | if ($value === null || strtolower($value) === 'null') { |
| 307 | 307 | $f = 'NULL'; |
| 308 | 308 | } else { |
| 309 | - $f = "'" . $value . "'"; |
|
| 309 | + $f = "'".$value."'"; |
|
| 310 | 310 | } |
| 311 | - $fields[$key] = "`{$key}` = " . $f; |
|
| 311 | + $fields[$key] = "`{$key}` = ".$f; |
|
| 312 | 312 | } |
| 313 | 313 | $fields = implode(',', $fields); |
| 314 | 314 | } |
@@ -343,12 +343,12 @@ discard block |
||
| 343 | 343 | $this->query("INSERT INTO {$intotable} {$fields}"); |
| 344 | 344 | } else { |
| 345 | 345 | if (empty($fromtable)) { |
| 346 | - $fields = "(`" . implode("`, `", array_keys($fields)) . "`) VALUES('" . implode("', '", |
|
| 347 | - array_values($fields)) . "')"; |
|
| 346 | + $fields = "(`".implode("`, `", array_keys($fields))."`) VALUES('".implode("', '", |
|
| 347 | + array_values($fields))."')"; |
|
| 348 | 348 | $this->query("INSERT INTO {$intotable} {$fields}"); |
| 349 | 349 | } else { |
| 350 | 350 | $fromtable = $this->replaceFullTableName($fromtable); |
| 351 | - $fields = "(" . implode(",", array_keys($fields)) . ")"; |
|
| 351 | + $fields = "(".implode(",", array_keys($fields)).")"; |
|
| 352 | 352 | $where = trim($where); |
| 353 | 353 | $limit = trim($limit); |
| 354 | 354 | if ($where !== '' && stripos($where, 'WHERE') !== 0) { |
@@ -442,8 +442,8 @@ discard block |
||
| 442 | 442 | */ |
| 443 | 443 | public function getInsertId($conn = null) |
| 444 | 444 | { |
| 445 | - if (! ($conn instanceof mysqli)) { |
|
| 446 | - $conn =& $this->conn; |
|
| 445 | + if (!($conn instanceof mysqli)) { |
|
| 446 | + $conn = & $this->conn; |
|
| 447 | 447 | } |
| 448 | 448 | |
| 449 | 449 | return $conn->insert_id; |
@@ -455,8 +455,8 @@ discard block |
||
| 455 | 455 | */ |
| 456 | 456 | public function getAffectedRows($conn = null) |
| 457 | 457 | { |
| 458 | - if (! ($conn instanceof mysqli)) { |
|
| 459 | - $conn =& $this->conn; |
|
| 458 | + if (!($conn instanceof mysqli)) { |
|
| 459 | + $conn = & $this->conn; |
|
| 460 | 460 | } |
| 461 | 461 | |
| 462 | 462 | return $conn->affected_rows; |
@@ -468,8 +468,8 @@ discard block |
||
| 468 | 468 | */ |
| 469 | 469 | public function getLastError($conn = null) |
| 470 | 470 | { |
| 471 | - if (! ($conn instanceof mysqli)) { |
|
| 472 | - $conn =& $this->conn; |
|
| 471 | + if (!($conn instanceof mysqli)) { |
|
| 472 | + $conn = & $this->conn; |
|
| 473 | 473 | } |
| 474 | 474 | |
| 475 | 475 | return $conn->error; |
@@ -493,7 +493,7 @@ discard block |
||
| 493 | 493 | { |
| 494 | 494 | $out = false; |
| 495 | 495 | if ($ds instanceof mysqli_result) { |
| 496 | - switch($mode){ |
|
| 496 | + switch ($mode) { |
|
| 497 | 497 | case 'assoc': |
| 498 | 498 | $out = $ds->fetch_assoc(); |
| 499 | 499 | break; |
@@ -523,7 +523,7 @@ discard block |
||
| 523 | 523 | public function getColumn($name, $dsq) |
| 524 | 524 | { |
| 525 | 525 | $col = array(); |
| 526 | - if ( ! ($dsq instanceof mysqli_result)) { |
|
| 526 | + if (!($dsq instanceof mysqli_result)) { |
|
| 527 | 527 | $dsq = $this->query($dsq); |
| 528 | 528 | } |
| 529 | 529 | if ($dsq) { |
@@ -542,7 +542,7 @@ discard block |
||
| 542 | 542 | public function getColumnNames($dsq) |
| 543 | 543 | { |
| 544 | 544 | $names = array(); |
| 545 | - if ( ! ($dsq instanceof mysqli_result)) { |
|
| 545 | + if (!($dsq instanceof mysqli_result)) { |
|
| 546 | 546 | $dsq = $this->query($dsq); |
| 547 | 547 | } |
| 548 | 548 | if ($dsq) { |
@@ -562,7 +562,7 @@ discard block |
||
| 562 | 562 | public function getValue($dsq) |
| 563 | 563 | { |
| 564 | 564 | $out = false; |
| 565 | - if ( ! ($dsq instanceof mysqli_result)) { |
|
| 565 | + if (!($dsq instanceof mysqli_result)) { |
|
| 566 | 566 | $dsq = $this->query($dsq); |
| 567 | 567 | } |
| 568 | 568 | if ($dsq) { |
@@ -660,7 +660,7 @@ discard block |
||
| 660 | 660 | $tableName = trim($tableName); |
| 661 | 661 | $dbase = trim($this->config['dbase'], '`'); |
| 662 | 662 | $prefix = $this->config['table_prefix']; |
| 663 | - if ((bool)$force === true) { |
|
| 663 | + if ((bool) $force === true) { |
|
| 664 | 664 | $result = "`{$dbase}`.`{$prefix}{$tableName}`"; |
| 665 | 665 | } elseif (strpos($tableName, '[+prefix+]') !== false) { |
| 666 | 666 | $result = preg_replace('@\[\+prefix\+\]([0-9a-zA-Z_]+)@', "`{$dbase}`.`{$prefix}$1`", $tableName); |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | |
| 74 | 74 | // Set line feed |
| 75 | 75 | $lf = "\n"; |
| 76 | - $tempfile_path = $modx->config['base_path'] . 'assets/backup/temp.php'; |
|
| 76 | + $tempfile_path = $modx->config['base_path'].'assets/backup/temp.php'; |
|
| 77 | 77 | |
| 78 | 78 | $result = $modx->getDatabase()->query('SHOW TABLES'); |
| 79 | 79 | $tables = $this->result2Array(0, $result); |
@@ -86,15 +86,15 @@ discard block |
||
| 86 | 86 | |
| 87 | 87 | // Set header |
| 88 | 88 | $output = "#{$lf}"; |
| 89 | - $output .= "# " . addslashes($modx->getPhpCompat()->entities($modx->config['site_name'])) . " Database Dump{$lf}"; |
|
| 89 | + $output .= "# ".addslashes($modx->getPhpCompat()->entities($modx->config['site_name']))." Database Dump{$lf}"; |
|
| 90 | 90 | $output .= "# MODX Version:{$version['version']}{$lf}"; |
| 91 | 91 | $output .= "# {$lf}"; |
| 92 | 92 | $output .= "# Host: {$this->database_server}{$lf}"; |
| 93 | - $output .= "# Generation Time: " . $modx->toDateFormat(time()) . $lf; |
|
| 94 | - $output .= "# Server version: " . $modx->getDatabase()->getVersion() . $lf; |
|
| 95 | - $output .= "# PHP Version: " . phpversion() . $lf; |
|
| 93 | + $output .= "# Generation Time: ".$modx->toDateFormat(time()).$lf; |
|
| 94 | + $output .= "# Server version: ".$modx->getDatabase()->getVersion().$lf; |
|
| 95 | + $output .= "# PHP Version: ".phpversion().$lf; |
|
| 96 | 96 | $output .= "# Database: `{$this->dbname}`{$lf}"; |
| 97 | - $output .= "# Description: " . trim($_REQUEST['backup_title']) . "{$lf}"; |
|
| 97 | + $output .= "# Description: ".trim($_REQUEST['backup_title'])."{$lf}"; |
|
| 98 | 98 | $output .= "#"; |
| 99 | 99 | file_put_contents($tempfile_path, $output, FILE_APPEND | LOCK_EX); |
| 100 | 100 | $output = ''; |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | } |
| 114 | 114 | } |
| 115 | 115 | if ($callBack === 'snapshot') { |
| 116 | - if (!preg_match('@^' . $modx->getDatabase()->config['table_prefix'] . '@', $tblval)) { |
|
| 116 | + if (!preg_match('@^'.$modx->getDatabase()->config['table_prefix'].'@', $tblval)) { |
|
| 117 | 117 | continue; |
| 118 | 118 | } |
| 119 | 119 | } |
@@ -150,9 +150,9 @@ discard block |
||
| 150 | 150 | ), '\\n', $value); |
| 151 | 151 | $value = "'{$value}'"; |
| 152 | 152 | } |
| 153 | - $insertdump .= $value . ','; |
|
| 153 | + $insertdump .= $value.','; |
|
| 154 | 154 | } |
| 155 | - $output .= rtrim($insertdump, ',') . ");\n"; |
|
| 155 | + $output .= rtrim($insertdump, ',').");\n"; |
|
| 156 | 156 | if (1048576 < strlen($output)) { |
| 157 | 157 | file_put_contents($tempfile_path, $output, FILE_APPEND | LOCK_EX); |
| 158 | 158 | $output = ''; |
@@ -1,75 +1,75 @@ |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -if($modx->getManagerApi()->action!='8' && isset($_SESSION['mgrValidated'])){ |
|
| 6 | +if ($modx->getManagerApi()->action != '8' && isset($_SESSION['mgrValidated'])) { |
|
| 7 | 7 | |
| 8 | - $homeurl = $modx->makeUrl($manager_login_startup>0 ? $manager_login_startup:$site_start); |
|
| 8 | + $homeurl = $modx->makeUrl($manager_login_startup > 0 ? $manager_login_startup : $site_start); |
|
| 9 | 9 | $logouturl = MODX_MANAGER_URL.'index.php?a=8'; |
| 10 | 10 | |
| 11 | - $modx->setPlaceholder('modx_charset',$modx_manager_charset); |
|
| 12 | - $modx->setPlaceholder('theme',$manager_theme); |
|
| 11 | + $modx->setPlaceholder('modx_charset', $modx_manager_charset); |
|
| 12 | + $modx->setPlaceholder('theme', $manager_theme); |
|
| 13 | 13 | |
| 14 | - $modx->setPlaceholder('site_name',$modx->getPhpCompat()->entities($site_name)); |
|
| 15 | - $modx->setPlaceholder('logo_slogan',$_lang["logo_slogan"]); |
|
| 16 | - $modx->setPlaceholder('manager_lockout_message',$_lang["manager_lockout_message"]); |
|
| 14 | + $modx->setPlaceholder('site_name', $modx->getPhpCompat()->entities($site_name)); |
|
| 15 | + $modx->setPlaceholder('logo_slogan', $_lang["logo_slogan"]); |
|
| 16 | + $modx->setPlaceholder('manager_lockout_message', $_lang["manager_lockout_message"]); |
|
| 17 | 17 | |
| 18 | - $modx->setPlaceholder('home',$_lang["home"]); |
|
| 19 | - $modx->setPlaceholder('homeurl',$homeurl); |
|
| 20 | - $modx->setPlaceholder('logout',$_lang["logout"]); |
|
| 21 | - $modx->setPlaceholder('logouturl',$logouturl); |
|
| 22 | - $modx->setPlaceholder('manager_theme_url',MODX_MANAGER_URL . 'media/style/' . $modx->config['manager_theme'] . '/'); |
|
| 23 | - $modx->setPlaceholder('year',date('Y')); |
|
| 18 | + $modx->setPlaceholder('home', $_lang["home"]); |
|
| 19 | + $modx->setPlaceholder('homeurl', $homeurl); |
|
| 20 | + $modx->setPlaceholder('logout', $_lang["logout"]); |
|
| 21 | + $modx->setPlaceholder('logouturl', $logouturl); |
|
| 22 | + $modx->setPlaceholder('manager_theme_url', MODX_MANAGER_URL.'media/style/'.$modx->config['manager_theme'].'/'); |
|
| 23 | + $modx->setPlaceholder('year', date('Y')); |
|
| 24 | 24 | |
| 25 | 25 | // load template |
| 26 | - if(!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { |
|
| 27 | - $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; |
|
| 26 | + if (!isset($modx->config['manager_lockout_tpl']) || empty($modx->config['manager_lockout_tpl'])) { |
|
| 27 | + $modx->config['manager_lockout_tpl'] = MODX_MANAGER_PATH.'media/style/common/manager.lockout.tpl'; |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | $target = $modx->config['manager_lockout_tpl']; |
| 31 | 31 | $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); |
| 32 | 32 | $target = $modx->mergeSettingsContent($target); |
| 33 | 33 | |
| 34 | - if(substr($target,0,1)==='@') { |
|
| 35 | - if(substr($target,0,6)==='@CHUNK') { |
|
| 36 | - $target = trim(substr($target,7)); |
|
| 34 | + if (substr($target, 0, 1) === '@') { |
|
| 35 | + if (substr($target, 0, 6) === '@CHUNK') { |
|
| 36 | + $target = trim(substr($target, 7)); |
|
| 37 | 37 | $lockout_tpl = $modx->getChunk($target); |
| 38 | 38 | } |
| 39 | - elseif(substr($target,0,5)==='@FILE') { |
|
| 40 | - $target = trim(substr($target,6)); |
|
| 39 | + elseif (substr($target, 0, 5) === '@FILE') { |
|
| 40 | + $target = trim(substr($target, 6)); |
|
| 41 | 41 | $lockout_tpl = file_get_contents($target); |
| 42 | 42 | } |
| 43 | 43 | } else { |
| 44 | 44 | $chunk = $modx->getChunk($target); |
| 45 | - if($chunk!==false && !empty($chunk)) { |
|
| 45 | + if ($chunk !== false && !empty($chunk)) { |
|
| 46 | 46 | $lockout_tpl = $chunk; |
| 47 | 47 | } |
| 48 | - elseif(is_file(MODX_BASE_PATH . $target)) { |
|
| 49 | - $target = MODX_BASE_PATH . $target; |
|
| 48 | + elseif (is_file(MODX_BASE_PATH.$target)) { |
|
| 49 | + $target = MODX_BASE_PATH.$target; |
|
| 50 | 50 | $lockout_tpl = file_get_contents($target); |
| 51 | 51 | } |
| 52 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl')) { |
|
| 53 | - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/manager.lockout.tpl'; |
|
| 52 | + elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/manager.lockout.tpl')) { |
|
| 53 | + $target = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/manager.lockout.tpl'; |
|
| 54 | 54 | $lockout_tpl = file_get_contents($target); |
| 55 | 55 | } |
| 56 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl')) { |
|
| 57 | - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/templates/actions/manager.lockout.tpl'; |
|
| 56 | + elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/templates/actions/manager.lockout.tpl')) { |
|
| 57 | + $target = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/templates/actions/manager.lockout.tpl'; |
|
| 58 | 58 | $login_tpl = file_get_contents($target); |
| 59 | 59 | } |
| 60 | - elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html')) { // ClipperCMS compatible |
|
| 61 | - $target = MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/manager.lockout.html'; |
|
| 60 | + elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/manager.lockout.html')) { // ClipperCMS compatible |
|
| 61 | + $target = MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/manager.lockout.html'; |
|
| 62 | 62 | $lockout_tpl = file_get_contents($target); |
| 63 | 63 | } |
| 64 | 64 | else { |
| 65 | - $target = MODX_MANAGER_PATH . 'media/style/common/manager.lockout.tpl'; |
|
| 65 | + $target = MODX_MANAGER_PATH.'media/style/common/manager.lockout.tpl'; |
|
| 66 | 66 | $lockout_tpl = file_get_contents($target); |
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | // merge placeholders |
| 71 | 71 | $lockout_tpl = $modx->mergePlaceholderContent($lockout_tpl); |
| 72 | - $regx = strpos($lockout_tpl,'[[+')!==false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers |
|
| 72 | + $regx = strpos($lockout_tpl, '[[+') !== false ? '~\[\[\+(.*?)\]\]~' : '~\[\+(.*?)\+\]~'; // little tweak for newer parsers |
|
| 73 | 73 | $lockout_tpl = preg_replace($regx, '', $lockout_tpl); //cleanup |
| 74 | 74 | |
| 75 | 75 | echo $lockout_tpl; |
@@ -1,12 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | if (!$modx->hasPermission('edit_document') || !$modx->hasPermission('save_document')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : null; |
|
| 9 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : null; |
|
| 10 | 10 | $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0; |
| 11 | 11 | $items = isset($_POST['list']) ? $_POST['list'] : ''; |
| 12 | 12 | $ressourcelist = ''; |
@@ -23,7 +23,7 @@ discard block |
||
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | if (isset($_POST['listSubmitted'])) { |
| 26 | - $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>'; |
|
| 26 | + $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>'; |
|
| 27 | 27 | if (strlen($items) > 0) { |
| 28 | 28 | $items = explode(';', $items); |
| 29 | 29 | foreach ($items as $key => $value) { |
@@ -43,15 +43,15 @@ discard block |
||
| 43 | 43 | $tblsc = $modx->getFullTableName('site_content'); |
| 44 | 44 | $tbldg = $modx->getFullTableName('document_groups'); |
| 45 | 45 | |
| 46 | - $rs = $modx->getDatabase()->select('pagetitle', $tblsc, 'id=' . $id . ''); |
|
| 46 | + $rs = $modx->getDatabase()->select('pagetitle', $tblsc, 'id='.$id.''); |
|
| 47 | 47 | $pagetitle = $modx->getDatabase()->getValue($rs); |
| 48 | 48 | |
| 49 | 49 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
| 50 | 50 | $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; |
| 51 | - $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
| 52 | - $access = " AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
| 51 | + $mgrRole = (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
| 52 | + $access = " AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
| 53 | 53 | |
| 54 | - $rs = $modx->getDatabase()->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc . 'AS sc LEFT JOIN ' . $tbldg . ' dg ON dg.document=sc.id', 'sc.parent=' . $id . $access . ' GROUP BY sc.id', 'menuindex ASC'); |
|
| 54 | + $rs = $modx->getDatabase()->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc.'AS sc LEFT JOIN '.$tbldg.' dg ON dg.document=sc.id', 'sc.parent='.$id.$access.' GROUP BY sc.id', 'menuindex ASC'); |
|
| 55 | 55 | |
| 56 | 56 | if ($modx->getDatabase()->getRecordCount($rs)) { |
| 57 | 57 | $ressourcelist .= '<div class="clearfix"><ul id="sortlist" class="sortableList">'; |
@@ -60,12 +60,12 @@ discard block |
||
| 60 | 60 | $classes .= ($row['hidemenu']) ? ' notInMenuNode ' : ' inMenuNode'; |
| 61 | 61 | $classes .= ($row['published']) ? ' publishedNode ' : ' unpublishedNode '; |
| 62 | 62 | $classes = ($row['deleted']) ? ' deletedNode ' : $classes; |
| 63 | - $icon = $row['isfolder'] ? '<i class="' . $_style['files_folder'] . '"></i> ' : ' <i class="' . $_style['files_page_html'] . '"></i> '; |
|
| 64 | - $ressourcelist .= '<li id="item_' . $row['id'] . '" class="' . $classes . '">' . $icon . $row['pagetitle'] . ' <small>(' . $row['id'] . ')</small></li>'; |
|
| 63 | + $icon = $row['isfolder'] ? '<i class="'.$_style['files_folder'].'"></i> ' : ' <i class="'.$_style['files_page_html'].'"></i> '; |
|
| 64 | + $ressourcelist .= '<li id="item_'.$row['id'].'" class="'.$classes.'">'.$icon.$row['pagetitle'].' <small>('.$row['id'].')</small></li>'; |
|
| 65 | 65 | } |
| 66 | 66 | $ressourcelist .= '</ul></div>'; |
| 67 | 67 | } else { |
| 68 | - $updateMsg = '<p class="text-danger">' . $_lang['sort_nochildren'] . '</p>'; |
|
| 68 | + $updateMsg = '<p class="text-danger">'.$_lang['sort_nochildren'].'</p>'; |
|
| 69 | 69 | } |
| 70 | 70 | } |
| 71 | 71 | |
@@ -148,7 +148,7 @@ discard block |
||
| 148 | 148 | </script> |
| 149 | 149 | |
| 150 | 150 | <h1> |
| 151 | - <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $modx->getPhpCompat()->entities($pagetitle) . '<small>(' . $id . ')</small>' : $_lang['sort_menuindex']) ?> |
|
| 151 | + <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $modx->getPhpCompat()->entities($pagetitle).'<small>('.$id.')</small>' : $_lang['sort_menuindex']) ?> |
|
| 152 | 152 | </h1> |
| 153 | 153 | |
| 154 | 154 | <?= $_style['actionbuttons']['dynamic']['save'] ?> |
@@ -1,46 +1,46 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('settings')) { |
|
| 5 | +if (!$modx->hasPermission('settings')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | $data = $_POST; |
| 9 | 9 | // lose the POST now, gets rid of quirky issue with Safari 3 - see FS#972 |
| 10 | 10 | unset($_POST); |
| 11 | 11 | |
| 12 | -if($data['friendly_urls']==='1' && strpos($_SERVER['SERVER_SOFTWARE'],'IIS')===false) |
|
| 12 | +if ($data['friendly_urls'] === '1' && strpos($_SERVER['SERVER_SOFTWARE'], 'IIS') === false) |
|
| 13 | 13 | { |
| 14 | - $htaccess = $modx->config['base_path'] . '.htaccess'; |
|
| 15 | - $sample_htaccess = $modx->config['base_path'] . 'ht.access'; |
|
| 16 | - $dir = '/' . trim($modx->config['base_url'],'/'); |
|
| 17 | - if(is_file($htaccess)) |
|
| 14 | + $htaccess = $modx->config['base_path'].'.htaccess'; |
|
| 15 | + $sample_htaccess = $modx->config['base_path'].'ht.access'; |
|
| 16 | + $dir = '/'.trim($modx->config['base_url'], '/'); |
|
| 17 | + if (is_file($htaccess)) |
|
| 18 | 18 | { |
| 19 | 19 | $_ = file_get_contents($htaccess); |
| 20 | - if(strpos($_,'RewriteBase')===false) |
|
| 20 | + if (strpos($_, 'RewriteBase') === false) |
|
| 21 | 21 | { |
| 22 | 22 | $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
| 23 | 23 | } |
| 24 | - elseif(is_writable($htaccess)) |
|
| 24 | + elseif (is_writable($htaccess)) |
|
| 25 | 25 | { |
| 26 | - $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); |
|
| 27 | - if(!@file_put_contents($htaccess,$_)) |
|
| 26 | + $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); |
|
| 27 | + if (!@file_put_contents($htaccess, $_)) |
|
| 28 | 28 | { |
| 29 | 29 | $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
| 30 | 30 | } |
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | - elseif(is_file($sample_htaccess)) |
|
| 33 | + elseif (is_file($sample_htaccess)) |
|
| 34 | 34 | { |
| 35 | - if(!@rename($sample_htaccess,$htaccess)) |
|
| 35 | + if (!@rename($sample_htaccess, $htaccess)) |
|
| 36 | 36 | { |
| 37 | 37 | $warnings[] = $_lang["settings_friendlyurls_alert"]; |
| 38 | 38 | } |
| 39 | - elseif($modx->config['base_url']!=='/') |
|
| 39 | + elseif ($modx->config['base_url'] !== '/') |
|
| 40 | 40 | { |
| 41 | 41 | $_ = file_get_contents($htaccess); |
| 42 | - $_ = preg_replace('@RewriteBase.+@',"RewriteBase {$dir}", $_); |
|
| 43 | - if(!@file_put_contents($htaccess,$_)) |
|
| 42 | + $_ = preg_replace('@RewriteBase.+@', "RewriteBase {$dir}", $_); |
|
| 43 | + if (!@file_put_contents($htaccess, $_)) |
|
| 44 | 44 | { |
| 45 | 45 | $warnings[] = $_lang["settings_friendlyurls_alert2"]; |
| 46 | 46 | } |
@@ -48,17 +48,17 @@ discard block |
||
| 48 | 48 | } |
| 49 | 49 | } |
| 50 | 50 | |
| 51 | -if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
| 52 | - unlink(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css'); |
|
| 51 | +if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) { |
|
| 52 | + unlink(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css'); |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | -$data['filemanager_path'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['filemanager_path']); |
|
| 56 | -$data['rb_base_dir'] = str_replace('[(base_path)]',MODX_BASE_PATH,$data['rb_base_dir']); |
|
| 55 | +$data['filemanager_path'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['filemanager_path']); |
|
| 56 | +$data['rb_base_dir'] = str_replace('[(base_path)]', MODX_BASE_PATH, $data['rb_base_dir']); |
|
| 57 | 57 | |
| 58 | 58 | if (isset($data) && count($data) > 0) { |
| 59 | - if(isset($data['manager_language'])) { |
|
| 60 | - $lang_path = MODX_MANAGER_PATH . 'includes/lang/' . $data['manager_language'] . '.inc.php'; |
|
| 61 | - if(is_file($lang_path)) { |
|
| 59 | + if (isset($data['manager_language'])) { |
|
| 60 | + $lang_path = MODX_MANAGER_PATH.'includes/lang/'.$data['manager_language'].'.inc.php'; |
|
| 61 | + if (is_file($lang_path)) { |
|
| 62 | 62 | include($lang_path); |
| 63 | 63 | global $modx_lang_attribute; |
| 64 | 64 | $data['lang_code'] = !$modx_lang_attribute ? 'en' : $modx_lang_attribute; |
@@ -66,12 +66,12 @@ discard block |
||
| 66 | 66 | } |
| 67 | 67 | $savethese = array(); |
| 68 | 68 | $data['sys_files_checksum'] = $modx->getManagerApi()->getSystemChecksum($data['check_files_onlogin']); |
| 69 | - $data['mail_check_timeperiod'] = (int)$data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute |
|
| 69 | + $data['mail_check_timeperiod'] = (int) $data['mail_check_timeperiod'] < 60 ? 60 : $data['mail_check_timeperiod']; // updateMail() in mainMenu no faster than every minute |
|
| 70 | 70 | foreach ($data as $k => $v) { |
| 71 | 71 | switch ($k) { |
| 72 | 72 | case 'settings_version':{ |
| 73 | - if($modx->getVersionData('version')!=$data['settings_version']){ |
|
| 74 | - $modx->logEvent(17,2,'<pre>'.var_export($data['settings_version'],true).'</pre>','fake settings_version'); |
|
| 73 | + if ($modx->getVersionData('version') != $data['settings_version']) { |
|
| 74 | + $modx->logEvent(17, 2, '<pre>'.var_export($data['settings_version'], true).'</pre>', 'fake settings_version'); |
|
| 75 | 75 | $v = $modx->getVersionData('version'); |
| 76 | 76 | } |
| 77 | 77 | break; |
@@ -92,21 +92,21 @@ discard block |
||
| 92 | 92 | case 'rb_base_url': |
| 93 | 93 | case 'filemanager_path': |
| 94 | 94 | $v = trim($v); |
| 95 | - $v = rtrim($v,'/') . '/'; |
|
| 95 | + $v = rtrim($v, '/').'/'; |
|
| 96 | 96 | break; |
| 97 | 97 | case 'manager_language': |
| 98 | - $langDir = realpath(MODX_MANAGER_PATH . 'includes/lang'); |
|
| 99 | - $langFile = realpath(MODX_MANAGER_PATH . 'includes/lang/' . $v . '.inc.php'); |
|
| 98 | + $langDir = realpath(MODX_MANAGER_PATH.'includes/lang'); |
|
| 99 | + $langFile = realpath(MODX_MANAGER_PATH.'includes/lang/'.$v.'.inc.php'); |
|
| 100 | 100 | $langFileDir = dirname($langFile); |
| 101 | - if($langDir !== $langFileDir || !file_exists($langFile)) { |
|
| 101 | + if ($langDir !== $langFileDir || !file_exists($langFile)) { |
|
| 102 | 102 | $v = 'english'; |
| 103 | 103 | } |
| 104 | 104 | break; |
| 105 | 105 | case 'smtppw': |
| 106 | 106 | if ($v !== '********************' && $v !== '') { |
| 107 | 107 | $v = trim($v); |
| 108 | - $v = base64_encode($v) . substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); |
|
| 109 | - $v = str_replace('=','%',$v); |
|
| 108 | + $v = base64_encode($v).substr(str_shuffle('abcdefghjkmnpqrstuvxyzABCDEFGHJKLMNPQRSTUVWXYZ23456789'), 0, 7); |
|
| 109 | + $v = str_replace('=', '%', $v); |
|
| 110 | 110 | } elseif ($v === '********************') { |
| 111 | 111 | $k = ''; |
| 112 | 112 | } |
@@ -115,14 +115,14 @@ discard block |
||
| 115 | 115 | $v = str_replace(array(' ,', ', '), ',', $v); |
| 116 | 116 | if ($v !== ',') { |
| 117 | 117 | $v = ($v != 'MODX_SITE_HOSTNAMES') ? $v : ''; |
| 118 | - $configString = '<?php' . "\n" . 'define(\'MODX_SITE_HOSTNAMES\', \'' . $v . '\');' . "\n"; |
|
| 119 | - @file_put_contents(MODX_BASE_PATH . 'assets/cache/siteHostnames.php', $configString); |
|
| 118 | + $configString = '<?php'."\n".'define(\'MODX_SITE_HOSTNAMES\', \''.$v.'\');'."\n"; |
|
| 119 | + @file_put_contents(MODX_BASE_PATH.'assets/cache/siteHostnames.php', $configString); |
|
| 120 | 120 | } |
| 121 | 121 | $k = ''; |
| 122 | 122 | break; |
| 123 | 123 | case 'session_timeout': |
| 124 | 124 | $mail_check_timeperiod = $data['mail_check_timeperiod']; |
| 125 | - $v = (int)$v < ($data['mail_check_timeperiod']/60+1) ? ($data['mail_check_timeperiod']/60+1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum |
|
| 125 | + $v = (int) $v < ($data['mail_check_timeperiod'] / 60 + 1) ? ($data['mail_check_timeperiod'] / 60 + 1) : $v; // updateMail() in mainMenu pings as per mail_check_timeperiod, so +1min is minimum |
|
| 126 | 126 | break; |
| 127 | 127 | default: |
| 128 | 128 | break; |
@@ -131,7 +131,7 @@ discard block |
||
| 131 | 131 | |
| 132 | 132 | $modx->config[$k] = $v; |
| 133 | 133 | |
| 134 | - if(!empty($k)) $savethese[] = '(\''.$modx->getDatabase()->escape($k).'\', \''.$modx->getDatabase()->escape($v).'\')'; |
|
| 134 | + if (!empty($k)) $savethese[] = '(\''.$modx->getDatabase()->escape($k).'\', \''.$modx->getDatabase()->escape($v).'\')'; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | // Run a single query to save all the values |
@@ -141,16 +141,16 @@ discard block |
||
| 141 | 141 | |
| 142 | 142 | // Reset Template Pages |
| 143 | 143 | if (isset($data['reset_template'])) { |
| 144 | - $newtemplate = (int)$data['default_template']; |
|
| 145 | - $oldtemplate = (int)$data['old_template']; |
|
| 144 | + $newtemplate = (int) $data['default_template']; |
|
| 145 | + $oldtemplate = (int) $data['old_template']; |
|
| 146 | 146 | $tbl = $modx->getFullTableName('site_content'); |
| 147 | 147 | $reset = $data['reset_template']; |
| 148 | - if($reset==1) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "type='document'"); |
|
| 149 | - else if($reset==2) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); |
|
| 148 | + if ($reset == 1) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "type='document'"); |
|
| 149 | + else if ($reset == 2) $modx->getDatabase()->update(array('template' => $newtemplate), $tbl, "template='{$oldtemplate}'"); |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | // empty cache |
| 153 | 153 | $modx->clearCache('full'); |
| 154 | 154 | } |
| 155 | -$header="Location: index.php?a=7&r=10"; |
|
| 155 | +$header = "Location: index.php?a=7&r=10"; |
|
| 156 | 156 | header($header); |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) {
|
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.");
|
| 4 | 4 | } |
| 5 | 5 | header("X-XSS-Protection: 0");
|
@@ -47,9 +47,9 @@ discard block |
||
| 47 | 47 | |
| 48 | 48 | $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness');
|
| 49 | 49 | if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) {
|
| 50 | - $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']]; |
|
| 50 | + $body_class .= ' '.$theme_modes[$_COOKIE['MODX_themeMode']]; |
|
| 51 | 51 | } elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) {
|
| 52 | - $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']]; |
|
| 52 | + $body_class .= ' '.$theme_modes[$modx->config['manager_theme_mode']]; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | 55 | $navbar_position = $modx->config['manager_menu_position']; |
@@ -82,36 +82,36 @@ discard block |
||
| 82 | 82 | $user['which_browser'] = $modx->config['which_browser']; |
| 83 | 83 | } |
| 84 | 84 | |
| 85 | -$css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime; |
|
| 85 | +$css = 'media/style/'.$modx->config['manager_theme'].'/css/page.css?v='.$lastInstallTime; |
|
| 86 | 86 | |
| 87 | 87 | if ($modx->config['manager_theme'] == 'default') {
|
| 88 | - if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) {
|
|
| 89 | - require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
|
| 88 | + if (!file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css') && is_writable(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css')) {
|
|
| 89 | + require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php'; |
|
| 90 | 90 | $minifier = new Formatter\CSSMinify(); |
| 91 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
| 92 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
| 93 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css'); |
|
| 94 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css'); |
|
| 95 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css'); |
|
| 96 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css'); |
|
| 97 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css'); |
|
| 98 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css'); |
|
| 99 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css'); |
|
| 100 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css'); |
|
| 101 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css'); |
|
| 91 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
| 92 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
| 93 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/fonts.css'); |
|
| 94 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/forms.css'); |
|
| 95 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/mainmenu.css'); |
|
| 96 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tree.css'); |
|
| 97 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/custom.css'); |
|
| 98 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tabpane.css'); |
|
| 99 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/contextmenu.css'); |
|
| 100 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/index.css'); |
|
| 101 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/main.css'); |
|
| 102 | 102 | $css = $minifier->minify(); |
| 103 | - file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css); |
|
| 103 | + file_put_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css', $css); |
|
| 104 | 104 | } |
| 105 | - if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) {
|
|
| 106 | - $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; |
|
| 105 | + if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) {
|
|
| 106 | + $css = 'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css?v='.$lastInstallTime; |
|
| 107 | 107 | } |
| 108 | 108 | } |
| 109 | 109 | |
| 110 | -$modx->config['global_tabs'] = (int)($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin')));
|
|
| 110 | +$modx->config['global_tabs'] = (int) ($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin')));
|
|
| 111 | 111 | |
| 112 | 112 | ?> |
| 113 | 113 | <!DOCTYPE html> |
| 114 | -<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="') . $mxla . '" xml:lang="' . $mxla . '"' ?>> |
|
| 114 | +<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="').$mxla.'" xml:lang="'.$mxla.'"' ?>> |
|
| 115 | 115 | <head> |
| 116 | 116 | <title><?= $modx->getPhpCompat()->entities($site_name) ?>- (EVO CMS Manager)</title> |
| 117 | 117 | <meta http-equiv="Content-Type" content="text/html; charset=<?= $modx_manager_charset ?>" /> |
@@ -142,21 +142,21 @@ discard block |
||
| 142 | 142 | MODX_SITE_URL: '<?= MODX_SITE_URL ?>', |
| 143 | 143 | MODX_MANAGER_URL: '<?= MODX_MANAGER_URL ?>', |
| 144 | 144 | user: {
|
| 145 | - role: <?= (int)$user['role'] ?>, |
|
| 145 | + role: <?= (int) $user['role'] ?>, |
|
| 146 | 146 | username: '<?= $user['username'] ?>' |
| 147 | 147 | }, |
| 148 | 148 | config: {
|
| 149 | 149 | mail_check_timeperiod: <?= $modx->config['mail_check_timeperiod'] ?>, |
| 150 | - menu_height: <?= (int)$menu_height ?>, |
|
| 151 | - tree_width: <?= (int)$tree_width ?>, |
|
| 152 | - tree_min_width: <?= (int)$tree_min_width ?>, |
|
| 153 | - session_timeout: <?= (int)$modx->config['session_timeout'] ?>, |
|
| 154 | - site_start: <?= (int)$modx->config['site_start'] ?>, |
|
| 155 | - tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int)$modx->config['tree_page_click'] : 27) ?>, |
|
| 150 | + menu_height: <?= (int) $menu_height ?>, |
|
| 151 | + tree_width: <?= (int) $tree_width ?>, |
|
| 152 | + tree_min_width: <?= (int) $tree_min_width ?>, |
|
| 153 | + session_timeout: <?= (int) $modx->config['session_timeout'] ?>, |
|
| 154 | + site_start: <?= (int) $modx->config['site_start'] ?>, |
|
| 155 | + tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int) $modx->config['tree_page_click'] : 27) ?>, |
|
| 156 | 156 | theme: '<?= $modx->config['manager_theme'] ?>', |
| 157 | 157 | theme_mode: '<?= $modx->config['manager_theme_mode'] ?>', |
| 158 | 158 | which_browser: '<?= $user['which_browser'] ?>', |
| 159 | - layout: <?= (int)$manager_layout ?>, |
|
| 159 | + layout: <?= (int) $manager_layout ?>, |
|
| 160 | 160 | textdir: '<?= $modx_textdir ?>', |
| 161 | 161 | global_tabs: <?= $modx->config['global_tabs'] ?> |
| 162 | 162 | |
@@ -241,11 +241,11 @@ discard block |
||
| 241 | 241 | delete a[b]; |
| 242 | 242 | }, |
| 243 | 243 | openedArray: [], |
| 244 | - lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?> |
|
| 244 | + lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE)."\n" ?> |
|
| 245 | 245 | }; |
| 246 | 246 | <?php |
| 247 | 247 | $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray'])));
|
| 248 | - echo (empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n modx.openedArray[", $opened) . '] = 1;') . "\n";
|
|
| 248 | + echo (empty($opened) ? '' : 'modx.openedArray['.implode("] = 1;\n modx.openedArray[", $opened).'] = 1;')."\n";
|
|
| 249 | 249 | ?> |
| 250 | 250 | </script> |
| 251 | 251 | <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script> |
@@ -327,7 +327,7 @@ discard block |
||
| 327 | 327 | <a href="javascript:;" class="dropdown-toggle" onclick="return false;"> |
| 328 | 328 | <span class="username"><?= $user['username'] ?></span> |
| 329 | 329 | <?php if ($user['photo']) { ?>
|
| 330 | - <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL . $user['photo'] ?>);"></span> |
|
| 330 | + <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL.$user['photo'] ?>);"></span> |
|
| 331 | 331 | <?php } else { ?>
|
| 332 | 332 | <span class="icon"><?= $_style['menu_user'] ?></span> |
| 333 | 333 | <?php } ?> |
@@ -354,7 +354,7 @@ discard block |
||
| 354 | 354 | $version = 'Evolution'; |
| 355 | 355 | ?> |
| 356 | 356 | <?php |
| 357 | - echo sprintf('<li><span class="dropdown-item" title="%s – %s" %s>' . $version . ' %s</span></li>', $modx->getPhpCompat()->entities($site_name), $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']);
|
|
| 357 | + echo sprintf('<li><span class="dropdown-item" title="%s – %s" %s>'.$version.' %s</span></li>', $modx->getPhpCompat()->entities($site_name), $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']);
|
|
| 358 | 358 | ?> |
| 359 | 359 | </ul> |
| 360 | 360 | </li> |
@@ -506,7 +506,7 @@ discard block |
||
| 506 | 506 | </div> |
| 507 | 507 | |
| 508 | 508 | <?php |
| 509 | - if(!function_exists('constructLink')) {
|
|
| 509 | + if (!function_exists('constructLink')) {
|
|
| 510 | 510 | /** |
| 511 | 511 | * @param string $action |
| 512 | 512 | * @param string $img |
@@ -515,7 +515,7 @@ discard block |
||
| 515 | 515 | */ |
| 516 | 516 | function constructLink($action, $img, $text, $allowed) |
| 517 | 517 | {
|
| 518 | - if ((bool)$allowed) {
|
|
| 518 | + if ((bool) $allowed) {
|
|
| 519 | 519 | echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action,
|
| 520 | 520 | $action); |
| 521 | 521 | echo sprintf('<i class="%s"></i> %s</div>', $img, $text);
|
@@ -556,7 +556,7 @@ discard block |
||
| 556 | 556 | <script type="text/javascript"> |
| 557 | 557 | |
| 558 | 558 | if (document.getElementById('treeMenu')) {
|
| 559 | - <?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?>
|
|
| 559 | + <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?>
|
|
| 560 | 560 | |
| 561 | 561 | document.getElementById('treeMenu_openelements').onclick = function(e) {
|
| 562 | 562 | e.preventDefault(); |
@@ -574,12 +574,12 @@ discard block |
||
| 574 | 574 | } |
| 575 | 575 | }; |
| 576 | 576 | <?php } ?> |
| 577 | - <?php if($use_browser && $modx->hasPermission('assets_images')) { ?>
|
|
| 577 | + <?php if ($use_browser && $modx->hasPermission('assets_images')) { ?>
|
|
| 578 | 578 | |
| 579 | 579 | document.getElementById('treeMenu_openimages').onclick = function(e) {
|
| 580 | 580 | e.preventDefault(); |
| 581 | 581 | if (modx.config.global_tabs && !e.shiftKey) {
|
| 582 | - modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'});
|
|
| 582 | + modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'});
|
|
| 583 | 583 | } else {
|
| 584 | 584 | var randomNum = '<?= $_lang["files_files"] ?>'; |
| 585 | 585 | if (e.shiftKey) {
|
@@ -592,12 +592,12 @@ discard block |
||
| 592 | 592 | } |
| 593 | 593 | }; |
| 594 | 594 | <?php } ?> |
| 595 | - <?php if($use_browser && $modx->hasPermission('assets_files')) { ?>
|
|
| 595 | + <?php if ($use_browser && $modx->hasPermission('assets_files')) { ?>
|
|
| 596 | 596 | |
| 597 | 597 | document.getElementById('treeMenu_openfiles').onclick = function(e) {
|
| 598 | 598 | e.preventDefault(); |
| 599 | 599 | if (modx.config.global_tabs && !e.shiftKey) {
|
| 600 | - modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'});
|
|
| 600 | + modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'});
|
|
| 601 | 601 | } else {
|
| 602 | 602 | var randomNum = '<?= $_lang["files_files"] ?>'; |
| 603 | 603 | if (e.shiftKey) {
|
@@ -651,7 +651,7 @@ discard block |
||
| 651 | 651 | |
| 652 | 652 | </div> |
| 653 | 653 | <?php if ($modx->config['show_picker'] != "0") {
|
| 654 | - include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php');
|
|
| 654 | + include('media/style/'.$modx->config['manager_theme'].'/color.switcher.php');
|
|
| 655 | 655 | } ?> |
| 656 | 656 | </body> |
| 657 | 657 | </html> |