@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | * @see https://github.com/theseer/Autoload |
4 | 4 | */ |
5 | 5 | spl_autoload_register( |
6 | - function($class) { |
|
6 | + function($class){ |
|
7 | 7 | static $classes = null; |
8 | 8 | if ($classes === null) { |
9 | 9 | $classes = array( |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | } |
67 | 67 | $cn = strtolower($class); |
68 | 68 | if (isset($classes[$cn])) { |
69 | - require __DIR__ . $classes[$cn]; |
|
69 | + require __DIR__.$classes[$cn]; |
|
70 | 70 | } |
71 | 71 | }, |
72 | 72 | true, |
@@ -3,7 +3,7 @@ |
||
3 | 3 | * @see https://github.com/theseer/Autoload |
4 | 4 | */ |
5 | 5 | spl_autoload_register( |
6 | - function($class) { |
|
6 | + function($class){ |
|
7 | 7 | static $classes = null; |
8 | 8 | if ($classes === null) { |
9 | 9 | $classes = array( |
@@ -4,15 +4,15 @@ |
||
4 | 4 | } |
5 | 5 | |
6 | 6 | $rs = $modx->getDatabase()->select('COUNT(*)', $modx->getFullTableName('user_messages'), |
7 | - "recipient=" . $modx->getLoginUserID() . " AND messageread=0"); |
|
7 | + "recipient=".$modx->getLoginUserID()." AND messageread=0"); |
|
8 | 8 | $nrnewmessages = $modx->getDatabase()->getValue($rs); |
9 | -$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID()); |
|
9 | +$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()); |
|
10 | 10 | $nrtotalmessages = $modx->getDatabase()->getValue($rs); |
11 | 11 | $messagesallowed = $modx->hasPermission('messages'); |
12 | 12 | |
13 | 13 | // ajax response |
14 | 14 | if (isset($_POST['updateMsgCount'])) { |
15 | 15 | header("Content-Type: application/json; charset=utf-8"); |
16 | - print $nrnewmessages . ',' . $nrtotalmessages; |
|
16 | + print $nrnewmessages.','.$nrtotalmessages; |
|
17 | 17 | exit; |
18 | 18 | } |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | $modx = evolutionCMS(); |
27 | 27 | $modx->getDatabase()->connect(); |
28 | 28 | startCMSSession(); |
29 | -if(!isset($_SESSION['mgrValidated'])) { |
|
29 | +if (!isset($_SESSION['mgrValidated'])) { |
|
30 | 30 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
31 | 31 | } |
32 | 32 | define('IN_MANAGER_MODE', true); |
@@ -34,7 +34,7 @@ discard block |
||
34 | 34 | |
35 | 35 | $manager_language = $modx->config['manager_language']; |
36 | 36 | // Pass language code from MODX to KCFinder |
37 | -if(!file_exists("../../../includes/lang/".$manager_language.".inc.php")) { |
|
37 | +if (!file_exists("../../../includes/lang/".$manager_language.".inc.php")) { |
|
38 | 38 | $manager_language = "english"; // if not set, get the english language file. |
39 | 39 | } |
40 | 40 | include_once "../../../includes/lang/".$manager_language.".inc.php"; |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | |
43 | 43 | // PHP VERSION CHECK |
44 | 44 | if (substr(PHP_VERSION, 0, strpos(PHP_VERSION, '.')) < 5) |
45 | - die("You are using PHP " . PHP_VERSION . " when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution."); |
|
45 | + die("You are using PHP ".PHP_VERSION." when KCFinder require at least version 5! Some systems has an option to change the active PHP version. Please refer to your hosting provider or upgrade your PHP distribution."); |
|
46 | 46 | |
47 | 47 | |
48 | 48 | // SAFE MODE CHECK |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | |
52 | 52 | |
53 | 53 | // MAGIC AUTOLOAD CLASSES FUNCTION |
54 | -function autoloadda9d06472ccb71b84928677ce2a6ca89($class) { |
|
54 | +function autoloadda9d06472ccb71b84928677ce2a6ca89($class){ |
|
55 | 55 | static $classes = null; |
56 | 56 | if ($classes === null) { |
57 | 57 | $classes = array( |
@@ -75,7 +75,7 @@ discard block |
||
75 | 75 | ); |
76 | 76 | } |
77 | 77 | if (isset($classes[$class])) { |
78 | - require dirname(__FILE__) . $classes[$class]; |
|
78 | + require dirname(__FILE__).$classes[$class]; |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 | spl_autoload_register('autoloadda9d06472ccb71b84928677ce2a6ca89', true); |
@@ -84,18 +84,18 @@ discard block |
||
84 | 84 | // json_encode() IMPLEMENTATION IF JSON EXTENSION IS MISSING |
85 | 85 | if (!function_exists("json_encode")) { |
86 | 86 | |
87 | - function kcfinder_json_string_encode($string) { |
|
88 | - return '"' . |
|
87 | + function kcfinder_json_string_encode($string){ |
|
88 | + return '"'. |
|
89 | 89 | str_replace('/', "\\/", |
90 | 90 | str_replace("\t", "\\t", |
91 | 91 | str_replace("\r", "\\r", |
92 | 92 | str_replace("\n", "\\n", |
93 | 93 | str_replace('"', "\\\"", |
94 | 94 | str_replace("\\", "\\\\", |
95 | - $string)))))) . '"'; |
|
95 | + $string)))))).'"'; |
|
96 | 96 | } |
97 | 97 | |
98 | - function json_encode($data) { |
|
98 | + function json_encode($data){ |
|
99 | 99 | |
100 | 100 | if (is_array($data)) { |
101 | 101 | $ret = array(); |
@@ -103,14 +103,14 @@ discard block |
||
103 | 103 | // OBJECT |
104 | 104 | if (array_keys($data) !== range(0, count($data) - 1)) { |
105 | 105 | foreach ($data as $key => $val) |
106 | - $ret[] = kcfinder_json_string_encode($key) . ':' . json_encode($val); |
|
107 | - return "{" . implode(",", $ret) . "}"; |
|
106 | + $ret[] = kcfinder_json_string_encode($key).':'.json_encode($val); |
|
107 | + return "{".implode(",", $ret)."}"; |
|
108 | 108 | |
109 | 109 | // ARRAY |
110 | 110 | } else { |
111 | 111 | foreach ($data as $val) |
112 | 112 | $ret[] = json_encode($val); |
113 | - return "[" . implode(",", $ret) . "]"; |
|
113 | + return "[".implode(",", $ret)."]"; |
|
114 | 114 | } |
115 | 115 | |
116 | 116 | // BOOLEAN OR NULL |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | /** This file is part of KCFinder project |
4 | - * |
|
5 | - * @desc Uploader class |
|
6 | - * @package KCFinder |
|
7 | - * @version 2.54 |
|
8 | - * @author Pavel Tzonkov <[email protected]> |
|
9 | - * @copyright 2010-2014 KCFinder Project |
|
10 | - * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
11 | - * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
12 | - * @link http://kcfinder.sunhater.com |
|
13 | - */ |
|
4 | + * |
|
5 | + * @desc Uploader class |
|
6 | + * @package KCFinder |
|
7 | + * @version 2.54 |
|
8 | + * @author Pavel Tzonkov <[email protected]> |
|
9 | + * @copyright 2010-2014 KCFinder Project |
|
10 | + * @license http://www.opensource.org/licenses/gpl-2.0.php GPLv2 |
|
11 | + * @license http://www.opensource.org/licenses/lgpl-2.1.php LGPLv2 |
|
12 | + * @link http://kcfinder.sunhater.com |
|
13 | + */ |
|
14 | 14 | |
15 | 15 | class uploader { |
16 | 16 | |
@@ -18,92 +18,92 @@ discard block |
||
18 | 18 | const VERSION = "2.54"; |
19 | 19 | |
20 | 20 | /** Config session-overrided settings |
21 | - * @var array */ |
|
21 | + * @var array */ |
|
22 | 22 | protected $config = array(); |
23 | 23 | |
24 | 24 | /** Default image driver |
25 | - * @var string */ |
|
25 | + * @var string */ |
|
26 | 26 | protected $imageDriver = "gd"; |
27 | 27 | |
28 | 28 | /** Opener applocation properties |
29 | - * $opener['name'] Got from $_GET['opener']; |
|
30 | - * $opener['CKEditor']['funcNum'] CKEditor function number (got from $_GET) |
|
31 | - * $opener['TinyMCE'] Boolean |
|
32 | - * @var array */ |
|
29 | + * $opener['name'] Got from $_GET['opener']; |
|
30 | + * $opener['CKEditor']['funcNum'] CKEditor function number (got from $_GET) |
|
31 | + * $opener['TinyMCE'] Boolean |
|
32 | + * @var array */ |
|
33 | 33 | protected $opener = array(); |
34 | 34 | |
35 | 35 | /** Got from $_GET['type'] or first one $config['types'] array key, if inexistant |
36 | - * @var string */ |
|
36 | + * @var string */ |
|
37 | 37 | protected $type; |
38 | 38 | |
39 | 39 | /** Helper property. Local filesystem path to the Type Directory |
40 | - * Equivalent: $config['uploadDir'] . "/" . $type |
|
41 | - * @var string */ |
|
40 | + * Equivalent: $config['uploadDir'] . "/" . $type |
|
41 | + * @var string */ |
|
42 | 42 | protected $typeDir; |
43 | 43 | |
44 | 44 | /** Helper property. Web URL to the Type Directory |
45 | - * Equivalent: $config['uploadURL'] . "/" . $type |
|
46 | - * @var string */ |
|
45 | + * Equivalent: $config['uploadURL'] . "/" . $type |
|
46 | + * @var string */ |
|
47 | 47 | protected $typeURL; |
48 | 48 | |
49 | 49 | /** Linked to $config['types'] |
50 | - * @var array */ |
|
50 | + * @var array */ |
|
51 | 51 | protected $types = array(); |
52 | 52 | |
53 | 53 | /** Settings which can override default settings if exists as keys in $config['types'][$type] array |
54 | - * @var array */ |
|
54 | + * @var array */ |
|
55 | 55 | protected $typeSettings = array('disabled', 'theme', 'dirPerms', 'filePerms', 'denyZipDownload', 'maxImageWidth', 'maxImageHeight', 'thumbWidth', 'thumbHeight', 'jpegQuality', 'access', 'filenameChangeChars', 'dirnameChangeChars', 'denyExtensionRename', 'deniedExts', 'watermark'); |
56 | 56 | |
57 | 57 | /** Got from language file |
58 | - * @var string */ |
|
58 | + * @var string */ |
|
59 | 59 | protected $charset; |
60 | 60 | |
61 | 61 | /** The language got from $_GET['lng'] or $_GET['lang'] or... Please see next property |
62 | - * @var string */ |
|
62 | + * @var string */ |
|
63 | 63 | protected $lang = 'en'; |
64 | 64 | |
65 | 65 | /** Possible language $_GET keys |
66 | - * @var array */ |
|
66 | + * @var array */ |
|
67 | 67 | protected $langInputNames = array('lang', 'langCode', 'lng', 'language', 'lang_code'); |
68 | 68 | |
69 | 69 | /** Uploaded file(s) info. Linked to first $_FILES element |
70 | - * @var array */ |
|
70 | + * @var array */ |
|
71 | 71 | protected $file; |
72 | 72 | |
73 | 73 | /** Next three properties are got from the current language file |
74 | - * @var string */ |
|
74 | + * @var string */ |
|
75 | 75 | protected $dateTimeFull; // Currently not used |
76 | 76 | protected $dateTimeMid; // Currently not used |
77 | 77 | protected $dateTimeSmall; |
78 | 78 | |
79 | 79 | /** Contain Specified language labels |
80 | - * @var array */ |
|
80 | + * @var array */ |
|
81 | 81 | protected $labels = array(); |
82 | 82 | |
83 | 83 | /** Contain unprocessed $_GET array. Please use this instead of $_GET |
84 | - * @var array */ |
|
84 | + * @var array */ |
|
85 | 85 | protected $get; |
86 | 86 | |
87 | 87 | /** Contain unprocessed $_POST array. Please use this instead of $_POST |
88 | - * @var array */ |
|
88 | + * @var array */ |
|
89 | 89 | protected $post; |
90 | 90 | |
91 | 91 | /** Contain unprocessed $_COOKIE array. Please use this instead of $_COOKIE |
92 | - * @var array */ |
|
92 | + * @var array */ |
|
93 | 93 | protected $cookie; |
94 | 94 | |
95 | 95 | /** Session array. Please use this property instead of $_SESSION |
96 | - * @var array */ |
|
96 | + * @var array */ |
|
97 | 97 | protected $session; |
98 | 98 | |
99 | 99 | /** CMS integration attribute (got from $_GET['cms']) |
100 | - * @var string */ |
|
100 | + * @var string */ |
|
101 | 101 | protected $cms = ""; |
102 | 102 | |
103 | 103 | protected $modx = null; |
104 | 104 | /** Magic method which allows read-only access to protected or private class properties |
105 | - * @param string $property |
|
106 | - * @return mixed */ |
|
105 | + * @param string $property |
|
106 | + * @return mixed */ |
|
107 | 107 | public function __get($property) { |
108 | 108 | return property_exists($this, $property) ? $this->$property : null; |
109 | 109 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | ) |
133 | 133 | $this->cms = $this->get['cms']; |
134 | 134 | |
135 | - // LINKING UPLOADED FILE |
|
135 | + // LINKING UPLOADED FILE |
|
136 | 136 | if (count($_FILES)) |
137 | 137 | $this->file = &$_FILES[key($_FILES)]; |
138 | 138 | |
@@ -228,8 +228,8 @@ discard block |
||
228 | 228 | $this->config['uploadDir'] = strlen($this->config['uploadDir']) |
229 | 229 | ? path::normalize($this->config['uploadDir']) |
230 | 230 | : path::url2fullPath("/$path"); |
231 | - $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; |
|
232 | - $this->typeURL = "{$this->config['siteURL']}/{$this->config['uploadURL']}/{$this->type}"; |
|
231 | + $this->typeDir = "{$this->config['uploadDir']}/{$this->type}"; |
|
232 | + $this->typeURL = "{$this->config['siteURL']}/{$this->config['uploadURL']}/{$this->type}"; |
|
233 | 233 | |
234 | 234 | // SITE ROOT |
235 | 235 | } elseif ($this->config['uploadURL'] == "/") { |
@@ -365,36 +365,36 @@ discard block |
||
365 | 365 | } |
366 | 366 | |
367 | 367 | |
368 | - protected function getTransaliasSettings() { |
|
369 | - $modx = evolutionCMS(); |
|
370 | - |
|
371 | - // Cleaning uploaded filename? |
|
372 | - $setting = $modx->getDatabase()->select('count(*)', $modx->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1'); |
|
373 | - if ($modx->getDatabase()->getValue($setting)>0) { |
|
374 | - // Transalias plugin active? |
|
375 | - $res = $modx->getDatabase()->select('properties', $modx->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0'); |
|
376 | - if ($properties = $modx->getDatabase()->getValue($res)) { |
|
377 | - $properties = $modx->parseProperties($properties, 'TransAlias', 'plugin'); |
|
378 | - } else { |
|
379 | - $properties = NULL; |
|
380 | - } |
|
381 | - } else { |
|
382 | - $properties = NULL; |
|
383 | - } |
|
384 | - return $properties; |
|
385 | - } |
|
386 | - |
|
387 | - |
|
388 | - protected function normalizeFilename($filename) { |
|
389 | - if ($this->getTransaliasSettings()) { |
|
390 | - $format = strrchr($filename, "."); |
|
391 | - $filename = str_replace($format, "", $filename); |
|
392 | - $filename = $this->modx->stripAlias($filename).$format; |
|
393 | - } |
|
394 | - return $filename; |
|
395 | - } |
|
396 | - |
|
397 | - protected function normalizeDirname($dirname) { |
|
368 | + protected function getTransaliasSettings() { |
|
369 | + $modx = evolutionCMS(); |
|
370 | + |
|
371 | + // Cleaning uploaded filename? |
|
372 | + $setting = $modx->getDatabase()->select('count(*)', $modx->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1'); |
|
373 | + if ($modx->getDatabase()->getValue($setting)>0) { |
|
374 | + // Transalias plugin active? |
|
375 | + $res = $modx->getDatabase()->select('properties', $modx->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0'); |
|
376 | + if ($properties = $modx->getDatabase()->getValue($res)) { |
|
377 | + $properties = $modx->parseProperties($properties, 'TransAlias', 'plugin'); |
|
378 | + } else { |
|
379 | + $properties = NULL; |
|
380 | + } |
|
381 | + } else { |
|
382 | + $properties = NULL; |
|
383 | + } |
|
384 | + return $properties; |
|
385 | + } |
|
386 | + |
|
387 | + |
|
388 | + protected function normalizeFilename($filename) { |
|
389 | + if ($this->getTransaliasSettings()) { |
|
390 | + $format = strrchr($filename, "."); |
|
391 | + $filename = str_replace($format, "", $filename); |
|
392 | + $filename = $this->modx->stripAlias($filename).$format; |
|
393 | + } |
|
394 | + return $filename; |
|
395 | + } |
|
396 | + |
|
397 | + protected function normalizeDirname($dirname) { |
|
398 | 398 | return $this->modx->stripAlias($dirname); |
399 | 399 | } |
400 | 400 | |
@@ -472,10 +472,10 @@ discard block |
||
472 | 472 | return $this->label("The image is too big and/or cannot be resized."); |
473 | 473 | |
474 | 474 | |
475 | - // CHECK FOR MODX MAX FILE SIZE |
|
476 | - $actualfilesize=filesize($file['tmp_name']); |
|
477 | - if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize']) |
|
478 | - return $this->label("File is too big: ".$actualfilesize." Bytes. (max ".$this->config['maxfilesize']." Bytes)"); |
|
475 | + // CHECK FOR MODX MAX FILE SIZE |
|
476 | + $actualfilesize=filesize($file['tmp_name']); |
|
477 | + if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize']) |
|
478 | + return $this->label("File is too big: ".$actualfilesize." Bytes. (max ".$this->config['maxfilesize']." Bytes)"); |
|
479 | 479 | |
480 | 480 | return true; |
481 | 481 | } |
@@ -627,7 +627,7 @@ discard block |
||
627 | 627 | $top = isset($this->config['watermark']['top']) |
628 | 628 | ? $this->config['watermark']['top'] : false; |
629 | 629 | $img->watermark($this->config['watermark']['file'], $left, $top); |
630 | - } |
|
630 | + } |
|
631 | 631 | |
632 | 632 | $options = array( 'file' => $file ); |
633 | 633 |
@@ -12,7 +12,7 @@ discard block |
||
12 | 12 | * @link http://kcfinder.sunhater.com |
13 | 13 | */ |
14 | 14 | |
15 | -class uploader { |
|
15 | +class uploader{ |
|
16 | 16 | |
17 | 17 | /** Release version */ |
18 | 18 | const VERSION = "2.54"; |
@@ -72,8 +72,8 @@ discard block |
||
72 | 72 | |
73 | 73 | /** Next three properties are got from the current language file |
74 | 74 | * @var string */ |
75 | - protected $dateTimeFull; // Currently not used |
|
76 | - protected $dateTimeMid; // Currently not used |
|
75 | + protected $dateTimeFull; // Currently not used |
|
76 | + protected $dateTimeMid; // Currently not used |
|
77 | 77 | protected $dateTimeSmall; |
78 | 78 | |
79 | 79 | /** Contain Specified language labels |
@@ -104,11 +104,11 @@ discard block |
||
104 | 104 | /** Magic method which allows read-only access to protected or private class properties |
105 | 105 | * @param string $property |
106 | 106 | * @return mixed */ |
107 | - public function __get($property) { |
|
107 | + public function __get($property){ |
|
108 | 108 | return property_exists($this, $property) ? $this->$property : null; |
109 | 109 | } |
110 | 110 | |
111 | - public function __construct($modx) { |
|
111 | + public function __construct($modx){ |
|
112 | 112 | |
113 | 113 | //MODX |
114 | 114 | try { |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | |
207 | 207 | // COOKIES INIT |
208 | 208 | $ip = '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'; |
209 | - $ip = '/^' . implode('\.', array($ip, $ip, $ip, $ip)) . '$/'; |
|
209 | + $ip = '/^'.implode('\.', array($ip, $ip, $ip, $ip)).'$/'; |
|
210 | 210 | if (preg_match($ip, $_SERVER['HTTP_HOST']) || |
211 | 211 | preg_match('/^[^\.]+$/', $_SERVER['HTTP_HOST']) |
212 | 212 | ) |
@@ -224,7 +224,7 @@ discard block |
||
224 | 224 | ) { |
225 | 225 | list($unused, $protocol, $domain, $unused, $port, $path) = $patt; |
226 | 226 | $path = path::normalize($path); |
227 | - $this->config['uploadURL'] = "$protocol://$domain" . (strlen($port) ? ":$port" : "") . "/$path"; |
|
227 | + $this->config['uploadURL'] = "$protocol://$domain".(strlen($port) ? ":$port" : "")."/$path"; |
|
228 | 228 | $this->config['uploadDir'] = strlen($this->config['uploadDir']) |
229 | 229 | ? path::normalize($this->config['uploadDir']) |
230 | 230 | : path::url2fullPath("/$path"); |
@@ -267,7 +267,7 @@ discard block |
||
267 | 267 | foreach ($this->langInputNames as $key) |
268 | 268 | if (isset($this->get[$key]) && |
269 | 269 | preg_match('/^[a-z][a-z\._\-]*$/i', $this->get[$key]) && |
270 | - file_exists("lang/" . strtolower($this->get[$key]) . ".php") |
|
270 | + file_exists("lang/".strtolower($this->get[$key]).".php") |
|
271 | 271 | ) { |
272 | 272 | $this->lang = $this->get[$key]; |
273 | 273 | break; |
@@ -298,7 +298,7 @@ discard block |
||
298 | 298 | $this->backMsg("Cannot read upload folder."); |
299 | 299 | } |
300 | 300 | |
301 | - public function upload() { |
|
301 | + public function upload(){ |
|
302 | 302 | $config = &$this->config; |
303 | 303 | $file = &$this->file; |
304 | 304 | $url = $message = ""; |
@@ -329,7 +329,7 @@ discard block |
||
329 | 329 | @mkdir(path::normalize($dir), $this->config['dirPerms'], true); |
330 | 330 | |
331 | 331 | $filename = $this->normalizeFilename($file['name']); |
332 | - $target = file::getInexistantFilename($dir . $filename); |
|
332 | + $target = file::getInexistantFilename($dir.$filename); |
|
333 | 333 | |
334 | 334 | if (!@move_uploaded_file($file['tmp_name'], $target) && |
335 | 335 | !@rename($file['tmp_name'], $target) && |
@@ -342,11 +342,11 @@ discard block |
||
342 | 342 | $this->makeThumb($target); |
343 | 343 | $url = $this->typeURL; |
344 | 344 | if (isset($udir)) $url .= "/$udir"; |
345 | - $url .= "/" . basename($target); |
|
345 | + $url .= "/".basename($target); |
|
346 | 346 | if (preg_match('/^([a-z]+)\:\/\/([^\/^\:]+)(\:(\d+))?\/(.+)$/', $url, $patt)) { |
347 | 347 | list($unused, $protocol, $domain, $unused, $port, $path) = $patt; |
348 | - $base = "$protocol://$domain" . (strlen($port) ? ":$port" : "") . "/"; |
|
349 | - $url = $base . path::urlPathEncode($path); |
|
348 | + $base = "$protocol://$domain".(strlen($port) ? ":$port" : "")."/"; |
|
349 | + $url = $base.path::urlPathEncode($path); |
|
350 | 350 | } else |
351 | 351 | $url = path::urlPathEncode($url); |
352 | 352 | } |
@@ -365,12 +365,12 @@ discard block |
||
365 | 365 | } |
366 | 366 | |
367 | 367 | |
368 | - protected function getTransaliasSettings() { |
|
368 | + protected function getTransaliasSettings(){ |
|
369 | 369 | $modx = evolutionCMS(); |
370 | 370 | |
371 | 371 | // Cleaning uploaded filename? |
372 | 372 | $setting = $modx->getDatabase()->select('count(*)', $modx->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1'); |
373 | - if ($modx->getDatabase()->getValue($setting)>0) { |
|
373 | + if ($modx->getDatabase()->getValue($setting) > 0) { |
|
374 | 374 | // Transalias plugin active? |
375 | 375 | $res = $modx->getDatabase()->select('properties', $modx->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0'); |
376 | 376 | if ($properties = $modx->getDatabase()->getValue($res)) { |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | } |
386 | 386 | |
387 | 387 | |
388 | - protected function normalizeFilename($filename) { |
|
388 | + protected function normalizeFilename($filename){ |
|
389 | 389 | if ($this->getTransaliasSettings()) { |
390 | 390 | $format = strrchr($filename, "."); |
391 | 391 | $filename = str_replace($format, "", $filename); |
@@ -394,11 +394,11 @@ discard block |
||
394 | 394 | return $filename; |
395 | 395 | } |
396 | 396 | |
397 | - protected function normalizeDirname($dirname) { |
|
397 | + protected function normalizeDirname($dirname){ |
|
398 | 398 | return $this->modx->stripAlias($dirname); |
399 | 399 | } |
400 | 400 | |
401 | - protected function checkUploadedFile(array $aFile=null) { |
|
401 | + protected function checkUploadedFile(array $aFile = null){ |
|
402 | 402 | $config = &$this->config; |
403 | 403 | $file = ($aFile === null) ? $this->file : $aFile; |
404 | 404 | |
@@ -437,8 +437,7 @@ discard block |
||
437 | 437 | ($file['error'] == UPLOAD_ERR_NO_TMP_DIR) ? |
438 | 438 | $this->label("Missing a temporary folder.") : ( |
439 | 439 | ($file['error'] == UPLOAD_ERR_CANT_WRITE) ? |
440 | - $this->label("Failed to write file.") : |
|
441 | - $this->label("Unknown error.") |
|
440 | + $this->label("Failed to write file.") : $this->label("Unknown error.") |
|
442 | 441 | ))))); |
443 | 442 | |
444 | 443 | // HIDDEN FILENAMES CHECK |
@@ -473,14 +472,14 @@ discard block |
||
473 | 472 | |
474 | 473 | |
475 | 474 | // CHECK FOR MODX MAX FILE SIZE |
476 | - $actualfilesize=filesize($file['tmp_name']); |
|
475 | + $actualfilesize = filesize($file['tmp_name']); |
|
477 | 476 | if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize']) |
478 | 477 | return $this->label("File is too big: ".$actualfilesize." Bytes. (max ".$this->config['maxfilesize']." Bytes)"); |
479 | 478 | |
480 | 479 | return true; |
481 | 480 | } |
482 | 481 | |
483 | - protected function checkInputDir($dir, $inclType=true, $existing=true) { |
|
482 | + protected function checkInputDir($dir, $inclType = true, $existing = true){ |
|
484 | 483 | $dir = path::normalize($dir); |
485 | 484 | if (substr($dir, 0, 1) == "/") |
486 | 485 | $dir = substr($dir, 1); |
@@ -506,7 +505,7 @@ discard block |
||
506 | 505 | return (is_dir($path) && is_readable($path)) ? $return : false; |
507 | 506 | } |
508 | 507 | |
509 | - protected function validateExtension($ext, $type) { |
|
508 | + protected function validateExtension($ext, $type){ |
|
510 | 509 | $ext = trim(strtolower($ext)); |
511 | 510 | if (!isset($this->types[$type])) |
512 | 511 | return false; |
@@ -531,17 +530,17 @@ discard block |
||
531 | 530 | return in_array($ext, $exts); |
532 | 531 | } |
533 | 532 | |
534 | - protected function getTypeFromPath($path) { |
|
533 | + protected function getTypeFromPath($path){ |
|
535 | 534 | return preg_match('/^([^\/]*)\/.*$/', $path, $patt) |
536 | 535 | ? $patt[1] : $path; |
537 | 536 | } |
538 | 537 | |
539 | - protected function removeTypeFromPath($path) { |
|
538 | + protected function removeTypeFromPath($path){ |
|
540 | 539 | return preg_match('/^[^\/]*\/(.*)$/', $path, $patt) |
541 | 540 | ? $patt[1] : ""; |
542 | 541 | } |
543 | 542 | |
544 | - protected function imageResize($image, $file=null) { |
|
543 | + protected function imageResize($image, $file = null){ |
|
545 | 544 | |
546 | 545 | if (!($image instanceof image)) { |
547 | 546 | $img = image::factory($this->imageDriver, $image); |
@@ -629,24 +628,24 @@ discard block |
||
629 | 628 | $img->watermark($this->config['watermark']['file'], $left, $top); |
630 | 629 | } |
631 | 630 | |
632 | - $options = array( 'file' => $file ); |
|
631 | + $options = array('file' => $file); |
|
633 | 632 | |
634 | - $type = exif_imagetype( $file ); |
|
633 | + $type = exif_imagetype($file); |
|
635 | 634 | |
636 | - switch ( $type ) { |
|
635 | + switch ($type) { |
|
637 | 636 | case IMAGETYPE_GIF: |
638 | - return $img->output( 'gif', $options ); |
|
637 | + return $img->output('gif', $options); |
|
639 | 638 | |
640 | 639 | case IMAGETYPE_PNG: |
641 | - return $img->output( 'png', $options ); |
|
640 | + return $img->output('png', $options); |
|
642 | 641 | |
643 | 642 | default: |
644 | - return $img->output( 'jpeg', array_merge( $options, array( 'quality' => $this->config['jpegQuality'] ) ) ); |
|
643 | + return $img->output('jpeg', array_merge($options, array('quality' => $this->config['jpegQuality']))); |
|
645 | 644 | } |
646 | 645 | |
647 | 646 | } |
648 | 647 | |
649 | - protected function makeThumb($file, $overwrite=true) { |
|
648 | + protected function makeThumb($file, $overwrite = true){ |
|
650 | 649 | $img = image::factory($this->imageDriver, $file); |
651 | 650 | |
652 | 651 | // Drop files which are not images |
@@ -654,7 +653,7 @@ discard block |
||
654 | 653 | return true; |
655 | 654 | |
656 | 655 | $thumb = substr($file, strlen($this->config['uploadDir'])); |
657 | - $thumb = $this->config['uploadDir'] . "/" . $this->config['thumbsDir'] . "/" . $thumb; |
|
656 | + $thumb = $this->config['uploadDir']."/".$this->config['thumbsDir']."/".$thumb; |
|
658 | 657 | $thumb = path::normalize($thumb); |
659 | 658 | $thumbDir = dirname($thumb); |
660 | 659 | if (!is_dir($thumbDir) && !@mkdir($thumbDir, $this->config['dirPerms'], true)) |
@@ -677,15 +676,15 @@ discard block |
||
677 | 676 | if (!$img->resizeFit($this->config['thumbWidth'], $this->config['thumbHeight'])) |
678 | 677 | return false; |
679 | 678 | |
680 | - if ( $this->imageDriver == 'gd' ) { |
|
681 | - $width = imagesx( $img->image ); |
|
682 | - $height = imagesy( $img->image ); |
|
683 | - $back = image::factory( $this->imageDriver, array( $width, $height ) ); |
|
684 | - $tile = image::factory( $this->imageDriver, __DIR__ . '/../themes/' . $this->config['theme'] . '/img/bg_transparent.png' ); |
|
679 | + if ($this->imageDriver == 'gd') { |
|
680 | + $width = imagesx($img->image); |
|
681 | + $height = imagesy($img->image); |
|
682 | + $back = image::factory($this->imageDriver, array($width, $height)); |
|
683 | + $tile = image::factory($this->imageDriver, __DIR__.'/../themes/'.$this->config['theme'].'/img/bg_transparent.png'); |
|
685 | 684 | |
686 | - imagesettile( $back->image, $tile->image ); |
|
687 | - imagefilledrectangle( $back->image, 0, 0, $width, $height, IMG_COLOR_TILED ); |
|
688 | - imagecopy( $back->image, $img->image, 0, 0, 0, 0, $width, $height ); |
|
685 | + imagesettile($back->image, $tile->image); |
|
686 | + imagefilledrectangle($back->image, 0, 0, $width, $height, IMG_COLOR_TILED); |
|
687 | + imagecopy($back->image, $img->image, 0, 0, 0, 0, $width, $height); |
|
689 | 688 | |
690 | 689 | $img = $back; |
691 | 690 | } |
@@ -697,7 +696,7 @@ discard block |
||
697 | 696 | )); |
698 | 697 | } |
699 | 698 | |
700 | - protected function localize($langCode) { |
|
699 | + protected function localize($langCode){ |
|
701 | 700 | require "lang/{$langCode}.php"; |
702 | 701 | setlocale(LC_ALL, $lang['_locale']); |
703 | 702 | $this->charset = $lang['_charset']; |
@@ -712,7 +711,7 @@ discard block |
||
712 | 711 | $this->labels = $lang; |
713 | 712 | } |
714 | 713 | |
715 | - protected function label($string, array $data=null) { |
|
714 | + protected function label($string, array $data = null){ |
|
716 | 715 | $return = isset($this->labels[$string]) ? $this->labels[$string] : $string; |
717 | 716 | if (is_array($data)) |
718 | 717 | foreach ($data as $key => $val) |
@@ -720,7 +719,7 @@ discard block |
||
720 | 719 | return $return; |
721 | 720 | } |
722 | 721 | |
723 | - protected function backMsg($message, array $data=null) { |
|
722 | + protected function backMsg($message, array $data = null){ |
|
724 | 723 | $message = $this->label($message, $data); |
725 | 724 | if (isset($this->file['tmp_name']) && file_exists($this->file['tmp_name'])) |
726 | 725 | @unlink($this->file['tmp_name']); |
@@ -728,7 +727,7 @@ discard block |
||
728 | 727 | die; |
729 | 728 | } |
730 | 729 | |
731 | - protected function callBack($url, $message="") { |
|
730 | + protected function callBack($url, $message = ""){ |
|
732 | 731 | $message = text::jsValue($message); |
733 | 732 | $CKfuncNum = isset($this->opener['CKEditor']['funcNum']) |
734 | 733 | ? $this->opener['CKEditor']['funcNum'] : 0; |
@@ -769,7 +768,7 @@ discard block |
||
769 | 768 | |
770 | 769 | } |
771 | 770 | |
772 | - protected function get_htaccess() { |
|
771 | + protected function get_htaccess(){ |
|
773 | 772 | return "<IfModule mod_php4.c> |
774 | 773 | php_value engine off |
775 | 774 | </IfModule> |
@@ -376,10 +376,10 @@ |
||
376 | 376 | if ($properties = $modx->getDatabase()->getValue($res)) { |
377 | 377 | $properties = $modx->parseProperties($properties, 'TransAlias', 'plugin'); |
378 | 378 | } else { |
379 | - $properties = NULL; |
|
379 | + $properties = null; |
|
380 | 380 | } |
381 | 381 | } else { |
382 | - $properties = NULL; |
|
382 | + $properties = null; |
|
383 | 383 | } |
384 | 384 | return $properties; |
385 | 385 | } |
@@ -7,11 +7,11 @@ discard block |
||
7 | 7 | |
8 | 8 | $modx->getDatabase()->connect(); |
9 | 9 | |
10 | -if (empty ($modx->config)) { |
|
10 | +if (empty ($modx->config)) { |
|
11 | 11 | $modx->getSettings(); |
12 | 12 | } |
13 | 13 | |
14 | -if (!isset($_SESSION['mgrValidated']) || !isset($_SERVER['HTTP_X_REQUESTED_WITH']) || (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') || ($_SERVER['REQUEST_METHOD'] != 'POST')) { |
|
14 | +if (!isset($_SESSION['mgrValidated']) || !isset($_SERVER['HTTP_X_REQUESTED_WITH']) || (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') || ($_SERVER['REQUEST_METHOD'] != 'POST')) { |
|
15 | 15 | $modx->sendErrorPage(); |
16 | 16 | } |
17 | 17 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | $_lang = array(); |
22 | 22 | include_once MODX_MANAGER_PATH . '/includes/lang/english.inc.php'; |
23 | -if ($modx->config['manager_language'] != 'english') { |
|
23 | +if ($modx->config['manager_language'] != 'english') { |
|
24 | 24 | include_once MODX_MANAGER_PATH . '/includes/lang/' . $modx->config['manager_language'] . '.inc.php'; |
25 | 25 | } |
26 | 26 | include_once MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/style.php'; |
@@ -33,12 +33,12 @@ discard block |
||
33 | 33 | // set limit sql query |
34 | 34 | $limit = !empty($modx->config['number_of_results']) ? (int) $modx->config['number_of_results'] : 100; |
35 | 35 | |
36 | -if (isset($action)) { |
|
37 | - switch ($action) { |
|
36 | +if (isset($action)) { |
|
37 | + switch ($action) { |
|
38 | 38 | |
39 | 39 | case '1': { |
40 | 40 | |
41 | - switch ($frame) { |
|
41 | + switch ($frame) { |
|
42 | 42 | case 'nodes': |
43 | 43 | include_once MODX_MANAGER_PATH . '/frames/nodes.php'; |
44 | 44 | |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | |
53 | 53 | $elements = isset($_REQUEST['elements']) && is_scalar($_REQUEST['elements']) ? htmlentities($_REQUEST['elements']) : ''; |
54 | 54 | |
55 | - if ($elements) { |
|
55 | + if ($elements) { |
|
56 | 56 | $output = ''; |
57 | 57 | $items = ''; |
58 | 58 | $sql = ''; |
@@ -61,7 +61,7 @@ discard block |
||
61 | 61 | $sqlLike = $filter ? 'WHERE t1.name LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : ''; |
62 | 62 | $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
63 | 63 | |
64 | - switch ($elements) { |
|
64 | + switch ($elements) { |
|
65 | 65 | case 'element_templates': |
66 | 66 | $a = 16; |
67 | 67 | $sqlLike = $filter ? 'WHERE t1.templatename LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : ''; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | ORDER BY t1.templatename ASC |
72 | 72 | ' . $sqlLimit); |
73 | 73 | |
74 | - if ($modx->hasPermission('new_template')) { |
|
74 | + if ($modx->hasPermission('new_template')) { |
|
75 | 75 | $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>' . $_lang['new_template'] . '</a></li>'; |
76 | 76 | } |
77 | 77 | |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | ORDER BY t1.name ASC |
88 | 88 | ' . $sqlLimit); |
89 | 89 | |
90 | - if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
90 | + if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
91 | 91 | $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>' . $_lang['new_tmplvars'] . '</a></li>'; |
92 | 92 | } |
93 | 93 | |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | ORDER BY t1.name ASC |
102 | 102 | ' . $sqlLimit); |
103 | 103 | |
104 | - if ($modx->hasPermission('new_chunk')) { |
|
104 | + if ($modx->hasPermission('new_chunk')) { |
|
105 | 105 | $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>' . $_lang['new_htmlsnippet'] . '</a></li>'; |
106 | 106 | } |
107 | 107 | |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | ORDER BY t1.name ASC |
116 | 116 | ' . $sqlLimit); |
117 | 117 | |
118 | - if ($modx->hasPermission('new_snippet')) { |
|
118 | + if ($modx->hasPermission('new_snippet')) { |
|
119 | 119 | $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>' . $_lang['new_snippet'] . '</a></li>'; |
120 | 120 | } |
121 | 121 | |
@@ -129,19 +129,19 @@ discard block |
||
129 | 129 | ORDER BY t1.name ASC |
130 | 130 | ' . $sqlLimit); |
131 | 131 | |
132 | - if ($modx->hasPermission('new_plugin')) { |
|
132 | + if ($modx->hasPermission('new_plugin')) { |
|
133 | 133 | $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>' . $_lang['new_plugin'] . '</a></li>'; |
134 | 134 | } |
135 | 135 | |
136 | 136 | break; |
137 | 137 | } |
138 | 138 | |
139 | - if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
|
140 | - if ($count == $limit) { |
|
139 | + if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
|
140 | + if ($count == $limit) { |
|
141 | 141 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
142 | 142 | } |
143 | - while ($row = $modx->getDatabase()->getRow($sql)) { |
|
144 | - if (($row['disabled'] || $row['locked']) && $role != 1) { |
|
143 | + while ($row = $modx->getDatabase()->getRow($sql)) { |
|
144 | + if (($row['disabled'] || $row['locked']) && $role != 1) { |
|
145 | 145 | continue; |
146 | 146 | } |
147 | 147 | |
@@ -149,9 +149,9 @@ discard block |
||
149 | 149 | } |
150 | 150 | } |
151 | 151 | |
152 | - if (isset($_REQUEST['filter'])) { |
|
152 | + if (isset($_REQUEST['filter'])) { |
|
153 | 153 | $output = $items; |
154 | - } else { |
|
154 | + } else { |
|
155 | 155 | $output .= $items; |
156 | 156 | } |
157 | 157 | |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : ''; |
170 | 170 | $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
171 | 171 | |
172 | - if(!$modx->hasPermission('save_role')) { |
|
172 | + if(!$modx->hasPermission('save_role')) { |
|
173 | 173 | $sqlLike .= $sqlLike ? ' AND ' : 'WHERE '; |
174 | 174 | $sqlLike .= 't2.role != 1'; |
175 | 175 | } |
@@ -181,22 +181,22 @@ discard block |
||
181 | 181 | ORDER BY t1.username ASC |
182 | 182 | ' . $sqlLimit); |
183 | 183 | |
184 | - if ($modx->hasPermission('new_user')) { |
|
184 | + if ($modx->hasPermission('new_user')) { |
|
185 | 185 | $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>' . $_lang['new_user'] . '</a></li>'; |
186 | 186 | } |
187 | 187 | |
188 | - if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
|
189 | - if ($count == $limit) { |
|
188 | + if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
|
189 | + if ($count == $limit) { |
|
190 | 190 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
191 | 191 | } |
192 | - while ($row = $modx->getDatabase()->getRow($sql)) { |
|
192 | + while ($row = $modx->getDatabase()->getRow($sql)) { |
|
193 | 193 | $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>'; |
194 | 194 | } |
195 | 195 | } |
196 | 196 | |
197 | - if (isset($_REQUEST['filter'])) { |
|
197 | + if (isset($_REQUEST['filter'])) { |
|
198 | 198 | $output = $items; |
199 | - } else { |
|
199 | + } else { |
|
200 | 200 | $output .= $items; |
201 | 201 | } |
202 | 202 | |
@@ -220,22 +220,22 @@ discard block |
||
220 | 220 | ORDER BY t1.username ASC |
221 | 221 | ' . $sqlLimit); |
222 | 222 | |
223 | - if ($modx->hasPermission('new_web_user')) { |
|
223 | + if ($modx->hasPermission('new_web_user')) { |
|
224 | 224 | $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>' . $_lang['new_web_user'] . '</a></li>'; |
225 | 225 | } |
226 | 226 | |
227 | - if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
|
228 | - if ($count == $limit) { |
|
227 | + if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
|
228 | + if ($count == $limit) { |
|
229 | 229 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
230 | 230 | } |
231 | - while ($row = $modx->getDatabase()->getRow($sql)) { |
|
231 | + while ($row = $modx->getDatabase()->getRow($sql)) { |
|
232 | 232 | $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>'; |
233 | 233 | } |
234 | 234 | } |
235 | 235 | |
236 | - if (isset($_REQUEST['filter'])) { |
|
236 | + if (isset($_REQUEST['filter'])) { |
|
237 | 237 | $output = $items; |
238 | - } else { |
|
238 | + } else { |
|
239 | 239 | $output .= $items; |
240 | 240 | } |
241 | 241 | |
@@ -249,8 +249,8 @@ discard block |
||
249 | 249 | $type = isset($_REQUEST['type']) && is_scalar($_REQUEST['type']) ? $modx->getDatabase()->escape($_REQUEST['type']) : false; |
250 | 250 | $contextmenu = ''; |
251 | 251 | |
252 | - if ($role && $name && $type) { |
|
253 | - switch ($type) { |
|
252 | + if ($role && $name && $type) { |
|
253 | + switch ($type) { |
|
254 | 254 | case 'Snippet': |
255 | 255 | case 'SnippetNoCache': { |
256 | 256 | |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | WHERE name="' . $name . '" |
260 | 260 | LIMIT 1'); |
261 | 261 | |
262 | - if ($modx->getDatabase()->getRecordCount($sql)) { |
|
262 | + if ($modx->getDatabase()->getRecordCount($sql)) { |
|
263 | 263 | $row = $modx->getDatabase()->getRow($sql); |
264 | 264 | $contextmenu = array( |
265 | 265 | 'header' => array( |
@@ -270,13 +270,13 @@ discard block |
||
270 | 270 | 'url' => "index.php?a=22&id=" . $row['id'] |
271 | 271 | ) |
272 | 272 | ); |
273 | - if (!empty($row['description'])) { |
|
273 | + if (!empty($row['description'])) { |
|
274 | 274 | $contextmenu['seperator'] = ''; |
275 | 275 | $contextmenu['description'] = array( |
276 | 276 | 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
277 | 277 | ); |
278 | 278 | } |
279 | - } else { |
|
279 | + } else { |
|
280 | 280 | $contextmenu = array( |
281 | 281 | 'header' => array( |
282 | 282 | 'innerHTML' => '<i class="fa fa-code"></i> ' . $name |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | WHERE name="' . $name . '" |
298 | 298 | LIMIT 1'); |
299 | 299 | |
300 | - if ($modx->getDatabase()->getRecordCount($sql)) { |
|
300 | + if ($modx->getDatabase()->getRecordCount($sql)) { |
|
301 | 301 | $row = $modx->getDatabase()->getRow($sql); |
302 | 302 | $contextmenu = array( |
303 | 303 | 'header' => array( |
@@ -308,13 +308,13 @@ discard block |
||
308 | 308 | 'url' => "index.php?a=78&id=" . $row['id'] |
309 | 309 | ) |
310 | 310 | ); |
311 | - if (!empty($row['description'])) { |
|
311 | + if (!empty($row['description'])) { |
|
312 | 312 | $contextmenu['seperator'] = ''; |
313 | 313 | $contextmenu['description'] = array( |
314 | 314 | 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
315 | 315 | ); |
316 | 316 | } |
317 | - } else { |
|
317 | + } else { |
|
318 | 318 | $contextmenu = array( |
319 | 319 | 'header' => array( |
320 | 320 | 'innerHTML' => '<i class="fa fa-th-large"></i> ' . $name |
@@ -334,7 +334,7 @@ discard block |
||
334 | 334 | WHERE name="' . $name . '" |
335 | 335 | LIMIT 1'); |
336 | 336 | |
337 | - if ($modx->getDatabase()->getRecordCount($sql)) { |
|
337 | + if ($modx->getDatabase()->getRecordCount($sql)) { |
|
338 | 338 | $row = $modx->getDatabase()->getRow($sql); |
339 | 339 | $contextmenu = array( |
340 | 340 | 'header' => array( |
@@ -345,20 +345,20 @@ discard block |
||
345 | 345 | 'url' => "index.php?a=78&id=" . $row['id'] |
346 | 346 | ) |
347 | 347 | ); |
348 | - if (!empty($row['description'])) { |
|
348 | + if (!empty($row['description'])) { |
|
349 | 349 | $contextmenu['seperator'] = ''; |
350 | 350 | $contextmenu['description'] = array( |
351 | 351 | 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
352 | 352 | ); |
353 | 353 | } |
354 | - } else { |
|
354 | + } else { |
|
355 | 355 | |
356 | 356 | $sql = $modx->getDatabase()->query('SELECT * |
357 | 357 | FROM ' . $modx->getFullTableName('site_snippets') . ' |
358 | 358 | WHERE name="' . $name . '" |
359 | 359 | LIMIT 1'); |
360 | 360 | |
361 | - if ($modx->getDatabase()->getRecordCount($sql)) { |
|
361 | + if ($modx->getDatabase()->getRecordCount($sql)) { |
|
362 | 362 | $row = $modx->getDatabase()->getRow($sql); |
363 | 363 | $contextmenu = array( |
364 | 364 | 'header' => array( |
@@ -369,13 +369,13 @@ discard block |
||
369 | 369 | 'url' => "index.php?a=22&id=" . $row['id'] |
370 | 370 | ) |
371 | 371 | ); |
372 | - if (!empty($row['description'])) { |
|
372 | + if (!empty($row['description'])) { |
|
373 | 373 | $contextmenu['seperator'] = ''; |
374 | 374 | $contextmenu['description'] = array( |
375 | 375 | 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
376 | 376 | ); |
377 | 377 | } |
378 | - } else { |
|
378 | + } else { |
|
379 | 379 | $contextmenu = array( |
380 | 380 | 'header' => array( |
381 | 381 | 'innerHTML' => '<i class="fa fa-code"></i> ' . $name |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | 'alias_visible' |
438 | 438 | ); |
439 | 439 | |
440 | - if (in_array($name, $default_field)) { |
|
440 | + if (in_array($name, $default_field)) { |
|
441 | 441 | return; |
442 | 442 | } |
443 | 443 | |
@@ -446,7 +446,7 @@ discard block |
||
446 | 446 | WHERE name="' . $name . '" |
447 | 447 | LIMIT 1'); |
448 | 448 | |
449 | - if ($modx->getDatabase()->getRecordCount($sql)) { |
|
449 | + if ($modx->getDatabase()->getRecordCount($sql)) { |
|
450 | 450 | $row = $modx->getDatabase()->getRow($sql); |
451 | 451 | $contextmenu = array( |
452 | 452 | 'header' => array( |
@@ -457,13 +457,13 @@ discard block |
||
457 | 457 | 'url' => "index.php?a=301&id=" . $row['id'] |
458 | 458 | ) |
459 | 459 | ); |
460 | - if (!empty($row['description'])) { |
|
460 | + if (!empty($row['description'])) { |
|
461 | 461 | $contextmenu['seperator'] = ''; |
462 | 462 | $contextmenu['description'] = array( |
463 | 463 | 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
464 | 464 | ); |
465 | 465 | } |
466 | - } else { |
|
466 | + } else { |
|
467 | 467 | $contextmenu = array( |
468 | 468 | 'header' => array( |
469 | 469 | 'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $name |
@@ -488,13 +488,13 @@ discard block |
||
488 | 488 | case 'movedocument' : { |
489 | 489 | $json = array(); |
490 | 490 | |
491 | - if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
|
491 | + if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
|
492 | 492 | $id = !empty($_REQUEST['id']) ? (int)$_REQUEST['id'] : ''; |
493 | 493 | $parent = isset($_REQUEST['parent']) ? (int)$_REQUEST['parent'] : 0; |
494 | 494 | $menuindex = isset($_REQUEST['menuindex']) && is_scalar($_REQUEST['menuindex']) ? $_REQUEST['menuindex'] : 0; |
495 | 495 | |
496 | 496 | // set parent |
497 | - if ($id && $parent >= 0) { |
|
497 | + if ($id && $parent >= 0) { |
|
498 | 498 | |
499 | 499 | // find older parent |
500 | 500 | $parentOld = $modx->getDatabase()->getValue($modx->getDatabase()->select('parent', $modx->getFullTableName('site_content'), 'id=' . $id)); |
@@ -505,31 +505,31 @@ discard block |
||
505 | 505 | 'new_parent' => $parent, |
506 | 506 | ]); |
507 | 507 | |
508 | - if (is_array($eventOut) && count($eventOut) > 0) { |
|
508 | + if (is_array($eventOut) && count($eventOut) > 0) { |
|
509 | 509 | $eventParent = array_pop($eventOut); |
510 | 510 | |
511 | - if ($eventParent == $parentOld) { |
|
511 | + if ($eventParent == $parentOld) { |
|
512 | 512 | $json['errors'] = $_lang['error_movedocument2']; |
513 | - } else { |
|
513 | + } else { |
|
514 | 514 | $parent = $eventParent; |
515 | 515 | } |
516 | 516 | } |
517 | 517 | |
518 | - if (empty($json['errors'])) { |
|
518 | + if (empty($json['errors'])) { |
|
519 | 519 | // check privileges user for move docs |
520 | - if (!empty($modx->config['tree_show_protected']) && $role != 1) { |
|
520 | + if (!empty($modx->config['tree_show_protected']) && $role != 1) { |
|
521 | 521 | $sql = $modx->getDatabase()->select('*', $modx->getFullTableName('document_groups'), 'document IN(' . $id . ',' . $parent . ',' . $parentOld . ')'); |
522 | - if ($modx->getDatabase()->getRecordCount($sql)) { |
|
522 | + if ($modx->getDatabase()->getRecordCount($sql)) { |
|
523 | 523 | $document_groups = array(); |
524 | - while ($row = $modx->getDatabase()->getRow($sql)) { |
|
524 | + while ($row = $modx->getDatabase()->getRow($sql)) { |
|
525 | 525 | $document_groups[$row['document']]['groups'][] = $row['document_group']; |
526 | 526 | } |
527 | - foreach ($document_groups as $key => $value) { |
|
528 | - if (($key == $parent || $key == $parentOld || $key == $id) && !in_array($role, $value['groups'])) { |
|
527 | + foreach ($document_groups as $key => $value) { |
|
528 | + if (($key == $parent || $key == $parentOld || $key == $id) && !in_array($role, $value['groups'])) { |
|
529 | 529 | $json['errors'] = $_lang["error_no_privileges"]; |
530 | 530 | } |
531 | 531 | } |
532 | - if ($json['errors']) { |
|
532 | + if ($json['errors']) { |
|
533 | 533 | header('content-type: application/json'); |
534 | 534 | echo json_encode($json, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE); |
535 | 535 | break; |
@@ -537,9 +537,9 @@ discard block |
||
537 | 537 | } |
538 | 538 | } |
539 | 539 | |
540 | - if ($parent == 0 && $parent != $parentOld && !$modx->config['udperms_allowroot'] && $role != 1) { |
|
540 | + if ($parent == 0 && $parent != $parentOld && !$modx->config['udperms_allowroot'] && $role != 1) { |
|
541 | 541 | $json['errors'] = $_lang["error_no_privileges"]; |
542 | - } else { |
|
542 | + } else { |
|
543 | 543 | // set new parent |
544 | 544 | $modx->getDatabase()->update(array( |
545 | 545 | 'parent' => $parent |
@@ -549,13 +549,13 @@ discard block |
||
549 | 549 | 'isfolder' => 1 |
550 | 550 | ), $modx->getFullTableName('site_content'), 'id=' . $parent); |
551 | 551 | |
552 | - if ($parent != $parentOld) { |
|
552 | + if ($parent != $parentOld) { |
|
553 | 553 | // check children docs and set parent isfolder |
554 | - if ($modx->getDatabase()->getRecordCount($modx->getDatabase()->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) { |
|
554 | + if ($modx->getDatabase()->getRecordCount($modx->getDatabase()->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) { |
|
555 | 555 | $modx->getDatabase()->update(array( |
556 | 556 | 'isfolder' => 1 |
557 | 557 | ), $modx->getFullTableName('site_content'), 'id=' . $parentOld); |
558 | - } else { |
|
558 | + } else { |
|
559 | 559 | $modx->getDatabase()->update(array( |
560 | 560 | 'isfolder' => 0 |
561 | 561 | ), $modx->getFullTableName('site_content'), 'id=' . $parentOld); |
@@ -563,16 +563,16 @@ discard block |
||
563 | 563 | } |
564 | 564 | |
565 | 565 | // set menuindex |
566 | - if (!empty($menuindex)) { |
|
566 | + if (!empty($menuindex)) { |
|
567 | 567 | $menuindex = explode(',', $menuindex); |
568 | - foreach ($menuindex as $key => $value) { |
|
568 | + foreach ($menuindex as $key => $value) { |
|
569 | 569 | $modx->getDatabase()->query('UPDATE ' . $modx->getFullTableName('site_content') . ' SET menuindex=' . $key . ' WHERE id=' . $value); |
570 | 570 | } |
571 | - } else { |
|
571 | + } else { |
|
572 | 572 | // TODO: max(*) menuindex |
573 | 573 | } |
574 | 574 | |
575 | - if (!$json['errors']) { |
|
575 | + if (!$json['errors']) { |
|
576 | 576 | $json['success'] = $_lang["actioncomplete"]; |
577 | 577 | |
578 | 578 | $modx->invokeEvent('onAfterMoveDocument', [ |
@@ -584,7 +584,7 @@ discard block |
||
584 | 584 | } |
585 | 585 | } |
586 | 586 | } |
587 | - } else { |
|
587 | + } else { |
|
588 | 588 | $json['errors'] = $_lang["error_no_privileges"]; |
589 | 589 | } |
590 | 590 | |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | |
601 | 601 | $output = !!$modx->elementIsLocked($type, $id, true); |
602 | 602 | |
603 | - if (!$output) { |
|
603 | + if (!$output) { |
|
604 | 604 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
605 | 605 | $docgrp_cond = $docgrp ? ' OR dg.document_group IN (' . $docgrp . ')' : ''; |
606 | 606 | $sql = ' |
@@ -609,7 +609,7 @@ discard block |
||
609 | 609 | LEFT JOIN ' . $modx->getFullTableName('document_groups') . ' dg ON dg.document=sc.id |
610 | 610 | WHERE sc.id=' . $id . ' GROUP BY sc.id'; |
611 | 611 | $sql = $modx->getDatabase()->query($sql); |
612 | - if ($modx->getDatabase()->getRecordCount($sql)) { |
|
612 | + if ($modx->getDatabase()->getRecordCount($sql)) { |
|
613 | 613 | $row = $modx->getDatabase()->getRow($sql); |
614 | 614 | $output = !!$row['locked']; |
615 | 615 | } |
@@ -18,11 +18,11 @@ discard block |
||
18 | 18 | $modx->sid = session_id(); |
19 | 19 | |
20 | 20 | $_lang = array(); |
21 | -include_once MODX_MANAGER_PATH . '/includes/lang/english.inc.php'; |
|
21 | +include_once MODX_MANAGER_PATH.'/includes/lang/english.inc.php'; |
|
22 | 22 | if ($modx->config['manager_language'] != 'english') { |
23 | - include_once MODX_MANAGER_PATH . '/includes/lang/' . $modx->config['manager_language'] . '.inc.php'; |
|
23 | + include_once MODX_MANAGER_PATH.'/includes/lang/'.$modx->config['manager_language'].'.inc.php'; |
|
24 | 24 | } |
25 | -include_once MODX_MANAGER_PATH . '/media/style/' . $modx->config['manager_theme'] . '/style.php'; |
|
25 | +include_once MODX_MANAGER_PATH.'/media/style/'.$modx->config['manager_theme'].'/style.php'; |
|
26 | 26 | |
27 | 27 | $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : ''; |
28 | 28 | $frame = isset($_REQUEST['f']) ? $_REQUEST['f'] : ''; |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | |
40 | 40 | switch ($frame) { |
41 | 41 | case 'nodes': |
42 | - include_once MODX_MANAGER_PATH . '/frames/nodes.php'; |
|
42 | + include_once MODX_MANAGER_PATH.'/frames/nodes.php'; |
|
43 | 43 | |
44 | 44 | break; |
45 | 45 | } |
@@ -57,21 +57,21 @@ discard block |
||
57 | 57 | $sql = ''; |
58 | 58 | $a = ''; |
59 | 59 | $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '%*_') : ''; |
60 | - $sqlLike = $filter ? 'WHERE t1.name LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : ''; |
|
61 | - $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
|
60 | + $sqlLike = $filter ? 'WHERE t1.name LIKE "'.$modx->getDatabase()->escape($filter).'%"' : ''; |
|
61 | + $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit; |
|
62 | 62 | |
63 | 63 | switch ($elements) { |
64 | 64 | case 'element_templates': |
65 | 65 | $a = 16; |
66 | - $sqlLike = $filter ? 'WHERE t1.templatename LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : ''; |
|
66 | + $sqlLike = $filter ? 'WHERE t1.templatename LIKE "'.$modx->getDatabase()->escape($filter).'%"' : ''; |
|
67 | 67 | $sql = $modx->getDatabase()->query('SELECT t1.id, t1.templatename AS name, t1.locked, 0 AS disabled |
68 | - FROM ' . $modx->getFullTableName('site_templates') . ' AS t1 |
|
69 | - ' . $sqlLike . ' |
|
68 | + FROM ' . $modx->getFullTableName('site_templates').' AS t1 |
|
69 | + ' . $sqlLike.' |
|
70 | 70 | ORDER BY t1.templatename ASC |
71 | 71 | ' . $sqlLimit); |
72 | 72 | |
73 | 73 | if ($modx->hasPermission('new_template')) { |
74 | - $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>' . $_lang['new_template'] . '</a></li>'; |
|
74 | + $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>'.$_lang['new_template'].'</a></li>'; |
|
75 | 75 | } |
76 | 76 | |
77 | 77 | break; |
@@ -79,15 +79,15 @@ discard block |
||
79 | 79 | case 'element_tplvars': |
80 | 80 | $a = 301; |
81 | 81 | $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, IF(MIN(t2.tmplvarid),0,1) AS disabled |
82 | - FROM ' . $modx->getFullTableName('site_tmplvars') . ' AS t1 |
|
83 | - LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates') . ' AS t2 ON t1.id=t2.tmplvarid |
|
84 | - ' . $sqlLike . ' |
|
82 | + FROM ' . $modx->getFullTableName('site_tmplvars').' AS t1 |
|
83 | + LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates').' AS t2 ON t1.id=t2.tmplvarid |
|
84 | + ' . $sqlLike.' |
|
85 | 85 | GROUP BY t1.id |
86 | 86 | ORDER BY t1.name ASC |
87 | 87 | ' . $sqlLimit); |
88 | 88 | |
89 | 89 | if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
90 | - $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>' . $_lang['new_tmplvars'] . '</a></li>'; |
|
90 | + $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>'.$_lang['new_tmplvars'].'</a></li>'; |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | break; |
@@ -95,13 +95,13 @@ discard block |
||
95 | 95 | case 'element_htmlsnippets': |
96 | 96 | $a = 78; |
97 | 97 | $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, t1.disabled |
98 | - FROM ' . $modx->getFullTableName('site_htmlsnippets') . ' AS t1 |
|
99 | - ' . $sqlLike . ' |
|
98 | + FROM ' . $modx->getFullTableName('site_htmlsnippets').' AS t1 |
|
99 | + ' . $sqlLike.' |
|
100 | 100 | ORDER BY t1.name ASC |
101 | 101 | ' . $sqlLimit); |
102 | 102 | |
103 | 103 | if ($modx->hasPermission('new_chunk')) { |
104 | - $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>' . $_lang['new_htmlsnippet'] . '</a></li>'; |
|
104 | + $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>'.$_lang['new_htmlsnippet'].'</a></li>'; |
|
105 | 105 | } |
106 | 106 | |
107 | 107 | break; |
@@ -109,13 +109,13 @@ discard block |
||
109 | 109 | case 'element_snippets': |
110 | 110 | $a = 22; |
111 | 111 | $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, t1.disabled |
112 | - FROM ' . $modx->getFullTableName('site_snippets') . ' AS t1 |
|
113 | - ' . $sqlLike . ' |
|
112 | + FROM ' . $modx->getFullTableName('site_snippets').' AS t1 |
|
113 | + ' . $sqlLike.' |
|
114 | 114 | ORDER BY t1.name ASC |
115 | 115 | ' . $sqlLimit); |
116 | 116 | |
117 | 117 | if ($modx->hasPermission('new_snippet')) { |
118 | - $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>' . $_lang['new_snippet'] . '</a></li>'; |
|
118 | + $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>'.$_lang['new_snippet'].'</a></li>'; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | break; |
@@ -123,13 +123,13 @@ discard block |
||
123 | 123 | case 'element_plugins': |
124 | 124 | $a = 102; |
125 | 125 | $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, t1.disabled |
126 | - FROM ' . $modx->getFullTableName('site_plugins') . ' AS t1 |
|
127 | - ' . $sqlLike . ' |
|
126 | + FROM ' . $modx->getFullTableName('site_plugins').' AS t1 |
|
127 | + ' . $sqlLike.' |
|
128 | 128 | ORDER BY t1.name ASC |
129 | 129 | ' . $sqlLimit); |
130 | 130 | |
131 | 131 | if ($modx->hasPermission('new_plugin')) { |
132 | - $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>' . $_lang['new_plugin'] . '</a></li>'; |
|
132 | + $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>'.$_lang['new_plugin'].'</a></li>'; |
|
133 | 133 | } |
134 | 134 | |
135 | 135 | break; |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | continue; |
145 | 145 | } |
146 | 146 | |
147 | - $items .= '<li class="item ' . ($row['disabled'] ? 'disabled' : '') . ($row['locked'] ? ' locked' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main" data-parent-id="a_76__elements_' . $elements . '">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>' . "\n"; |
|
147 | + $items .= '<li class="item '.($row['disabled'] ? 'disabled' : '').($row['locked'] ? ' locked' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main" data-parent-id="a_76__elements_'.$elements.'">'.$row['name'].' <small>('.$row['id'].')</small></a></li>'."\n"; |
|
148 | 148 | } |
149 | 149 | } |
150 | 150 | |
@@ -165,23 +165,23 @@ discard block |
||
165 | 165 | $output = ''; |
166 | 166 | $items = ''; |
167 | 167 | $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '\%*_') : ''; |
168 | - $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : ''; |
|
169 | - $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
|
168 | + $sqlLike = $filter ? 'WHERE t1.username LIKE "'.$modx->getDatabase()->escape($filter).'%"' : ''; |
|
169 | + $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit; |
|
170 | 170 | |
171 | - if(!$modx->hasPermission('save_role')) { |
|
171 | + if (!$modx->hasPermission('save_role')) { |
|
172 | 172 | $sqlLike .= $sqlLike ? ' AND ' : 'WHERE '; |
173 | 173 | $sqlLike .= 't2.role != 1'; |
174 | 174 | } |
175 | 175 | |
176 | 176 | $sql = $modx->getDatabase()->query('SELECT t1.*, t1.username AS name, t2.blocked |
177 | - FROM ' . $modx->getFullTableName('manager_users') . ' AS t1 |
|
178 | - LEFT JOIN ' . $modx->getFullTableName('user_attributes') . ' AS t2 ON t1.id=t2.internalKey |
|
179 | - ' . $sqlLike . ' |
|
177 | + FROM ' . $modx->getFullTableName('manager_users').' AS t1 |
|
178 | + LEFT JOIN ' . $modx->getFullTableName('user_attributes').' AS t2 ON t1.id=t2.internalKey |
|
179 | + ' . $sqlLike.' |
|
180 | 180 | ORDER BY t1.username ASC |
181 | 181 | ' . $sqlLimit); |
182 | 182 | |
183 | 183 | if ($modx->hasPermission('new_user')) { |
184 | - $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>' . $_lang['new_user'] . '</a></li>'; |
|
184 | + $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>'.$_lang['new_user'].'</a></li>'; |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
190 | 190 | } |
191 | 191 | while ($row = $modx->getDatabase()->getRow($sql)) { |
192 | - $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>'; |
|
192 | + $items .= '<li class="item '.($row['blocked'] ? 'disabled' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main">'.$row['name'].' <small>('.$row['id'].')</small></a></li>'; |
|
193 | 193 | } |
194 | 194 | } |
195 | 195 | |
@@ -209,18 +209,18 @@ discard block |
||
209 | 209 | $output = ''; |
210 | 210 | $items = ''; |
211 | 211 | $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '\%*_') : ''; |
212 | - $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : ''; |
|
213 | - $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
|
212 | + $sqlLike = $filter ? 'WHERE t1.username LIKE "'.$modx->getDatabase()->escape($filter).'%"' : ''; |
|
213 | + $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit; |
|
214 | 214 | |
215 | 215 | $sql = $modx->getDatabase()->query('SELECT t1.*, t1.username AS name, t2.blocked |
216 | - FROM ' . $modx->getFullTableName('web_users') . ' AS t1 |
|
217 | - LEFT JOIN ' . $modx->getFullTableName('web_user_attributes') . ' AS t2 ON t1.id=t2.internalKey |
|
218 | - ' . $sqlLike . ' |
|
216 | + FROM ' . $modx->getFullTableName('web_users').' AS t1 |
|
217 | + LEFT JOIN ' . $modx->getFullTableName('web_user_attributes').' AS t2 ON t1.id=t2.internalKey |
|
218 | + ' . $sqlLike.' |
|
219 | 219 | ORDER BY t1.username ASC |
220 | 220 | ' . $sqlLimit); |
221 | 221 | |
222 | 222 | if ($modx->hasPermission('new_web_user')) { |
223 | - $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>' . $_lang['new_web_user'] . '</a></li>'; |
|
223 | + $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>'.$_lang['new_web_user'].'</a></li>'; |
|
224 | 224 | } |
225 | 225 | |
226 | 226 | if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
229 | 229 | } |
230 | 230 | while ($row = $modx->getDatabase()->getRow($sql)) { |
231 | - $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . $row['name'] . ' <small>(' . $row['id'] . ')</small></a></li>'; |
|
231 | + $items .= '<li class="item '.($row['blocked'] ? 'disabled' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main">'.$row['name'].' <small>('.$row['id'].')</small></a></li>'; |
|
232 | 232 | } |
233 | 233 | } |
234 | 234 | |
@@ -254,35 +254,35 @@ discard block |
||
254 | 254 | case 'SnippetNoCache': { |
255 | 255 | |
256 | 256 | $sql = $modx->getDatabase()->query('SELECT * |
257 | - FROM ' . $modx->getFullTableName('site_snippets') . ' |
|
258 | - WHERE name="' . $name . '" |
|
257 | + FROM ' . $modx->getFullTableName('site_snippets').' |
|
258 | + WHERE name="' . $name.'" |
|
259 | 259 | LIMIT 1'); |
260 | 260 | |
261 | 261 | if ($modx->getDatabase()->getRecordCount($sql)) { |
262 | 262 | $row = $modx->getDatabase()->getRow($sql); |
263 | 263 | $contextmenu = array( |
264 | 264 | 'header' => array( |
265 | - 'innerHTML' => '<i class="fa fa-code"></i> ' . $row['name'] |
|
265 | + 'innerHTML' => '<i class="fa fa-code"></i> '.$row['name'] |
|
266 | 266 | ), |
267 | 267 | 'item' => array( |
268 | - 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'], |
|
269 | - 'url' => "index.php?a=22&id=" . $row['id'] |
|
268 | + 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'], |
|
269 | + 'url' => "index.php?a=22&id=".$row['id'] |
|
270 | 270 | ) |
271 | 271 | ); |
272 | 272 | if (!empty($row['description'])) { |
273 | 273 | $contextmenu['seperator'] = ''; |
274 | 274 | $contextmenu['description'] = array( |
275 | - 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
|
275 | + 'innerHTML' => '<i class="fa fa-info"></i> '.$row['description'] |
|
276 | 276 | ); |
277 | 277 | } |
278 | 278 | } else { |
279 | 279 | $contextmenu = array( |
280 | 280 | 'header' => array( |
281 | - 'innerHTML' => '<i class="fa fa-code"></i> ' . $name |
|
281 | + 'innerHTML' => '<i class="fa fa-code"></i> '.$name |
|
282 | 282 | ), |
283 | 283 | 'item' => array( |
284 | - 'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_snippet'], |
|
285 | - 'url' => "index.php?a=23&itemname=" . $name |
|
284 | + 'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_snippet'], |
|
285 | + 'url' => "index.php?a=23&itemname=".$name |
|
286 | 286 | ) |
287 | 287 | ); |
288 | 288 | } |
@@ -292,35 +292,35 @@ discard block |
||
292 | 292 | case 'Chunk' : { |
293 | 293 | |
294 | 294 | $sql = $modx->getDatabase()->query('SELECT * |
295 | - FROM ' . $modx->getFullTableName('site_htmlsnippets') . ' |
|
296 | - WHERE name="' . $name . '" |
|
295 | + FROM ' . $modx->getFullTableName('site_htmlsnippets').' |
|
296 | + WHERE name="' . $name.'" |
|
297 | 297 | LIMIT 1'); |
298 | 298 | |
299 | 299 | if ($modx->getDatabase()->getRecordCount($sql)) { |
300 | 300 | $row = $modx->getDatabase()->getRow($sql); |
301 | 301 | $contextmenu = array( |
302 | 302 | 'header' => array( |
303 | - 'innerHTML' => '<i class="fa fa-th-large"></i> ' . $row['name'] |
|
303 | + 'innerHTML' => '<i class="fa fa-th-large"></i> '.$row['name'] |
|
304 | 304 | ), |
305 | 305 | 'item' => array( |
306 | - 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'], |
|
307 | - 'url' => "index.php?a=78&id=" . $row['id'] |
|
306 | + 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'], |
|
307 | + 'url' => "index.php?a=78&id=".$row['id'] |
|
308 | 308 | ) |
309 | 309 | ); |
310 | 310 | if (!empty($row['description'])) { |
311 | 311 | $contextmenu['seperator'] = ''; |
312 | 312 | $contextmenu['description'] = array( |
313 | - 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
|
313 | + 'innerHTML' => '<i class="fa fa-info"></i> '.$row['description'] |
|
314 | 314 | ); |
315 | 315 | } |
316 | 316 | } else { |
317 | 317 | $contextmenu = array( |
318 | 318 | 'header' => array( |
319 | - 'innerHTML' => '<i class="fa fa-th-large"></i> ' . $name |
|
319 | + 'innerHTML' => '<i class="fa fa-th-large"></i> '.$name |
|
320 | 320 | ), |
321 | 321 | 'item' => array( |
322 | - 'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_htmlsnippet'], |
|
323 | - 'url' => "index.php?a=77&itemname=" . $name |
|
322 | + 'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_htmlsnippet'], |
|
323 | + 'url' => "index.php?a=77&itemname=".$name |
|
324 | 324 | ) |
325 | 325 | ); |
326 | 326 | } |
@@ -329,8 +329,8 @@ discard block |
||
329 | 329 | } |
330 | 330 | case 'AttributeValue': { |
331 | 331 | $sql = $modx->getDatabase()->query('SELECT * |
332 | - FROM ' . $modx->getFullTableName('site_htmlsnippets') . ' |
|
333 | - WHERE name="' . $name . '" |
|
332 | + FROM ' . $modx->getFullTableName('site_htmlsnippets').' |
|
333 | + WHERE name="' . $name.'" |
|
334 | 334 | LIMIT 1'); |
335 | 335 | |
336 | 336 | if ($modx->getDatabase()->getRecordCount($sql)) { |
@@ -340,52 +340,52 @@ discard block |
||
340 | 340 | 'innerText' => $row['name'] |
341 | 341 | ), |
342 | 342 | 'item' => array( |
343 | - 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'], |
|
344 | - 'url' => "index.php?a=78&id=" . $row['id'] |
|
343 | + 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'], |
|
344 | + 'url' => "index.php?a=78&id=".$row['id'] |
|
345 | 345 | ) |
346 | 346 | ); |
347 | 347 | if (!empty($row['description'])) { |
348 | 348 | $contextmenu['seperator'] = ''; |
349 | 349 | $contextmenu['description'] = array( |
350 | - 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
|
350 | + 'innerHTML' => '<i class="fa fa-info"></i> '.$row['description'] |
|
351 | 351 | ); |
352 | 352 | } |
353 | 353 | } else { |
354 | 354 | |
355 | 355 | $sql = $modx->getDatabase()->query('SELECT * |
356 | - FROM ' . $modx->getFullTableName('site_snippets') . ' |
|
357 | - WHERE name="' . $name . '" |
|
356 | + FROM ' . $modx->getFullTableName('site_snippets').' |
|
357 | + WHERE name="' . $name.'" |
|
358 | 358 | LIMIT 1'); |
359 | 359 | |
360 | 360 | if ($modx->getDatabase()->getRecordCount($sql)) { |
361 | 361 | $row = $modx->getDatabase()->getRow($sql); |
362 | 362 | $contextmenu = array( |
363 | 363 | 'header' => array( |
364 | - 'innerHTML' => '<i class="fa fa-code"></i> ' . $row['name'] |
|
364 | + 'innerHTML' => '<i class="fa fa-code"></i> '.$row['name'] |
|
365 | 365 | ), |
366 | 366 | 'item' => array( |
367 | - 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'], |
|
368 | - 'url' => "index.php?a=22&id=" . $row['id'] |
|
367 | + 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'], |
|
368 | + 'url' => "index.php?a=22&id=".$row['id'] |
|
369 | 369 | ) |
370 | 370 | ); |
371 | 371 | if (!empty($row['description'])) { |
372 | 372 | $contextmenu['seperator'] = ''; |
373 | 373 | $contextmenu['description'] = array( |
374 | - 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
|
374 | + 'innerHTML' => '<i class="fa fa-info"></i> '.$row['description'] |
|
375 | 375 | ); |
376 | 376 | } |
377 | 377 | } else { |
378 | 378 | $contextmenu = array( |
379 | 379 | 'header' => array( |
380 | - 'innerHTML' => '<i class="fa fa-code"></i> ' . $name |
|
380 | + 'innerHTML' => '<i class="fa fa-code"></i> '.$name |
|
381 | 381 | ), |
382 | 382 | 'item' => array( |
383 | - 'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_htmlsnippet'], |
|
384 | - 'url' => "index.php?a=77&itemname=" . $name |
|
383 | + 'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_htmlsnippet'], |
|
384 | + 'url' => "index.php?a=77&itemname=".$name |
|
385 | 385 | ), |
386 | 386 | 'item2' => array( |
387 | - 'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_snippet'], |
|
388 | - 'url' => "index.php?a=23&itemname=" . $name |
|
387 | + 'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_snippet'], |
|
388 | + 'url' => "index.php?a=23&itemname=".$name |
|
389 | 389 | ) |
390 | 390 | ); |
391 | 391 | } |
@@ -441,35 +441,35 @@ discard block |
||
441 | 441 | } |
442 | 442 | |
443 | 443 | $sql = $modx->getDatabase()->query('SELECT * |
444 | - FROM ' . $modx->getFullTableName('site_tmplvars') . ' |
|
445 | - WHERE name="' . $name . '" |
|
444 | + FROM ' . $modx->getFullTableName('site_tmplvars').' |
|
445 | + WHERE name="' . $name.'" |
|
446 | 446 | LIMIT 1'); |
447 | 447 | |
448 | 448 | if ($modx->getDatabase()->getRecordCount($sql)) { |
449 | 449 | $row = $modx->getDatabase()->getRow($sql); |
450 | 450 | $contextmenu = array( |
451 | 451 | 'header' => array( |
452 | - 'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $row['name'] |
|
452 | + 'innerHTML' => '<i class="fa fa-list-alt"></i> '.$row['name'] |
|
453 | 453 | ), |
454 | 454 | 'item' => array( |
455 | - 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'], |
|
456 | - 'url' => "index.php?a=301&id=" . $row['id'] |
|
455 | + 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'], |
|
456 | + 'url' => "index.php?a=301&id=".$row['id'] |
|
457 | 457 | ) |
458 | 458 | ); |
459 | 459 | if (!empty($row['description'])) { |
460 | 460 | $contextmenu['seperator'] = ''; |
461 | 461 | $contextmenu['description'] = array( |
462 | - 'innerHTML' => '<i class="fa fa-info"></i> ' . $row['description'] |
|
462 | + 'innerHTML' => '<i class="fa fa-info"></i> '.$row['description'] |
|
463 | 463 | ); |
464 | 464 | } |
465 | 465 | } else { |
466 | 466 | $contextmenu = array( |
467 | 467 | 'header' => array( |
468 | - 'innerHTML' => '<i class="fa fa-list-alt"></i> ' . $name |
|
468 | + 'innerHTML' => '<i class="fa fa-list-alt"></i> '.$name |
|
469 | 469 | ), |
470 | 470 | 'item' => array( |
471 | - 'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_tmplvars'], |
|
472 | - 'url' => "index.php?a=300&itemname=" . $name |
|
471 | + 'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_tmplvars'], |
|
472 | + 'url' => "index.php?a=300&itemname=".$name |
|
473 | 473 | ) |
474 | 474 | ); |
475 | 475 | } |
@@ -488,15 +488,15 @@ discard block |
||
488 | 488 | $json = array(); |
489 | 489 | |
490 | 490 | if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
491 | - $id = !empty($_REQUEST['id']) ? (int)$_REQUEST['id'] : ''; |
|
492 | - $parent = isset($_REQUEST['parent']) ? (int)$_REQUEST['parent'] : 0; |
|
491 | + $id = !empty($_REQUEST['id']) ? (int) $_REQUEST['id'] : ''; |
|
492 | + $parent = isset($_REQUEST['parent']) ? (int) $_REQUEST['parent'] : 0; |
|
493 | 493 | $menuindex = isset($_REQUEST['menuindex']) && is_scalar($_REQUEST['menuindex']) ? $_REQUEST['menuindex'] : 0; |
494 | 494 | |
495 | 495 | // set parent |
496 | 496 | if ($id && $parent >= 0) { |
497 | 497 | |
498 | 498 | // find older parent |
499 | - $parentOld = $modx->getDatabase()->getValue($modx->getDatabase()->select('parent', $modx->getFullTableName('site_content'), 'id=' . $id)); |
|
499 | + $parentOld = $modx->getDatabase()->getValue($modx->getDatabase()->select('parent', $modx->getFullTableName('site_content'), 'id='.$id)); |
|
500 | 500 | |
501 | 501 | $eventOut = $modx->invokeEvent('onBeforeMoveDocument', [ |
502 | 502 | 'id_document' => $id, |
@@ -517,7 +517,7 @@ discard block |
||
517 | 517 | if (empty($json['errors'])) { |
518 | 518 | // check privileges user for move docs |
519 | 519 | if (!empty($modx->config['tree_show_protected']) && $role != 1) { |
520 | - $sql = $modx->getDatabase()->select('*', $modx->getFullTableName('document_groups'), 'document IN(' . $id . ',' . $parent . ',' . $parentOld . ')'); |
|
520 | + $sql = $modx->getDatabase()->select('*', $modx->getFullTableName('document_groups'), 'document IN('.$id.','.$parent.','.$parentOld.')'); |
|
521 | 521 | if ($modx->getDatabase()->getRecordCount($sql)) { |
522 | 522 | $document_groups = array(); |
523 | 523 | while ($row = $modx->getDatabase()->getRow($sql)) { |
@@ -542,22 +542,22 @@ discard block |
||
542 | 542 | // set new parent |
543 | 543 | $modx->getDatabase()->update(array( |
544 | 544 | 'parent' => $parent |
545 | - ), $modx->getFullTableName('site_content'), 'id=' . $id); |
|
545 | + ), $modx->getFullTableName('site_content'), 'id='.$id); |
|
546 | 546 | // set parent isfolder = 1 |
547 | 547 | $modx->getDatabase()->update(array( |
548 | 548 | 'isfolder' => 1 |
549 | - ), $modx->getFullTableName('site_content'), 'id=' . $parent); |
|
549 | + ), $modx->getFullTableName('site_content'), 'id='.$parent); |
|
550 | 550 | |
551 | 551 | if ($parent != $parentOld) { |
552 | 552 | // check children docs and set parent isfolder |
553 | - if ($modx->getDatabase()->getRecordCount($modx->getDatabase()->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) { |
|
553 | + if ($modx->getDatabase()->getRecordCount($modx->getDatabase()->select('id', $modx->getFullTableName('site_content'), 'parent='.$parentOld))) { |
|
554 | 554 | $modx->getDatabase()->update(array( |
555 | 555 | 'isfolder' => 1 |
556 | - ), $modx->getFullTableName('site_content'), 'id=' . $parentOld); |
|
556 | + ), $modx->getFullTableName('site_content'), 'id='.$parentOld); |
|
557 | 557 | } else { |
558 | 558 | $modx->getDatabase()->update(array( |
559 | 559 | 'isfolder' => 0 |
560 | - ), $modx->getFullTableName('site_content'), 'id=' . $parentOld); |
|
560 | + ), $modx->getFullTableName('site_content'), 'id='.$parentOld); |
|
561 | 561 | } |
562 | 562 | } |
563 | 563 | |
@@ -565,7 +565,7 @@ discard block |
||
565 | 565 | if (!empty($menuindex)) { |
566 | 566 | $menuindex = explode(',', $menuindex); |
567 | 567 | foreach ($menuindex as $key => $value) { |
568 | - $modx->getDatabase()->query('UPDATE ' . $modx->getFullTableName('site_content') . ' SET menuindex=' . $key . ' WHERE id=' . $value); |
|
568 | + $modx->getDatabase()->query('UPDATE '.$modx->getFullTableName('site_content').' SET menuindex='.$key.' WHERE id='.$value); |
|
569 | 569 | } |
570 | 570 | } else { |
571 | 571 | // TODO: max(*) menuindex |
@@ -594,19 +594,19 @@ discard block |
||
594 | 594 | } |
595 | 595 | |
596 | 596 | case 'getLockedElements': { |
597 | - $type = isset($_REQUEST['type']) ? (int)$_REQUEST['type'] : 0; |
|
598 | - $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
597 | + $type = isset($_REQUEST['type']) ? (int) $_REQUEST['type'] : 0; |
|
598 | + $id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
599 | 599 | |
600 | 600 | $output = !!$modx->elementIsLocked($type, $id, true); |
601 | 601 | |
602 | 602 | if (!$output) { |
603 | 603 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
604 | - $docgrp_cond = $docgrp ? ' OR dg.document_group IN (' . $docgrp . ')' : ''; |
|
604 | + $docgrp_cond = $docgrp ? ' OR dg.document_group IN ('.$docgrp.')' : ''; |
|
605 | 605 | $sql = ' |
606 | - SELECT MAX(IF(1=' . $role . ' OR sc.privatemgr=0' . $docgrp_cond . ', 0, 1)) AS locked |
|
607 | - FROM ' . $modx->getFullTableName('site_content') . ' AS sc |
|
608 | - LEFT JOIN ' . $modx->getFullTableName('document_groups') . ' dg ON dg.document=sc.id |
|
609 | - WHERE sc.id=' . $id . ' GROUP BY sc.id'; |
|
606 | + SELECT MAX(IF(1=' . $role.' OR sc.privatemgr=0'.$docgrp_cond.', 0, 1)) AS locked |
|
607 | + FROM ' . $modx->getFullTableName('site_content').' AS sc |
|
608 | + LEFT JOIN ' . $modx->getFullTableName('document_groups').' dg ON dg.document=sc.id |
|
609 | + WHERE sc.id=' . $id.' GROUP BY sc.id'; |
|
610 | 610 | $sql = $modx->getDatabase()->query($sql); |
611 | 611 | if ($modx->getDatabase()->getRecordCount($sql)) { |
612 | 612 | $row = $modx->getDatabase()->getRow($sql); |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
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 | 6 | // invoke OnManagerTreeInit event |
7 | 7 | $evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST); |
8 | 8 | if(is_array($evtOut)) { |
9 | - echo implode("\n", $evtOut); |
|
9 | + echo implode("\n", $evtOut); |
|
10 | 10 | } |
11 | 11 | ?> |
12 | 12 | |
@@ -52,23 +52,23 @@ discard block |
||
52 | 52 | |
53 | 53 | <div id="treeHolder"> |
54 | 54 | <?php |
55 | - // invoke OnManagerTreePrerender event |
|
56 | - $evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->getDatabase()->escape($_REQUEST)); |
|
57 | - if(is_array($evtOut)) { |
|
58 | - echo implode("\n", $evtOut); |
|
59 | - } |
|
60 | - ?> |
|
55 | + // invoke OnManagerTreePrerender event |
|
56 | + $evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->getDatabase()->escape($_REQUEST)); |
|
57 | + if(is_array($evtOut)) { |
|
58 | + echo implode("\n", $evtOut); |
|
59 | + } |
|
60 | + ?> |
|
61 | 61 | <div id="node0" class="rootNode"><a class="node" onclick="modx.tree.treeAction(event, 0)" data-id="0" data-title-esc="<?php $site_name = htmlspecialchars($site_name, ENT_QUOTES, $modx->config['modx_charset']); |
62 | - echo $site_name; ?>"><span class="icon"><?php echo $_style['tree_showtree']; ?></span><span class="title"><?php echo $site_name; ?></span></a> |
|
62 | + echo $site_name; ?>"><span class="icon"><?php echo $_style['tree_showtree']; ?></span><span class="title"><?php echo $site_name; ?></span></a> |
|
63 | 63 | <div id="treeloader"><i class="fa fa-cog fa-spin fa-3x fa-fw"></i></div> |
64 | 64 | </div> |
65 | 65 | <div id="treeRoot"></div> |
66 | 66 | <?php |
67 | - // invoke OnManagerTreeRender event |
|
68 | - $evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->getDatabase()->escape($_REQUEST)); |
|
69 | - if(is_array($evtOut)) { |
|
70 | - echo implode("\n", $evtOut); |
|
71 | - } |
|
72 | - ?> |
|
67 | + // invoke OnManagerTreeRender event |
|
68 | + $evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->getDatabase()->escape($_REQUEST)); |
|
69 | + if(is_array($evtOut)) { |
|
70 | + echo implode("\n", $evtOut); |
|
71 | + } |
|
72 | + ?> |
|
73 | 73 | </div> |
74 | 74 | </div> |
@@ -1,11 +1,11 @@ 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 | |
6 | 6 | // invoke OnManagerTreeInit event |
7 | 7 | $evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST); |
8 | -if(is_array($evtOut)) { |
|
8 | +if (is_array($evtOut)) { |
|
9 | 9 | echo implode("\n", $evtOut); |
10 | 10 | } |
11 | 11 | ?> |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | |
18 | 18 | <a class="treeButton" id="treeMenu_collapsetree" onclick="modx.tree.collapseTree();" title="<?php echo $_lang['collapse_tree']; ?>"><?php echo $_style['collapse_tree']; ?></a> |
19 | 19 | |
20 | - <?php if($modx->hasPermission('new_document')) { ?> |
|
20 | + <?php if ($modx->hasPermission('new_document')) { ?> |
|
21 | 21 | <a class="treeButton" id="treeMenu_addresource" onclick="modx.tabs({url:'<?= MODX_MANAGER_URL ?>?a=4', title: '<?php echo $_lang['add_resource']; ?>'});" title="<?php echo $_lang['add_resource']; ?>"><?php echo $_style['add_doc_tree']; ?></a> |
22 | 22 | <a class="treeButton" id="treeMenu_addweblink" onclick="modx.tabs({url:'<?= MODX_MANAGER_URL ?>?a=72', title: '<?php echo $_lang['add_weblink']; ?>'});" title="<?php echo $_lang['add_weblink']; ?>"><?php echo $_style['add_weblink_tree']; ?></a> |
23 | 23 | <?php } ?> |
@@ -26,23 +26,23 @@ discard block |
||
26 | 26 | |
27 | 27 | <a class="treeButton" id="treeMenu_sortingtree" onclick="modx.tree.showSorter(event);" title="<?php echo $_lang['sort_tree']; ?>"><?php echo $_style['sort_tree']; ?></a> |
28 | 28 | |
29 | - <?php if($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { ?> |
|
29 | + <?php if ($modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { ?> |
|
30 | 30 | <a class="treeButton" id="treeMenu_sortingindex" onclick="modx.tabs({url: '<?= MODX_MANAGER_URL ?>?a=56&id=0', title: '<?php echo $_lang['sort_menuindex']; ?>'});" title="<?php echo $_lang['sort_menuindex']; ?>"><?php echo $_style['sort_menuindex']; ?></a> |
31 | 31 | <?php } ?> |
32 | 32 | |
33 | - <?php if($use_browser && $modx->hasPermission('assets_images')) { ?> |
|
34 | - <a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a> |
|
33 | + <?php if ($use_browser && $modx->hasPermission('assets_images')) { ?> |
|
34 | + <a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a> |
|
35 | 35 | <?php } ?> |
36 | 36 | |
37 | - <?php if($use_browser && $modx->hasPermission('assets_files')) { ?> |
|
38 | - <a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a> |
|
37 | + <?php if ($use_browser && $modx->hasPermission('assets_files')) { ?> |
|
38 | + <a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a> |
|
39 | 39 | <?php } ?> |
40 | 40 | |
41 | - <?php if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
42 | - <a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a> |
|
41 | + <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { ?> |
|
42 | + <a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a> |
|
43 | 43 | <?php } ?> |
44 | 44 | |
45 | - <?php if($modx->hasPermission('empty_trash')) { ?> |
|
45 | + <?php if ($modx->hasPermission('empty_trash')) { ?> |
|
46 | 46 | <a class="treeButton treeButtonDisabled" id="treeMenu_emptytrash" title="<?php echo $_lang['empty_recycle_bin_empty']; ?>"><?php echo $_style['empty_recycle_bin_empty']; ?></a> |
47 | 47 | <?php } ?> |
48 | 48 | |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | <?php |
55 | 55 | // invoke OnManagerTreePrerender event |
56 | 56 | $evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->getDatabase()->escape($_REQUEST)); |
57 | - if(is_array($evtOut)) { |
|
57 | + if (is_array($evtOut)) { |
|
58 | 58 | echo implode("\n", $evtOut); |
59 | 59 | } |
60 | 60 | ?> |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | <?php |
67 | 67 | // invoke OnManagerTreeRender event |
68 | 68 | $evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->getDatabase()->escape($_REQUEST)); |
69 | - if(is_array($evtOut)) { |
|
69 | + if (is_array($evtOut)) { |
|
70 | 70 | echo implode("\n", $evtOut); |
71 | 71 | } |
72 | 72 | ?> |
@@ -1,11 +1,11 @@ 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 | |
6 | 6 | // invoke OnManagerTreeInit event |
7 | 7 | $evtOut = $modx->invokeEvent('OnManagerTreeInit', $_REQUEST); |
8 | -if(is_array($evtOut)) { |
|
8 | +if(is_array($evtOut)) { |
|
9 | 9 | echo implode("\n", $evtOut); |
10 | 10 | } |
11 | 11 | ?> |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | <?php |
55 | 55 | // invoke OnManagerTreePrerender event |
56 | 56 | $evtOut = $modx->invokeEvent('OnManagerTreePrerender', $modx->getDatabase()->escape($_REQUEST)); |
57 | - if(is_array($evtOut)) { |
|
57 | + if(is_array($evtOut)) { |
|
58 | 58 | echo implode("\n", $evtOut); |
59 | 59 | } |
60 | 60 | ?> |
@@ -66,7 +66,7 @@ discard block |
||
66 | 66 | <?php |
67 | 67 | // invoke OnManagerTreeRender event |
68 | 68 | $evtOut = $modx->invokeEvent('OnManagerTreeRender', $modx->getDatabase()->escape($_REQUEST)); |
69 | - if(is_array($evtOut)) { |
|
69 | + if(is_array($evtOut)) { |
|
70 | 70 | echo implode("\n", $evtOut); |
71 | 71 | } |
72 | 72 | ?> |
@@ -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"); |
@@ -11,22 +11,22 @@ discard block |
||
11 | 11 | |
12 | 12 | $mxla = $modx_lang_attribute ? $modx_lang_attribute : 'en'; |
13 | 13 | |
14 | -if (!isset($modx->config['manager_menu_height'])) { |
|
14 | +if (!isset($modx->config['manager_menu_height'])) { |
|
15 | 15 | $modx->config['manager_menu_height'] = 2.2; // rem |
16 | 16 | } |
17 | 17 | |
18 | -if (!isset($modx->config['manager_tree_width'])) { |
|
18 | +if (!isset($modx->config['manager_tree_width'])) { |
|
19 | 19 | $modx->config['manager_tree_width'] = 20; // rem |
20 | 20 | } |
21 | 21 | |
22 | -if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) { |
|
22 | +if (isset($_SESSION['onLoginForwardToAction']) && is_int($_SESSION['onLoginForwardToAction'])) { |
|
23 | 23 | $initMainframeAction = $_SESSION['onLoginForwardToAction']; |
24 | 24 | unset($_SESSION['onLoginForwardToAction']); |
25 | -} else { |
|
25 | +} else { |
|
26 | 26 | $initMainframeAction = 2; // welcome.static |
27 | 27 | } |
28 | 28 | |
29 | -if (!isset($_SESSION['tree_show_only_folders'])) { |
|
29 | +if (!isset($_SESSION['tree_show_only_folders'])) { |
|
30 | 30 | $_SESSION['tree_show_only_folders'] = 0; |
31 | 31 | } |
32 | 32 | |
@@ -35,29 +35,29 @@ discard block |
||
35 | 35 | $tree_width = $modx->config['manager_tree_width']; |
36 | 36 | $tree_min_width = 0; |
37 | 37 | |
38 | -if (isset($_COOKIE['MODX_widthSideBar'])) { |
|
38 | +if (isset($_COOKIE['MODX_widthSideBar'])) { |
|
39 | 39 | $MODX_widthSideBar = $_COOKIE['MODX_widthSideBar']; |
40 | -} else { |
|
40 | +} else { |
|
41 | 41 | $MODX_widthSideBar = $tree_width; |
42 | 42 | } |
43 | 43 | |
44 | -if (!$MODX_widthSideBar) { |
|
44 | +if (!$MODX_widthSideBar) { |
|
45 | 45 | $body_class .= 'sidebar-closed'; |
46 | 46 | } |
47 | 47 | |
48 | 48 | $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness'); |
49 | -if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) { |
|
49 | +if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) { |
|
50 | 50 | $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']]; |
51 | -} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) { |
|
51 | +} elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) { |
|
52 | 52 | $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']]; |
53 | 53 | } |
54 | 54 | |
55 | 55 | $navbar_position = $modx->config['manager_menu_position']; |
56 | -if ($navbar_position == 'left') { |
|
56 | +if ($navbar_position == 'left') { |
|
57 | 57 | $body_class .= ' navbar-left navbar-left-icon-and-text'; |
58 | 58 | } |
59 | 59 | |
60 | -if (isset($modx->pluginCache['ElementsInTree'])) { |
|
60 | +if (isset($modx->pluginCache['ElementsInTree'])) { |
|
61 | 61 | $body_class .= ' ElementsInTree'; |
62 | 62 | } |
63 | 63 | |
@@ -73,19 +73,19 @@ discard block |
||
73 | 73 | 'type8' => $_lang["lock_element_type_8"] |
74 | 74 | ); |
75 | 75 | |
76 | -foreach ($unlockTranslations as $key => $value) { |
|
76 | +foreach ($unlockTranslations as $key => $value) { |
|
77 | 77 | $unlockTranslations[$key] = iconv($modx->config["modx_charset"], "utf-8", $value); |
78 | 78 | } |
79 | 79 | |
80 | 80 | $user = $modx->getUserInfo($modx->getLoginUserID()); |
81 | -if ($user['which_browser'] == 'default') { |
|
81 | +if ($user['which_browser'] == 'default') { |
|
82 | 82 | $user['which_browser'] = $modx->config['which_browser']; |
83 | 83 | } |
84 | 84 | |
85 | 85 | $css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime; |
86 | 86 | |
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')) { |
|
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 | 89 | require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
90 | 90 | $minifier = new Formatter\CSSMinify(); |
91 | 91 | $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | $css = $minifier->minify(); |
103 | 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')) { |
|
105 | + if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
106 | 106 | $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; |
107 | 107 | } |
108 | 108 | } |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | <?php |
258 | 258 | // invoke OnManagerTopPrerender event |
259 | 259 | $evtOut = $modx->invokeEvent('OnManagerTopPrerender', $_REQUEST); |
260 | - if (is_array($evtOut)) { |
|
260 | + if (is_array($evtOut)) { |
|
261 | 261 | echo implode("\n", $evtOut); |
262 | 262 | } |
263 | 263 | ?> |
@@ -428,11 +428,14 @@ discard block |
||
428 | 428 | <div id="evo-tab-page-home" class="evo-tab-page show iframe-scroller"> |
429 | 429 | <iframe id="mainframe" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe> |
430 | 430 | </div> |
431 | - <?php else: ?> |
|
431 | + <?php else { |
|
432 | + : ?> |
|
432 | 433 | <div class="iframe-scroller"> |
433 | 434 | <iframe id="mainframe" name="main" src="index.php?a=<?= $initMainframeAction ?>" scrolling="auto" frameborder="0" onload="modx.main.onload(event);"></iframe> |
434 | 435 | </div> |
435 | - <?php endif; ?> |
|
436 | + <?php endif; |
|
437 | +} |
|
438 | +?> |
|
436 | 439 | <script> |
437 | 440 | if (/iPhone|iPad|iPod/i.test(navigator.userAgent)) { |
438 | 441 | document.getElementById('mainframe').setAttribute('scrolling', 'no'); |
@@ -451,11 +454,11 @@ discard block |
||
451 | 454 | 'tree_sortdir', |
452 | 455 | 'tree_nodename' |
453 | 456 | ); |
454 | - foreach ($sortParams as $param) { |
|
455 | - if (isset($_REQUEST[$param])) { |
|
457 | + foreach ($sortParams as $param) { |
|
458 | + if (isset($_REQUEST[$param])) { |
|
456 | 459 | $modx->getManagerApi()->saveLastUserSetting($param, $_REQUEST[$param]); |
457 | 460 | $_SESSION[$param] = $_REQUEST[$param]; |
458 | - } else if (!isset($_SESSION[$param])) { |
|
461 | + } else if (!isset($_SESSION[$param])) { |
|
459 | 462 | $_SESSION[$param] = $modx->getManagerApi()->getLastUserSetting($param); |
460 | 463 | } |
461 | 464 | } |
@@ -506,16 +509,16 @@ discard block |
||
506 | 509 | </div> |
507 | 510 | |
508 | 511 | <?php |
509 | - if(!function_exists('constructLink')) { |
|
512 | + if(!function_exists('constructLink')) { |
|
510 | 513 | /** |
511 | 514 | * @param string $action |
512 | 515 | * @param string $img |
513 | 516 | * @param string $text |
514 | 517 | * @param bool $allowed |
515 | 518 | */ |
516 | - function constructLink($action, $img, $text, $allowed) |
|
517 | - { |
|
518 | - if ((bool)$allowed) { |
|
519 | + function constructLink($action, $img, $text, $allowed) |
|
520 | + { |
|
521 | + if ((bool)$allowed) { |
|
519 | 522 | echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action, |
520 | 523 | $action); |
521 | 524 | echo sprintf('<i class="%s"></i> %s</div>', $img, $text); |
@@ -650,7 +653,7 @@ discard block |
||
650 | 653 | ?> |
651 | 654 | |
652 | 655 | </div> |
653 | -<?php if ($modx->config['show_picker'] != "0") { |
|
656 | +<?php if ($modx->config['show_picker'] != "0") { |
|
654 | 657 | include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php'); |
655 | 658 | } ?> |
656 | 659 | </body> |
@@ -4,237 +4,237 @@ discard block |
||
4 | 4 | */ |
5 | 5 | |
6 | 6 | $sitemenu['bars'] = array( |
7 | - 'bars', |
|
8 | - 'main', |
|
9 | - '<i class="fa fa-bars"></i>', |
|
10 | - 'javascript:;', |
|
11 | - $_lang['home'], |
|
12 | - 'modx.resizer.toggle(); return false;', |
|
13 | - ' return false;', |
|
14 | - '', |
|
15 | - 0, |
|
16 | - 10, |
|
17 | - '' |
|
7 | + 'bars', |
|
8 | + 'main', |
|
9 | + '<i class="fa fa-bars"></i>', |
|
10 | + 'javascript:;', |
|
11 | + $_lang['home'], |
|
12 | + 'modx.resizer.toggle(); return false;', |
|
13 | + ' return false;', |
|
14 | + '', |
|
15 | + 0, |
|
16 | + 10, |
|
17 | + '' |
|
18 | 18 | ); |
19 | 19 | |
20 | 20 | //mainMenu |
21 | 21 | $sitemenu['site'] = array( |
22 | - 'site', |
|
23 | - 'main', |
|
24 | - '<i class="fa fa-tachometer"></i><span class="menu-item-text">' . $_lang['home'] . '</span>', |
|
25 | - 'index.php?a=2', |
|
26 | - $_lang['home'], |
|
27 | - '', |
|
28 | - '', |
|
29 | - 'main', |
|
30 | - 0, |
|
31 | - 10, |
|
32 | - 'active' |
|
22 | + 'site', |
|
23 | + 'main', |
|
24 | + '<i class="fa fa-tachometer"></i><span class="menu-item-text">' . $_lang['home'] . '</span>', |
|
25 | + 'index.php?a=2', |
|
26 | + $_lang['home'], |
|
27 | + '', |
|
28 | + '', |
|
29 | + 'main', |
|
30 | + 0, |
|
31 | + 10, |
|
32 | + 'active' |
|
33 | 33 | ); |
34 | 34 | |
35 | 35 | if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
36 | - $sitemenu['elements'] = array( |
|
37 | - 'elements', |
|
38 | - 'main', |
|
39 | - '<i class="fa fa-th"></i><span class="menu-item-text">' . $_lang['elements'] . '</span>', |
|
40 | - 'javascript:;', |
|
41 | - $_lang['elements'], |
|
42 | - ' return false;', |
|
43 | - '', |
|
44 | - '', |
|
45 | - 0, |
|
46 | - 20, |
|
47 | - '' |
|
48 | - ); |
|
36 | + $sitemenu['elements'] = array( |
|
37 | + 'elements', |
|
38 | + 'main', |
|
39 | + '<i class="fa fa-th"></i><span class="menu-item-text">' . $_lang['elements'] . '</span>', |
|
40 | + 'javascript:;', |
|
41 | + $_lang['elements'], |
|
42 | + ' return false;', |
|
43 | + '', |
|
44 | + '', |
|
45 | + 0, |
|
46 | + 20, |
|
47 | + '' |
|
48 | + ); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | if($modx->hasPermission('exec_module')) { |
52 | - $sitemenu['modules'] = array( |
|
53 | - 'modules', |
|
54 | - 'main', |
|
55 | - '<i class="'.$_style['icons_modules'] .'"></i><span class="menu-item-text">' . $_lang['modules'] . '</span>', |
|
56 | - 'javascript:;', |
|
57 | - $_lang['modules'], |
|
58 | - ' return false;', |
|
59 | - '', |
|
60 | - '', |
|
61 | - 0, |
|
62 | - 30, |
|
63 | - '' |
|
64 | - ); |
|
52 | + $sitemenu['modules'] = array( |
|
53 | + 'modules', |
|
54 | + 'main', |
|
55 | + '<i class="'.$_style['icons_modules'] .'"></i><span class="menu-item-text">' . $_lang['modules'] . '</span>', |
|
56 | + 'javascript:;', |
|
57 | + $_lang['modules'], |
|
58 | + ' return false;', |
|
59 | + '', |
|
60 | + '', |
|
61 | + 0, |
|
62 | + 30, |
|
63 | + '' |
|
64 | + ); |
|
65 | 65 | } |
66 | 66 | |
67 | 67 | if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
68 | - $sitemenu['users'] = array( |
|
69 | - 'users', |
|
70 | - 'main', |
|
71 | - '<i class="fa fa-users"></i><span class="menu-item-text">' . $_lang['users'] . '</span>', |
|
72 | - 'javascript:;', |
|
73 | - $_lang['users'], |
|
74 | - ' return false;', |
|
75 | - 'edit_user', |
|
76 | - '', |
|
77 | - 0, |
|
78 | - 40, |
|
79 | - '' |
|
80 | - ); |
|
68 | + $sitemenu['users'] = array( |
|
69 | + 'users', |
|
70 | + 'main', |
|
71 | + '<i class="fa fa-users"></i><span class="menu-item-text">' . $_lang['users'] . '</span>', |
|
72 | + 'javascript:;', |
|
73 | + $_lang['users'], |
|
74 | + ' return false;', |
|
75 | + 'edit_user', |
|
76 | + '', |
|
77 | + 0, |
|
78 | + 40, |
|
79 | + '' |
|
80 | + ); |
|
81 | 81 | } |
82 | 82 | |
83 | 83 | if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
84 | - $sitemenu['tools'] = array( |
|
85 | - 'tools', |
|
86 | - 'main', |
|
87 | - '<i class="fa fa-wrench"></i><span class="menu-item-text">' . $_lang['tools'] . '</span>', |
|
88 | - 'javascript:;', |
|
89 | - $_lang['tools'], |
|
90 | - ' return false;', |
|
91 | - '', |
|
92 | - '', |
|
93 | - 0, |
|
94 | - 50, |
|
95 | - '' |
|
96 | - ); |
|
84 | + $sitemenu['tools'] = array( |
|
85 | + 'tools', |
|
86 | + 'main', |
|
87 | + '<i class="fa fa-wrench"></i><span class="menu-item-text">' . $_lang['tools'] . '</span>', |
|
88 | + 'javascript:;', |
|
89 | + $_lang['tools'], |
|
90 | + ' return false;', |
|
91 | + '', |
|
92 | + '', |
|
93 | + 0, |
|
94 | + 50, |
|
95 | + '' |
|
96 | + ); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | $tab = 0; |
100 | 100 | if($modx->hasPermission('edit_template')) { |
101 | - $sitemenu['element_templates'] = array( |
|
102 | - 'element_templates', |
|
103 | - 'elements', |
|
104 | - '<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>', |
|
105 | - 'index.php?a=76&tab=' . $tab++, |
|
106 | - $_lang['manage_templates'], |
|
107 | - '', |
|
108 | - 'new_template,edit_template', |
|
109 | - 'main', |
|
110 | - 0, |
|
111 | - 10, |
|
112 | - 'dropdown-toggle' |
|
113 | - ); |
|
101 | + $sitemenu['element_templates'] = array( |
|
102 | + 'element_templates', |
|
103 | + 'elements', |
|
104 | + '<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>', |
|
105 | + 'index.php?a=76&tab=' . $tab++, |
|
106 | + $_lang['manage_templates'], |
|
107 | + '', |
|
108 | + 'new_template,edit_template', |
|
109 | + 'main', |
|
110 | + 0, |
|
111 | + 10, |
|
112 | + 'dropdown-toggle' |
|
113 | + ); |
|
114 | 114 | } |
115 | 115 | if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
116 | - $sitemenu['element_tplvars'] = array( |
|
117 | - 'element_tplvars', |
|
118 | - 'elements', |
|
119 | - '<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>', |
|
120 | - 'index.php?a=76&tab=' . $tab++, |
|
121 | - $_lang['tmplvars'], |
|
122 | - '', |
|
123 | - 'new_template,edit_template', |
|
124 | - 'main', |
|
125 | - 0, |
|
126 | - 20, |
|
127 | - 'dropdown-toggle' |
|
128 | - ); |
|
116 | + $sitemenu['element_tplvars'] = array( |
|
117 | + 'element_tplvars', |
|
118 | + 'elements', |
|
119 | + '<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>', |
|
120 | + 'index.php?a=76&tab=' . $tab++, |
|
121 | + $_lang['tmplvars'], |
|
122 | + '', |
|
123 | + 'new_template,edit_template', |
|
124 | + 'main', |
|
125 | + 0, |
|
126 | + 20, |
|
127 | + 'dropdown-toggle' |
|
128 | + ); |
|
129 | 129 | } |
130 | 130 | if($modx->hasPermission('edit_chunk')) { |
131 | - $sitemenu['element_htmlsnippets'] = array( |
|
132 | - 'element_htmlsnippets', |
|
133 | - 'elements', |
|
134 | - '<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
135 | - 'index.php?a=76&tab=' . $tab++, |
|
136 | - $_lang['manage_htmlsnippets'], |
|
137 | - '', |
|
138 | - 'new_chunk,edit_chunk', |
|
139 | - 'main', |
|
140 | - 0, |
|
141 | - 30, |
|
142 | - 'dropdown-toggle' |
|
143 | - ); |
|
131 | + $sitemenu['element_htmlsnippets'] = array( |
|
132 | + 'element_htmlsnippets', |
|
133 | + 'elements', |
|
134 | + '<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
135 | + 'index.php?a=76&tab=' . $tab++, |
|
136 | + $_lang['manage_htmlsnippets'], |
|
137 | + '', |
|
138 | + 'new_chunk,edit_chunk', |
|
139 | + 'main', |
|
140 | + 0, |
|
141 | + 30, |
|
142 | + 'dropdown-toggle' |
|
143 | + ); |
|
144 | 144 | } |
145 | 145 | if($modx->hasPermission('edit_snippet')) { |
146 | - $sitemenu['element_snippets'] = array( |
|
147 | - 'element_snippets', |
|
148 | - 'elements', |
|
149 | - '<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
150 | - 'index.php?a=76&tab=' . $tab++, |
|
151 | - $_lang['manage_snippets'], |
|
152 | - '', |
|
153 | - 'new_snippet,edit_snippet', |
|
154 | - 'main', |
|
155 | - 0, |
|
156 | - 40, |
|
157 | - 'dropdown-toggle' |
|
158 | - ); |
|
146 | + $sitemenu['element_snippets'] = array( |
|
147 | + 'element_snippets', |
|
148 | + 'elements', |
|
149 | + '<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
150 | + 'index.php?a=76&tab=' . $tab++, |
|
151 | + $_lang['manage_snippets'], |
|
152 | + '', |
|
153 | + 'new_snippet,edit_snippet', |
|
154 | + 'main', |
|
155 | + 0, |
|
156 | + 40, |
|
157 | + 'dropdown-toggle' |
|
158 | + ); |
|
159 | 159 | } |
160 | 160 | if($modx->hasPermission('edit_plugin')) { |
161 | - $sitemenu['element_plugins'] = array( |
|
162 | - 'element_plugins', |
|
163 | - 'elements', |
|
164 | - '<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>', |
|
165 | - 'index.php?a=76&tab=' . $tab++, |
|
166 | - $_lang['manage_plugins'], |
|
167 | - '', |
|
168 | - 'new_plugin,edit_plugin', |
|
169 | - 'main', |
|
170 | - 0, |
|
171 | - 50, |
|
172 | - 'dropdown-toggle' |
|
173 | - ); |
|
161 | + $sitemenu['element_plugins'] = array( |
|
162 | + 'element_plugins', |
|
163 | + 'elements', |
|
164 | + '<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>', |
|
165 | + 'index.php?a=76&tab=' . $tab++, |
|
166 | + $_lang['manage_plugins'], |
|
167 | + '', |
|
168 | + 'new_plugin,edit_plugin', |
|
169 | + 'main', |
|
170 | + 0, |
|
171 | + 50, |
|
172 | + 'dropdown-toggle' |
|
173 | + ); |
|
174 | 174 | } |
175 | 175 | //$sitemenu['element_categories'] = array('element_categories','elements',$_lang['element_categories'],'index.php?a=76&tab=5',$_lang['element_categories'],'','new_template,edit_template,new_snippet,edit_snippet,new_chunk,edit_chunk,new_plugin,edit_plugin','main',1,60,''); |
176 | 176 | |
177 | 177 | if($modx->hasPermission('file_manager')) { |
178 | - $sitemenu['manage_files'] = array( |
|
179 | - 'manage_files', |
|
180 | - 'elements', |
|
181 | - '<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'], |
|
182 | - 'index.php?a=31', |
|
183 | - $_lang['manage_files'], |
|
184 | - '', |
|
185 | - 'file_manager', |
|
186 | - 'main', |
|
187 | - 0, |
|
188 | - 80, |
|
189 | - '' |
|
190 | - ); |
|
178 | + $sitemenu['manage_files'] = array( |
|
179 | + 'manage_files', |
|
180 | + 'elements', |
|
181 | + '<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'], |
|
182 | + 'index.php?a=31', |
|
183 | + $_lang['manage_files'], |
|
184 | + '', |
|
185 | + 'file_manager', |
|
186 | + 'main', |
|
187 | + 0, |
|
188 | + 80, |
|
189 | + '' |
|
190 | + ); |
|
191 | 191 | } |
192 | 192 | if($modx->hasPermission('category_manager')) { |
193 | - $sitemenu['manage_categories'] = array( |
|
194 | - 'manage_categories', |
|
195 | - 'elements', |
|
196 | - '<i class="fa fa-object-group"></i>' . $_lang['manage_categories'], |
|
197 | - 'index.php?a=120', |
|
198 | - $_lang['manage_categories'], |
|
199 | - '', |
|
200 | - 'category_manager', |
|
201 | - 'main', |
|
202 | - 0, |
|
203 | - 70, |
|
204 | - '' |
|
205 | - ); |
|
193 | + $sitemenu['manage_categories'] = array( |
|
194 | + 'manage_categories', |
|
195 | + 'elements', |
|
196 | + '<i class="fa fa-object-group"></i>' . $_lang['manage_categories'], |
|
197 | + 'index.php?a=120', |
|
198 | + $_lang['manage_categories'], |
|
199 | + '', |
|
200 | + 'category_manager', |
|
201 | + 'main', |
|
202 | + 0, |
|
203 | + 70, |
|
204 | + '' |
|
205 | + ); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | // Modules Menu Items |
209 | 209 | if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
210 | - $sitemenu['new_module'] = array( |
|
211 | - 'new_module', |
|
212 | - 'modules', |
|
213 | - '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['module_management'], |
|
214 | - 'index.php?a=106', |
|
215 | - $_lang['module_management'], |
|
216 | - '', |
|
217 | - 'new_module,edit_module', |
|
218 | - 'main', |
|
219 | - 1, |
|
220 | - 0, |
|
221 | - '' |
|
222 | - ); |
|
210 | + $sitemenu['new_module'] = array( |
|
211 | + 'new_module', |
|
212 | + 'modules', |
|
213 | + '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['module_management'], |
|
214 | + 'index.php?a=106', |
|
215 | + $_lang['module_management'], |
|
216 | + '', |
|
217 | + 'new_module,edit_module', |
|
218 | + 'main', |
|
219 | + 1, |
|
220 | + 0, |
|
221 | + '' |
|
222 | + ); |
|
223 | 223 | } |
224 | 224 | |
225 | 225 | if($modx->hasPermission('exec_module')) { |
226 | - if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
227 | - $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
|
226 | + if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
227 | + $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
|
228 | 228 | FROM ' . $modx->getFullTableName('site_modules') . ' AS sm |
229 | 229 | LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
230 | 230 | LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
231 | 231 | WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
232 | 232 | ORDER BY sm.name'); |
233 | - } else { |
|
234 | - $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
|
235 | - } |
|
236 | - if($modx->getDatabase()->getRecordCount($rs)) { |
|
237 | - while ($row = $modx->getDatabase()->getRow($rs)) { |
|
233 | + } else { |
|
234 | + $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
|
235 | + } |
|
236 | + if($modx->getDatabase()->getRecordCount($rs)) { |
|
237 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
238 | 238 | $sitemenu['module' . $row['id']] = array( |
239 | 239 | 'module' . $row['id'], |
240 | 240 | 'modules', |
@@ -255,83 +255,83 @@ discard block |
||
255 | 255 | // security menu items (users) |
256 | 256 | |
257 | 257 | if($modx->hasPermission('edit_user')) { |
258 | - $sitemenu['user_management_title'] = array( |
|
259 | - 'user_management_title', |
|
260 | - 'users', |
|
261 | - '<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
262 | - 'index.php?a=75', |
|
263 | - $_lang['user_management_title'], |
|
264 | - '', |
|
265 | - 'edit_user', |
|
266 | - 'main', |
|
267 | - 0, |
|
268 | - 10, |
|
269 | - 'dropdown-toggle' |
|
270 | - ); |
|
258 | + $sitemenu['user_management_title'] = array( |
|
259 | + 'user_management_title', |
|
260 | + 'users', |
|
261 | + '<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
262 | + 'index.php?a=75', |
|
263 | + $_lang['user_management_title'], |
|
264 | + '', |
|
265 | + 'edit_user', |
|
266 | + 'main', |
|
267 | + 0, |
|
268 | + 10, |
|
269 | + 'dropdown-toggle' |
|
270 | + ); |
|
271 | 271 | } |
272 | 272 | |
273 | 273 | if($modx->hasPermission('edit_web_user')) { |
274 | - $sitemenu['web_user_management_title'] = array( |
|
275 | - 'web_user_management_title', |
|
276 | - 'users', |
|
277 | - '<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
278 | - 'index.php?a=99', |
|
279 | - $_lang['web_user_management_title'], |
|
280 | - '', |
|
281 | - 'edit_web_user', |
|
282 | - 'main', |
|
283 | - 0, |
|
284 | - 20, |
|
285 | - 'dropdown-toggle' |
|
286 | - ); |
|
274 | + $sitemenu['web_user_management_title'] = array( |
|
275 | + 'web_user_management_title', |
|
276 | + 'users', |
|
277 | + '<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
278 | + 'index.php?a=99', |
|
279 | + $_lang['web_user_management_title'], |
|
280 | + '', |
|
281 | + 'edit_web_user', |
|
282 | + 'main', |
|
283 | + 0, |
|
284 | + 20, |
|
285 | + 'dropdown-toggle' |
|
286 | + ); |
|
287 | 287 | } |
288 | 288 | |
289 | 289 | if($modx->hasPermission('edit_role')) { |
290 | - $sitemenu['role_management_title'] = array( |
|
291 | - 'role_management_title', |
|
292 | - 'users', |
|
293 | - '<i class="fa fa-legal"></i>' . $_lang['role_management_title'], |
|
294 | - 'index.php?a=86', |
|
295 | - $_lang['role_management_title'], |
|
296 | - '', |
|
297 | - 'new_role,edit_role,delete_role', |
|
298 | - 'main', |
|
299 | - 0, |
|
300 | - 30, |
|
301 | - '' |
|
302 | - ); |
|
290 | + $sitemenu['role_management_title'] = array( |
|
291 | + 'role_management_title', |
|
292 | + 'users', |
|
293 | + '<i class="fa fa-legal"></i>' . $_lang['role_management_title'], |
|
294 | + 'index.php?a=86', |
|
295 | + $_lang['role_management_title'], |
|
296 | + '', |
|
297 | + 'new_role,edit_role,delete_role', |
|
298 | + 'main', |
|
299 | + 0, |
|
300 | + 30, |
|
301 | + '' |
|
302 | + ); |
|
303 | 303 | } |
304 | 304 | |
305 | 305 | if($modx->hasPermission('access_permissions')) { |
306 | - $sitemenu['manager_permissions'] = array( |
|
307 | - 'manager_permissions', |
|
308 | - 'users', |
|
309 | - '<i class="fa fa-male"></i>' . $_lang['manager_permissions'], |
|
310 | - 'index.php?a=40', |
|
311 | - $_lang['manager_permissions'], |
|
312 | - '', |
|
313 | - 'access_permissions', |
|
314 | - 'main', |
|
315 | - 0, |
|
316 | - 40, |
|
317 | - '' |
|
318 | - ); |
|
306 | + $sitemenu['manager_permissions'] = array( |
|
307 | + 'manager_permissions', |
|
308 | + 'users', |
|
309 | + '<i class="fa fa-male"></i>' . $_lang['manager_permissions'], |
|
310 | + 'index.php?a=40', |
|
311 | + $_lang['manager_permissions'], |
|
312 | + '', |
|
313 | + 'access_permissions', |
|
314 | + 'main', |
|
315 | + 0, |
|
316 | + 40, |
|
317 | + '' |
|
318 | + ); |
|
319 | 319 | } |
320 | 320 | |
321 | 321 | if($modx->hasPermission('web_access_permissions')) { |
322 | - $sitemenu['web_permissions'] = array( |
|
323 | - 'web_permissions', |
|
324 | - 'users', |
|
325 | - '<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'], |
|
326 | - 'index.php?a=91', |
|
327 | - $_lang['web_permissions'], |
|
328 | - '', |
|
329 | - 'web_access_permissions', |
|
330 | - 'main', |
|
331 | - 0, |
|
332 | - 50, |
|
333 | - '' |
|
334 | - ); |
|
322 | + $sitemenu['web_permissions'] = array( |
|
323 | + 'web_permissions', |
|
324 | + 'users', |
|
325 | + '<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'], |
|
326 | + 'index.php?a=91', |
|
327 | + $_lang['web_permissions'], |
|
328 | + '', |
|
329 | + 'web_access_permissions', |
|
330 | + 'main', |
|
331 | + 0, |
|
332 | + 50, |
|
333 | + '' |
|
334 | + ); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | // Tools Menu |
@@ -361,104 +361,104 @@ discard block |
||
361 | 361 | ); |
362 | 362 | |
363 | 363 | $sitemenu['search'] = array( |
364 | - 'search', |
|
365 | - 'tools', |
|
366 | - '<i class="fa fa-search"></i>' . $_lang['search'], |
|
367 | - 'index.php?a=71', |
|
368 | - $_lang['search'], |
|
369 | - '', |
|
370 | - '', |
|
371 | - 'main', |
|
372 | - 1, |
|
373 | - 9, |
|
374 | - '' |
|
364 | + 'search', |
|
365 | + 'tools', |
|
366 | + '<i class="fa fa-search"></i>' . $_lang['search'], |
|
367 | + 'index.php?a=71', |
|
368 | + $_lang['search'], |
|
369 | + '', |
|
370 | + '', |
|
371 | + 'main', |
|
372 | + 1, |
|
373 | + 9, |
|
374 | + '' |
|
375 | 375 | ); |
376 | 376 | |
377 | 377 | if($modx->hasPermission('bk_manager')) { |
378 | - $sitemenu['bk_manager'] = array( |
|
379 | - 'bk_manager', |
|
380 | - 'tools', |
|
381 | - '<i class="fa fa-database"></i>' . $_lang['bk_manager'], |
|
382 | - 'index.php?a=93', |
|
383 | - $_lang['bk_manager'], |
|
384 | - '', |
|
385 | - 'bk_manager', |
|
386 | - 'main', |
|
387 | - 0, |
|
388 | - 10, |
|
389 | - '' |
|
390 | - ); |
|
378 | + $sitemenu['bk_manager'] = array( |
|
379 | + 'bk_manager', |
|
380 | + 'tools', |
|
381 | + '<i class="fa fa-database"></i>' . $_lang['bk_manager'], |
|
382 | + 'index.php?a=93', |
|
383 | + $_lang['bk_manager'], |
|
384 | + '', |
|
385 | + 'bk_manager', |
|
386 | + 'main', |
|
387 | + 0, |
|
388 | + 10, |
|
389 | + '' |
|
390 | + ); |
|
391 | 391 | } |
392 | 392 | |
393 | 393 | if($modx->hasPermission('remove_locks')) { |
394 | - $sitemenu['remove_locks'] = array( |
|
395 | - 'remove_locks', |
|
396 | - 'tools', |
|
397 | - '<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'], |
|
398 | - 'javascript:modx.removeLocks();', |
|
399 | - $_lang['remove_locks'], |
|
400 | - '', |
|
401 | - 'remove_locks', |
|
402 | - '', |
|
403 | - 0, |
|
404 | - 20, |
|
405 | - '' |
|
406 | - ); |
|
394 | + $sitemenu['remove_locks'] = array( |
|
395 | + 'remove_locks', |
|
396 | + 'tools', |
|
397 | + '<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'], |
|
398 | + 'javascript:modx.removeLocks();', |
|
399 | + $_lang['remove_locks'], |
|
400 | + '', |
|
401 | + 'remove_locks', |
|
402 | + '', |
|
403 | + 0, |
|
404 | + 20, |
|
405 | + '' |
|
406 | + ); |
|
407 | 407 | } |
408 | 408 | |
409 | 409 | if($modx->hasPermission('import_static')) { |
410 | - $sitemenu['import_site'] = array( |
|
411 | - 'import_site', |
|
412 | - 'tools', |
|
413 | - '<i class="fa fa-upload"></i>' . $_lang['import_site'], |
|
414 | - 'index.php?a=95', |
|
415 | - $_lang['import_site'], |
|
416 | - '', |
|
417 | - 'import_static', |
|
418 | - 'main', |
|
419 | - 0, |
|
420 | - 30, |
|
421 | - '' |
|
422 | - ); |
|
410 | + $sitemenu['import_site'] = array( |
|
411 | + 'import_site', |
|
412 | + 'tools', |
|
413 | + '<i class="fa fa-upload"></i>' . $_lang['import_site'], |
|
414 | + 'index.php?a=95', |
|
415 | + $_lang['import_site'], |
|
416 | + '', |
|
417 | + 'import_static', |
|
418 | + 'main', |
|
419 | + 0, |
|
420 | + 30, |
|
421 | + '' |
|
422 | + ); |
|
423 | 423 | } |
424 | 424 | |
425 | 425 | if($modx->hasPermission('export_static')) { |
426 | - $sitemenu['export_site'] = array( |
|
427 | - 'export_site', |
|
428 | - 'tools', |
|
429 | - '<i class="fa fa-download"></i>' . $_lang['export_site'], |
|
430 | - 'index.php?a=83', |
|
431 | - $_lang['export_site'], |
|
432 | - '', |
|
433 | - 'export_static', |
|
434 | - 'main', |
|
435 | - 1, |
|
436 | - 40, |
|
437 | - '' |
|
438 | - ); |
|
426 | + $sitemenu['export_site'] = array( |
|
427 | + 'export_site', |
|
428 | + 'tools', |
|
429 | + '<i class="fa fa-download"></i>' . $_lang['export_site'], |
|
430 | + 'index.php?a=83', |
|
431 | + $_lang['export_site'], |
|
432 | + '', |
|
433 | + 'export_static', |
|
434 | + 'main', |
|
435 | + 1, |
|
436 | + 40, |
|
437 | + '' |
|
438 | + ); |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | $menu = $modx->invokeEvent("OnManagerMenuPrerender", array('menu' => $sitemenu)); |
442 | 442 | if(is_array($menu)) { |
443 | - $newmenu = array(); |
|
444 | - foreach($menu as $item){ |
|
445 | - if(is_array(unserialize($item))){ |
|
446 | - $newmenu = array_merge($newmenu, unserialize($item)); |
|
447 | - } |
|
448 | - } |
|
449 | - if(count($newmenu)> 0) $sitemenu = $newmenu; |
|
443 | + $newmenu = array(); |
|
444 | + foreach($menu as $item){ |
|
445 | + if(is_array(unserialize($item))){ |
|
446 | + $newmenu = array_merge($newmenu, unserialize($item)); |
|
447 | + } |
|
448 | + } |
|
449 | + if(count($newmenu)> 0) $sitemenu = $newmenu; |
|
450 | 450 | } |
451 | 451 | |
452 | 452 | if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
453 | - include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
|
453 | + include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
|
454 | 454 | } else { |
455 | - include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
|
455 | + include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
|
456 | 456 | } |
457 | 457 | $menu = new EVOmenu(); |
458 | 458 | $menu->Build($sitemenu, array( |
459 | - 'outerClass' => 'nav', |
|
460 | - 'innerClass' => 'dropdown-menu', |
|
461 | - 'parentClass' => 'dropdown', |
|
459 | + 'outerClass' => 'nav', |
|
460 | + 'innerClass' => 'dropdown-menu', |
|
461 | + 'parentClass' => 'dropdown', |
|
462 | 462 | 'parentLinkClass' => 'dropdown-toggle', |
463 | 463 | 'parentLinkAttr' => '', |
464 | 464 | 'parentLinkIn' => '' |
@@ -21,7 +21,7 @@ discard block |
||
21 | 21 | $sitemenu['site'] = array( |
22 | 22 | 'site', |
23 | 23 | 'main', |
24 | - '<i class="fa fa-tachometer"></i><span class="menu-item-text">' . $_lang['home'] . '</span>', |
|
24 | + '<i class="fa fa-tachometer"></i><span class="menu-item-text">'.$_lang['home'].'</span>', |
|
25 | 25 | 'index.php?a=2', |
26 | 26 | $_lang['home'], |
27 | 27 | '', |
@@ -32,11 +32,11 @@ discard block |
||
32 | 32 | 'active' |
33 | 33 | ); |
34 | 34 | |
35 | -if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
|
35 | +if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
|
36 | 36 | $sitemenu['elements'] = array( |
37 | 37 | 'elements', |
38 | 38 | 'main', |
39 | - '<i class="fa fa-th"></i><span class="menu-item-text">' . $_lang['elements'] . '</span>', |
|
39 | + '<i class="fa fa-th"></i><span class="menu-item-text">'.$_lang['elements'].'</span>', |
|
40 | 40 | 'javascript:;', |
41 | 41 | $_lang['elements'], |
42 | 42 | ' return false;', |
@@ -48,11 +48,11 @@ discard block |
||
48 | 48 | ); |
49 | 49 | } |
50 | 50 | |
51 | -if($modx->hasPermission('exec_module')) { |
|
51 | +if ($modx->hasPermission('exec_module')) { |
|
52 | 52 | $sitemenu['modules'] = array( |
53 | 53 | 'modules', |
54 | 54 | 'main', |
55 | - '<i class="'.$_style['icons_modules'] .'"></i><span class="menu-item-text">' . $_lang['modules'] . '</span>', |
|
55 | + '<i class="'.$_style['icons_modules'].'"></i><span class="menu-item-text">'.$_lang['modules'].'</span>', |
|
56 | 56 | 'javascript:;', |
57 | 57 | $_lang['modules'], |
58 | 58 | ' return false;', |
@@ -64,11 +64,11 @@ discard block |
||
64 | 64 | ); |
65 | 65 | } |
66 | 66 | |
67 | -if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
|
67 | +if ($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
|
68 | 68 | $sitemenu['users'] = array( |
69 | 69 | 'users', |
70 | 70 | 'main', |
71 | - '<i class="fa fa-users"></i><span class="menu-item-text">' . $_lang['users'] . '</span>', |
|
71 | + '<i class="fa fa-users"></i><span class="menu-item-text">'.$_lang['users'].'</span>', |
|
72 | 72 | 'javascript:;', |
73 | 73 | $_lang['users'], |
74 | 74 | ' return false;', |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | ); |
81 | 81 | } |
82 | 82 | |
83 | -if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
|
83 | +if ($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
|
84 | 84 | $sitemenu['tools'] = array( |
85 | 85 | 'tools', |
86 | 86 | 'main', |
87 | - '<i class="fa fa-wrench"></i><span class="menu-item-text">' . $_lang['tools'] . '</span>', |
|
87 | + '<i class="fa fa-wrench"></i><span class="menu-item-text">'.$_lang['tools'].'</span>', |
|
88 | 88 | 'javascript:;', |
89 | 89 | $_lang['tools'], |
90 | 90 | ' return false;', |
@@ -97,12 +97,12 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | $tab = 0; |
100 | -if($modx->hasPermission('edit_template')) { |
|
100 | +if ($modx->hasPermission('edit_template')) { |
|
101 | 101 | $sitemenu['element_templates'] = array( |
102 | 102 | 'element_templates', |
103 | 103 | 'elements', |
104 | - '<i class="fa fa-newspaper-o"></i>' . $_lang['manage_templates'] . '<i class="fa fa-angle-right toggle"></i>', |
|
105 | - 'index.php?a=76&tab=' . $tab++, |
|
104 | + '<i class="fa fa-newspaper-o"></i>'.$_lang['manage_templates'].'<i class="fa fa-angle-right toggle"></i>', |
|
105 | + 'index.php?a=76&tab='.$tab++, |
|
106 | 106 | $_lang['manage_templates'], |
107 | 107 | '', |
108 | 108 | 'new_template,edit_template', |
@@ -112,12 +112,12 @@ discard block |
||
112 | 112 | 'dropdown-toggle' |
113 | 113 | ); |
114 | 114 | } |
115 | -if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
115 | +if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
116 | 116 | $sitemenu['element_tplvars'] = array( |
117 | 117 | 'element_tplvars', |
118 | 118 | 'elements', |
119 | - '<i class="fa fa-list-alt"></i>' . $_lang['tmplvars'] . '<i class="fa fa-angle-right toggle"></i>', |
|
120 | - 'index.php?a=76&tab=' . $tab++, |
|
119 | + '<i class="fa fa-list-alt"></i>'.$_lang['tmplvars'].'<i class="fa fa-angle-right toggle"></i>', |
|
120 | + 'index.php?a=76&tab='.$tab++, |
|
121 | 121 | $_lang['tmplvars'], |
122 | 122 | '', |
123 | 123 | 'new_template,edit_template', |
@@ -127,12 +127,12 @@ discard block |
||
127 | 127 | 'dropdown-toggle' |
128 | 128 | ); |
129 | 129 | } |
130 | -if($modx->hasPermission('edit_chunk')) { |
|
130 | +if ($modx->hasPermission('edit_chunk')) { |
|
131 | 131 | $sitemenu['element_htmlsnippets'] = array( |
132 | 132 | 'element_htmlsnippets', |
133 | 133 | 'elements', |
134 | - '<i class="fa fa-th-large"></i>' . $_lang['manage_htmlsnippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
135 | - 'index.php?a=76&tab=' . $tab++, |
|
134 | + '<i class="fa fa-th-large"></i>'.$_lang['manage_htmlsnippets'].'<i class="fa fa-angle-right toggle"></i>', |
|
135 | + 'index.php?a=76&tab='.$tab++, |
|
136 | 136 | $_lang['manage_htmlsnippets'], |
137 | 137 | '', |
138 | 138 | 'new_chunk,edit_chunk', |
@@ -142,12 +142,12 @@ discard block |
||
142 | 142 | 'dropdown-toggle' |
143 | 143 | ); |
144 | 144 | } |
145 | -if($modx->hasPermission('edit_snippet')) { |
|
145 | +if ($modx->hasPermission('edit_snippet')) { |
|
146 | 146 | $sitemenu['element_snippets'] = array( |
147 | 147 | 'element_snippets', |
148 | 148 | 'elements', |
149 | - '<i class="fa fa-code"></i>' . $_lang['manage_snippets'] . '<i class="fa fa-angle-right toggle"></i>', |
|
150 | - 'index.php?a=76&tab=' . $tab++, |
|
149 | + '<i class="fa fa-code"></i>'.$_lang['manage_snippets'].'<i class="fa fa-angle-right toggle"></i>', |
|
150 | + 'index.php?a=76&tab='.$tab++, |
|
151 | 151 | $_lang['manage_snippets'], |
152 | 152 | '', |
153 | 153 | 'new_snippet,edit_snippet', |
@@ -157,12 +157,12 @@ discard block |
||
157 | 157 | 'dropdown-toggle' |
158 | 158 | ); |
159 | 159 | } |
160 | -if($modx->hasPermission('edit_plugin')) { |
|
160 | +if ($modx->hasPermission('edit_plugin')) { |
|
161 | 161 | $sitemenu['element_plugins'] = array( |
162 | 162 | 'element_plugins', |
163 | 163 | 'elements', |
164 | - '<i class="fa fa-plug"></i>' . $_lang['manage_plugins'] . '<i class="fa fa-angle-right toggle"></i>', |
|
165 | - 'index.php?a=76&tab=' . $tab++, |
|
164 | + '<i class="fa fa-plug"></i>'.$_lang['manage_plugins'].'<i class="fa fa-angle-right toggle"></i>', |
|
165 | + 'index.php?a=76&tab='.$tab++, |
|
166 | 166 | $_lang['manage_plugins'], |
167 | 167 | '', |
168 | 168 | 'new_plugin,edit_plugin', |
@@ -174,11 +174,11 @@ discard block |
||
174 | 174 | } |
175 | 175 | //$sitemenu['element_categories'] = array('element_categories','elements',$_lang['element_categories'],'index.php?a=76&tab=5',$_lang['element_categories'],'','new_template,edit_template,new_snippet,edit_snippet,new_chunk,edit_chunk,new_plugin,edit_plugin','main',1,60,''); |
176 | 176 | |
177 | -if($modx->hasPermission('file_manager')) { |
|
177 | +if ($modx->hasPermission('file_manager')) { |
|
178 | 178 | $sitemenu['manage_files'] = array( |
179 | 179 | 'manage_files', |
180 | 180 | 'elements', |
181 | - '<i class="fa fa-folder-open-o"></i>' . $_lang['manage_files'], |
|
181 | + '<i class="fa fa-folder-open-o"></i>'.$_lang['manage_files'], |
|
182 | 182 | 'index.php?a=31', |
183 | 183 | $_lang['manage_files'], |
184 | 184 | '', |
@@ -189,11 +189,11 @@ discard block |
||
189 | 189 | '' |
190 | 190 | ); |
191 | 191 | } |
192 | -if($modx->hasPermission('category_manager')) { |
|
192 | +if ($modx->hasPermission('category_manager')) { |
|
193 | 193 | $sitemenu['manage_categories'] = array( |
194 | 194 | 'manage_categories', |
195 | 195 | 'elements', |
196 | - '<i class="fa fa-object-group"></i>' . $_lang['manage_categories'], |
|
196 | + '<i class="fa fa-object-group"></i>'.$_lang['manage_categories'], |
|
197 | 197 | 'index.php?a=120', |
198 | 198 | $_lang['manage_categories'], |
199 | 199 | '', |
@@ -206,11 +206,11 @@ discard block |
||
206 | 206 | } |
207 | 207 | |
208 | 208 | // Modules Menu Items |
209 | -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
|
209 | +if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
|
210 | 210 | $sitemenu['new_module'] = array( |
211 | 211 | 'new_module', |
212 | 212 | 'modules', |
213 | - '<i class="'.$_style['icons_modules'] .'"></i>' . $_lang['module_management'], |
|
213 | + '<i class="'.$_style['icons_modules'].'"></i>'.$_lang['module_management'], |
|
214 | 214 | 'index.php?a=106', |
215 | 215 | $_lang['module_management'], |
216 | 216 | '', |
@@ -222,24 +222,24 @@ discard block |
||
222 | 222 | ); |
223 | 223 | } |
224 | 224 | |
225 | -if($modx->hasPermission('exec_module')) { |
|
226 | - if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
225 | +if ($modx->hasPermission('exec_module')) { |
|
226 | + if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
227 | 227 | $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
228 | - FROM ' . $modx->getFullTableName('site_modules') . ' AS sm |
|
229 | - LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
|
230 | - LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
|
231 | - WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
|
228 | + FROM ' . $modx->getFullTableName('site_modules').' AS sm |
|
229 | + LEFT JOIN ' . $modx->getFullTableName('site_module_access').' AS sma ON sma.module = sm.id |
|
230 | + LEFT JOIN ' . $modx->getFullTableName('member_groups').' AS mg ON sma.usergroup = mg.user_group |
|
231 | + WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID().') AND sm.disabled != 1 AND sm.locked != 1 |
|
232 | 232 | ORDER BY sm.name'); |
233 | 233 | } else { |
234 | 234 | $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
235 | 235 | } |
236 | - if($modx->getDatabase()->getRecordCount($rs)) { |
|
236 | + if ($modx->getDatabase()->getRecordCount($rs)) { |
|
237 | 237 | while ($row = $modx->getDatabase()->getRow($rs)) { |
238 | - $sitemenu['module' . $row['id']] = array( |
|
239 | - 'module' . $row['id'], |
|
238 | + $sitemenu['module'.$row['id']] = array( |
|
239 | + 'module'.$row['id'], |
|
240 | 240 | 'modules', |
241 | - ($row['icon'] != '' ? '<i class="'.$row['icon'].'"></i>' : '<i class="'.$_style['icons_module'].'"></i>') . $row['name'], |
|
242 | - 'index.php?a=112&id=' . $row['id'], |
|
241 | + ($row['icon'] != '' ? '<i class="'.$row['icon'].'"></i>' : '<i class="'.$_style['icons_module'].'"></i>').$row['name'], |
|
242 | + 'index.php?a=112&id='.$row['id'], |
|
243 | 243 | $row['name'], |
244 | 244 | '', |
245 | 245 | '', |
@@ -254,11 +254,11 @@ discard block |
||
254 | 254 | |
255 | 255 | // security menu items (users) |
256 | 256 | |
257 | -if($modx->hasPermission('edit_user')) { |
|
257 | +if ($modx->hasPermission('edit_user')) { |
|
258 | 258 | $sitemenu['user_management_title'] = array( |
259 | 259 | 'user_management_title', |
260 | 260 | 'users', |
261 | - '<i class="fa fa fa-user"></i>' . $_lang['user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
261 | + '<i class="fa fa fa-user"></i>'.$_lang['user_management_title'].'<i class="fa fa-angle-right toggle"></i>', |
|
262 | 262 | 'index.php?a=75', |
263 | 263 | $_lang['user_management_title'], |
264 | 264 | '', |
@@ -270,11 +270,11 @@ discard block |
||
270 | 270 | ); |
271 | 271 | } |
272 | 272 | |
273 | -if($modx->hasPermission('edit_web_user')) { |
|
273 | +if ($modx->hasPermission('edit_web_user')) { |
|
274 | 274 | $sitemenu['web_user_management_title'] = array( |
275 | 275 | 'web_user_management_title', |
276 | 276 | 'users', |
277 | - '<i class="fa fa-users"></i>' . $_lang['web_user_management_title'] . '<i class="fa fa-angle-right toggle"></i>', |
|
277 | + '<i class="fa fa-users"></i>'.$_lang['web_user_management_title'].'<i class="fa fa-angle-right toggle"></i>', |
|
278 | 278 | 'index.php?a=99', |
279 | 279 | $_lang['web_user_management_title'], |
280 | 280 | '', |
@@ -286,11 +286,11 @@ discard block |
||
286 | 286 | ); |
287 | 287 | } |
288 | 288 | |
289 | -if($modx->hasPermission('edit_role')) { |
|
289 | +if ($modx->hasPermission('edit_role')) { |
|
290 | 290 | $sitemenu['role_management_title'] = array( |
291 | 291 | 'role_management_title', |
292 | 292 | 'users', |
293 | - '<i class="fa fa-legal"></i>' . $_lang['role_management_title'], |
|
293 | + '<i class="fa fa-legal"></i>'.$_lang['role_management_title'], |
|
294 | 294 | 'index.php?a=86', |
295 | 295 | $_lang['role_management_title'], |
296 | 296 | '', |
@@ -302,11 +302,11 @@ discard block |
||
302 | 302 | ); |
303 | 303 | } |
304 | 304 | |
305 | -if($modx->hasPermission('access_permissions')) { |
|
305 | +if ($modx->hasPermission('access_permissions')) { |
|
306 | 306 | $sitemenu['manager_permissions'] = array( |
307 | 307 | 'manager_permissions', |
308 | 308 | 'users', |
309 | - '<i class="fa fa-male"></i>' . $_lang['manager_permissions'], |
|
309 | + '<i class="fa fa-male"></i>'.$_lang['manager_permissions'], |
|
310 | 310 | 'index.php?a=40', |
311 | 311 | $_lang['manager_permissions'], |
312 | 312 | '', |
@@ -318,11 +318,11 @@ discard block |
||
318 | 318 | ); |
319 | 319 | } |
320 | 320 | |
321 | -if($modx->hasPermission('web_access_permissions')) { |
|
321 | +if ($modx->hasPermission('web_access_permissions')) { |
|
322 | 322 | $sitemenu['web_permissions'] = array( |
323 | 323 | 'web_permissions', |
324 | 324 | 'users', |
325 | - '<i class="fa fa-universal-access"></i>' . $_lang['web_permissions'], |
|
325 | + '<i class="fa fa-universal-access"></i>'.$_lang['web_permissions'], |
|
326 | 326 | 'index.php?a=91', |
327 | 327 | $_lang['web_permissions'], |
328 | 328 | '', |
@@ -339,7 +339,7 @@ discard block |
||
339 | 339 | $sitemenu['refresh_site'] = array( |
340 | 340 | 'refresh_site', |
341 | 341 | 'tools', |
342 | - '<i class="fa fa-recycle"></i>' . $_lang['refresh_site'], |
|
342 | + '<i class="fa fa-recycle"></i>'.$_lang['refresh_site'], |
|
343 | 343 | 'index.php?a=26', |
344 | 344 | $_lang['refresh_site'], |
345 | 345 | '', |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | 'a', // tag |
354 | 354 | 'javascript:;', // href |
355 | 355 | 'btn btn-secondary', // class or btn-success |
356 | - 'modx.popup({url:\'index.php?a=26\', title:\'' . $_lang['refresh_site'] . '\', icon: \'fa-recycle\', iframe: \'ajax\', selector: \'.tab-page>.container\', position: \'right top\', width: \'auto\', maxheight: \'50%\', wrap: \'body\' })', // onclick |
|
356 | + 'modx.popup({url:\'index.php?a=26\', title:\''.$_lang['refresh_site'].'\', icon: \'fa-recycle\', iframe: \'ajax\', selector: \'.tab-page>.container\', position: \'right top\', width: \'auto\', maxheight: \'50%\', wrap: \'body\' })', // onclick |
|
357 | 357 | $_lang['refresh_site'], // title |
358 | 358 | '<i class="fa fa-recycle"></i>' // innerHTML |
359 | 359 | ) |
@@ -363,7 +363,7 @@ discard block |
||
363 | 363 | $sitemenu['search'] = array( |
364 | 364 | 'search', |
365 | 365 | 'tools', |
366 | - '<i class="fa fa-search"></i>' . $_lang['search'], |
|
366 | + '<i class="fa fa-search"></i>'.$_lang['search'], |
|
367 | 367 | 'index.php?a=71', |
368 | 368 | $_lang['search'], |
369 | 369 | '', |
@@ -374,11 +374,11 @@ discard block |
||
374 | 374 | '' |
375 | 375 | ); |
376 | 376 | |
377 | -if($modx->hasPermission('bk_manager')) { |
|
377 | +if ($modx->hasPermission('bk_manager')) { |
|
378 | 378 | $sitemenu['bk_manager'] = array( |
379 | 379 | 'bk_manager', |
380 | 380 | 'tools', |
381 | - '<i class="fa fa-database"></i>' . $_lang['bk_manager'], |
|
381 | + '<i class="fa fa-database"></i>'.$_lang['bk_manager'], |
|
382 | 382 | 'index.php?a=93', |
383 | 383 | $_lang['bk_manager'], |
384 | 384 | '', |
@@ -390,11 +390,11 @@ discard block |
||
390 | 390 | ); |
391 | 391 | } |
392 | 392 | |
393 | -if($modx->hasPermission('remove_locks')) { |
|
393 | +if ($modx->hasPermission('remove_locks')) { |
|
394 | 394 | $sitemenu['remove_locks'] = array( |
395 | 395 | 'remove_locks', |
396 | 396 | 'tools', |
397 | - '<i class="fa fa-hourglass"></i>' . $_lang['remove_locks'], |
|
397 | + '<i class="fa fa-hourglass"></i>'.$_lang['remove_locks'], |
|
398 | 398 | 'javascript:modx.removeLocks();', |
399 | 399 | $_lang['remove_locks'], |
400 | 400 | '', |
@@ -406,11 +406,11 @@ discard block |
||
406 | 406 | ); |
407 | 407 | } |
408 | 408 | |
409 | -if($modx->hasPermission('import_static')) { |
|
409 | +if ($modx->hasPermission('import_static')) { |
|
410 | 410 | $sitemenu['import_site'] = array( |
411 | 411 | 'import_site', |
412 | 412 | 'tools', |
413 | - '<i class="fa fa-upload"></i>' . $_lang['import_site'], |
|
413 | + '<i class="fa fa-upload"></i>'.$_lang['import_site'], |
|
414 | 414 | 'index.php?a=95', |
415 | 415 | $_lang['import_site'], |
416 | 416 | '', |
@@ -422,11 +422,11 @@ discard block |
||
422 | 422 | ); |
423 | 423 | } |
424 | 424 | |
425 | -if($modx->hasPermission('export_static')) { |
|
425 | +if ($modx->hasPermission('export_static')) { |
|
426 | 426 | $sitemenu['export_site'] = array( |
427 | 427 | 'export_site', |
428 | 428 | 'tools', |
429 | - '<i class="fa fa-download"></i>' . $_lang['export_site'], |
|
429 | + '<i class="fa fa-download"></i>'.$_lang['export_site'], |
|
430 | 430 | 'index.php?a=83', |
431 | 431 | $_lang['export_site'], |
432 | 432 | '', |
@@ -439,20 +439,20 @@ discard block |
||
439 | 439 | } |
440 | 440 | |
441 | 441 | $menu = $modx->invokeEvent("OnManagerMenuPrerender", array('menu' => $sitemenu)); |
442 | -if(is_array($menu)) { |
|
442 | +if (is_array($menu)) { |
|
443 | 443 | $newmenu = array(); |
444 | - foreach($menu as $item){ |
|
445 | - if(is_array(unserialize($item))){ |
|
444 | + foreach ($menu as $item) { |
|
445 | + if (is_array(unserialize($item))) { |
|
446 | 446 | $newmenu = array_merge($newmenu, unserialize($item)); |
447 | 447 | } |
448 | 448 | } |
449 | - if(count($newmenu)> 0) $sitemenu = $newmenu; |
|
449 | + if (count($newmenu) > 0) $sitemenu = $newmenu; |
|
450 | 450 | } |
451 | 451 | |
452 | -if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
|
453 | - include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
|
452 | +if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/includes/menu.class.inc.php')) { |
|
453 | + include_once(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/includes/menu.class.inc.php'); |
|
454 | 454 | } else { |
455 | - include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
|
455 | + include_once(MODX_MANAGER_PATH.'includes/menu.class.inc.php'); |
|
456 | 456 | } |
457 | 457 | $menu = new EVOmenu(); |
458 | 458 | $menu->Build($sitemenu, array( |
@@ -32,7 +32,7 @@ discard block |
||
32 | 32 | 'active' |
33 | 33 | ); |
34 | 34 | |
35 | -if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
|
35 | +if($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('file_manager')) { |
|
36 | 36 | $sitemenu['elements'] = array( |
37 | 37 | 'elements', |
38 | 38 | 'main', |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | ); |
49 | 49 | } |
50 | 50 | |
51 | -if($modx->hasPermission('exec_module')) { |
|
51 | +if($modx->hasPermission('exec_module')) { |
|
52 | 52 | $sitemenu['modules'] = array( |
53 | 53 | 'modules', |
54 | 54 | 'main', |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | ); |
65 | 65 | } |
66 | 66 | |
67 | -if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
|
67 | +if($modx->hasPermission('edit_user') || $modx->hasPermission('edit_web_user') || $modx->hasPermission('edit_role') || $modx->hasPermission('access_permissions') || $modx->hasPermission('web_access_permissions')) { |
|
68 | 68 | $sitemenu['users'] = array( |
69 | 69 | 'users', |
70 | 70 | 'main', |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | ); |
81 | 81 | } |
82 | 82 | |
83 | -if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
|
83 | +if($modx->hasPermission('empty_cache') || $modx->hasPermission('bk_manager') || $modx->hasPermission('remove_locks') || $modx->hasPermission('import_static') || $modx->hasPermission('export_static')) { |
|
84 | 84 | $sitemenu['tools'] = array( |
85 | 85 | 'tools', |
86 | 86 | 'main', |
@@ -97,7 +97,7 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | $tab = 0; |
100 | -if($modx->hasPermission('edit_template')) { |
|
100 | +if($modx->hasPermission('edit_template')) { |
|
101 | 101 | $sitemenu['element_templates'] = array( |
102 | 102 | 'element_templates', |
103 | 103 | 'elements', |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | 'dropdown-toggle' |
113 | 113 | ); |
114 | 114 | } |
115 | -if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
115 | +if($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
116 | 116 | $sitemenu['element_tplvars'] = array( |
117 | 117 | 'element_tplvars', |
118 | 118 | 'elements', |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | 'dropdown-toggle' |
128 | 128 | ); |
129 | 129 | } |
130 | -if($modx->hasPermission('edit_chunk')) { |
|
130 | +if($modx->hasPermission('edit_chunk')) { |
|
131 | 131 | $sitemenu['element_htmlsnippets'] = array( |
132 | 132 | 'element_htmlsnippets', |
133 | 133 | 'elements', |
@@ -142,7 +142,7 @@ discard block |
||
142 | 142 | 'dropdown-toggle' |
143 | 143 | ); |
144 | 144 | } |
145 | -if($modx->hasPermission('edit_snippet')) { |
|
145 | +if($modx->hasPermission('edit_snippet')) { |
|
146 | 146 | $sitemenu['element_snippets'] = array( |
147 | 147 | 'element_snippets', |
148 | 148 | 'elements', |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | 'dropdown-toggle' |
158 | 158 | ); |
159 | 159 | } |
160 | -if($modx->hasPermission('edit_plugin')) { |
|
160 | +if($modx->hasPermission('edit_plugin')) { |
|
161 | 161 | $sitemenu['element_plugins'] = array( |
162 | 162 | 'element_plugins', |
163 | 163 | 'elements', |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | } |
175 | 175 | //$sitemenu['element_categories'] = array('element_categories','elements',$_lang['element_categories'],'index.php?a=76&tab=5',$_lang['element_categories'],'','new_template,edit_template,new_snippet,edit_snippet,new_chunk,edit_chunk,new_plugin,edit_plugin','main',1,60,''); |
176 | 176 | |
177 | -if($modx->hasPermission('file_manager')) { |
|
177 | +if($modx->hasPermission('file_manager')) { |
|
178 | 178 | $sitemenu['manage_files'] = array( |
179 | 179 | 'manage_files', |
180 | 180 | 'elements', |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | '' |
190 | 190 | ); |
191 | 191 | } |
192 | -if($modx->hasPermission('category_manager')) { |
|
192 | +if($modx->hasPermission('category_manager')) { |
|
193 | 193 | $sitemenu['manage_categories'] = array( |
194 | 194 | 'manage_categories', |
195 | 195 | 'elements', |
@@ -206,7 +206,7 @@ discard block |
||
206 | 206 | } |
207 | 207 | |
208 | 208 | // Modules Menu Items |
209 | -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
|
209 | +if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('save_module')) { |
|
210 | 210 | $sitemenu['new_module'] = array( |
211 | 211 | 'new_module', |
212 | 212 | 'modules', |
@@ -222,19 +222,19 @@ discard block |
||
222 | 222 | ); |
223 | 223 | } |
224 | 224 | |
225 | -if($modx->hasPermission('exec_module')) { |
|
226 | - if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
225 | +if($modx->hasPermission('exec_module')) { |
|
226 | + if($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
|
227 | 227 | $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.icon, mg.member |
228 | 228 | FROM ' . $modx->getFullTableName('site_modules') . ' AS sm |
229 | 229 | LEFT JOIN ' . $modx->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
230 | 230 | LEFT JOIN ' . $modx->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
231 | 231 | WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
232 | 232 | ORDER BY sm.name'); |
233 | - } else { |
|
233 | + } else { |
|
234 | 234 | $rs = $modx->getDatabase()->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
235 | 235 | } |
236 | - if($modx->getDatabase()->getRecordCount($rs)) { |
|
237 | - while ($row = $modx->getDatabase()->getRow($rs)) { |
|
236 | + if($modx->getDatabase()->getRecordCount($rs)) { |
|
237 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
238 | 238 | $sitemenu['module' . $row['id']] = array( |
239 | 239 | 'module' . $row['id'], |
240 | 240 | 'modules', |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | |
255 | 255 | // security menu items (users) |
256 | 256 | |
257 | -if($modx->hasPermission('edit_user')) { |
|
257 | +if($modx->hasPermission('edit_user')) { |
|
258 | 258 | $sitemenu['user_management_title'] = array( |
259 | 259 | 'user_management_title', |
260 | 260 | 'users', |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | ); |
271 | 271 | } |
272 | 272 | |
273 | -if($modx->hasPermission('edit_web_user')) { |
|
273 | +if($modx->hasPermission('edit_web_user')) { |
|
274 | 274 | $sitemenu['web_user_management_title'] = array( |
275 | 275 | 'web_user_management_title', |
276 | 276 | 'users', |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | ); |
287 | 287 | } |
288 | 288 | |
289 | -if($modx->hasPermission('edit_role')) { |
|
289 | +if($modx->hasPermission('edit_role')) { |
|
290 | 290 | $sitemenu['role_management_title'] = array( |
291 | 291 | 'role_management_title', |
292 | 292 | 'users', |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | ); |
303 | 303 | } |
304 | 304 | |
305 | -if($modx->hasPermission('access_permissions')) { |
|
305 | +if($modx->hasPermission('access_permissions')) { |
|
306 | 306 | $sitemenu['manager_permissions'] = array( |
307 | 307 | 'manager_permissions', |
308 | 308 | 'users', |
@@ -318,7 +318,7 @@ discard block |
||
318 | 318 | ); |
319 | 319 | } |
320 | 320 | |
321 | -if($modx->hasPermission('web_access_permissions')) { |
|
321 | +if($modx->hasPermission('web_access_permissions')) { |
|
322 | 322 | $sitemenu['web_permissions'] = array( |
323 | 323 | 'web_permissions', |
324 | 324 | 'users', |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | '' |
375 | 375 | ); |
376 | 376 | |
377 | -if($modx->hasPermission('bk_manager')) { |
|
377 | +if($modx->hasPermission('bk_manager')) { |
|
378 | 378 | $sitemenu['bk_manager'] = array( |
379 | 379 | 'bk_manager', |
380 | 380 | 'tools', |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | ); |
391 | 391 | } |
392 | 392 | |
393 | -if($modx->hasPermission('remove_locks')) { |
|
393 | +if($modx->hasPermission('remove_locks')) { |
|
394 | 394 | $sitemenu['remove_locks'] = array( |
395 | 395 | 'remove_locks', |
396 | 396 | 'tools', |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | ); |
407 | 407 | } |
408 | 408 | |
409 | -if($modx->hasPermission('import_static')) { |
|
409 | +if($modx->hasPermission('import_static')) { |
|
410 | 410 | $sitemenu['import_site'] = array( |
411 | 411 | 'import_site', |
412 | 412 | 'tools', |
@@ -422,7 +422,7 @@ discard block |
||
422 | 422 | ); |
423 | 423 | } |
424 | 424 | |
425 | -if($modx->hasPermission('export_static')) { |
|
425 | +if($modx->hasPermission('export_static')) { |
|
426 | 426 | $sitemenu['export_site'] = array( |
427 | 427 | 'export_site', |
428 | 428 | 'tools', |
@@ -439,19 +439,21 @@ discard block |
||
439 | 439 | } |
440 | 440 | |
441 | 441 | $menu = $modx->invokeEvent("OnManagerMenuPrerender", array('menu' => $sitemenu)); |
442 | -if(is_array($menu)) { |
|
442 | +if(is_array($menu)) { |
|
443 | 443 | $newmenu = array(); |
444 | - foreach($menu as $item){ |
|
445 | - if(is_array(unserialize($item))){ |
|
444 | + foreach($menu as $item) { |
|
445 | + if(is_array(unserialize($item))) { |
|
446 | 446 | $newmenu = array_merge($newmenu, unserialize($item)); |
447 | 447 | } |
448 | 448 | } |
449 | - if(count($newmenu)> 0) $sitemenu = $newmenu; |
|
450 | -} |
|
449 | + if(count($newmenu)> 0) { |
|
450 | + $sitemenu = $newmenu; |
|
451 | + } |
|
452 | + } |
|
451 | 453 | |
452 | -if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
|
454 | +if(file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
|
453 | 455 | include_once(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php'); |
454 | -} else { |
|
456 | +} else { |
|
455 | 457 | include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
456 | 458 | } |
457 | 459 | $menu = new EVOmenu(); |
@@ -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 | if (!$modx->hasPermission('file_manager')) { |
@@ -9,15 +9,15 @@ discard block |
||
9 | 9 | $newToken = makeToken(); |
10 | 10 | |
11 | 11 | // settings |
12 | -$theme_image_path = $modx->config['site_manager_url'] . 'media/style/' . $modx->config['manager_theme'] . '/images/'; |
|
12 | +$theme_image_path = $modx->config['site_manager_url'].'media/style/'.$modx->config['manager_theme'].'/images/'; |
|
13 | 13 | $excludes = array( |
14 | 14 | '.', |
15 | 15 | '..', |
16 | 16 | '.svn' |
17 | 17 | ); |
18 | -$alias_suffix = (!empty($friendly_url_suffix)) ? ',' . ltrim($friendly_url_suffix, '.') : ''; |
|
19 | -$editablefiles = explode(',', 'txt,php,tpl,less,sass,shtml,html,htm,xml,js,css,pageCache,htaccess,json,ini' . $alias_suffix); |
|
20 | -$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess,json,ini' . $alias_suffix); |
|
18 | +$alias_suffix = (!empty($friendly_url_suffix)) ? ','.ltrim($friendly_url_suffix, '.') : ''; |
|
19 | +$editablefiles = explode(',', 'txt,php,tpl,less,sass,shtml,html,htm,xml,js,css,pageCache,htaccess,json,ini'.$alias_suffix); |
|
20 | +$inlineviewablefiles = explode(',', 'txt,php,tpl,less,sass,html,htm,xml,js,css,pageCache,htaccess,json,ini'.$alias_suffix); |
|
21 | 21 | $viewablefiles = explode(',', 'jpg,gif,png,ico'); |
22 | 22 | |
23 | 23 | $editablefiles = add_dot($editablefiles); |
@@ -30,31 +30,31 @@ discard block |
||
30 | 30 | { |
31 | 31 | */ |
32 | 32 | $protected_path[] = $modx->config['site_manager_path']; |
33 | -$protected_path[] = $modx->config['base_path'] . 'temp/backup'; |
|
34 | -$protected_path[] = $modx->config['base_path'] . 'assets/backup'; |
|
33 | +$protected_path[] = $modx->config['base_path'].'temp/backup'; |
|
34 | +$protected_path[] = $modx->config['base_path'].'assets/backup'; |
|
35 | 35 | |
36 | 36 | if (!$modx->hasPermission('save_plugin')) { |
37 | - $protected_path[] = $modx->config['base_path'] . 'assets/plugins'; |
|
37 | + $protected_path[] = $modx->config['base_path'].'assets/plugins'; |
|
38 | 38 | } |
39 | 39 | if (!$modx->hasPermission('save_snippet')) { |
40 | - $protected_path[] = $modx->config['base_path'] . 'assets/snippets'; |
|
40 | + $protected_path[] = $modx->config['base_path'].'assets/snippets'; |
|
41 | 41 | } |
42 | 42 | if (!$modx->hasPermission('save_template')) { |
43 | - $protected_path[] = $modx->config['base_path'] . 'assets/templates'; |
|
43 | + $protected_path[] = $modx->config['base_path'].'assets/templates'; |
|
44 | 44 | } |
45 | 45 | if (!$modx->hasPermission('save_module')) { |
46 | - $protected_path[] = $modx->config['base_path'] . 'assets/modules'; |
|
46 | + $protected_path[] = $modx->config['base_path'].'assets/modules'; |
|
47 | 47 | } |
48 | 48 | if (!$modx->hasPermission('empty_cache')) { |
49 | - $protected_path[] = $modx->config['base_path'] . 'assets/cache'; |
|
49 | + $protected_path[] = $modx->config['base_path'].'assets/cache'; |
|
50 | 50 | } |
51 | 51 | if (!$modx->hasPermission('import_static')) { |
52 | - $protected_path[] = $modx->config['base_path'] . 'temp/import'; |
|
53 | - $protected_path[] = $modx->config['base_path'] . 'assets/import'; |
|
52 | + $protected_path[] = $modx->config['base_path'].'temp/import'; |
|
53 | + $protected_path[] = $modx->config['base_path'].'assets/import'; |
|
54 | 54 | } |
55 | 55 | if (!$modx->hasPermission('export_static')) { |
56 | - $protected_path[] = $modx->config['base_path'] . 'temp/export'; |
|
57 | - $protected_path[] = $modx->config['base_path'] . 'assets/export'; |
|
56 | + $protected_path[] = $modx->config['base_path'].'temp/export'; |
|
57 | + $protected_path[] = $modx->config['base_path'].'assets/export'; |
|
58 | 58 | } |
59 | 59 | /* |
60 | 60 | } |
@@ -96,15 +96,15 @@ discard block |
||
96 | 96 | $rw = realpath('../'); |
97 | 97 | $webstart_path = str_replace('\\', '/', str_replace($rw, '', $rf)); |
98 | 98 | if (substr($webstart_path, 0, 1) == '/') { |
99 | - $webstart_path = '..' . $webstart_path; |
|
99 | + $webstart_path = '..'.$webstart_path; |
|
100 | 100 | } else { |
101 | - $webstart_path = '../' . $webstart_path; |
|
101 | + $webstart_path = '../'.$webstart_path; |
|
102 | 102 | } |
103 | 103 | |
104 | 104 | ?> |
105 | 105 | <script type="text/javascript"> |
106 | 106 | |
107 | - var current_path = '<?= $startpath;?>'; |
|
107 | + var current_path = '<?= $startpath; ?>'; |
|
108 | 108 | |
109 | 109 | function viewfile (url) |
110 | 110 | { |
@@ -140,7 +140,7 @@ discard block |
||
140 | 140 | function unzipFile (file) |
141 | 141 | { |
142 | 142 | if (confirmUnzip()) { |
143 | - window.location.href = "index.php?a=31&mode=unzip&path=" + current_path + '/&file=' + file + "&token=<?= $newToken;?>"; |
|
143 | + window.location.href = "index.php?a=31&mode=unzip&path=" + current_path + '/&file=' + file + "&token=<?= $newToken; ?>"; |
|
144 | 144 | return false; |
145 | 145 | } |
146 | 146 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | function deleteFolder (folder, status) |
163 | 163 | { |
164 | 164 | if (confirmDeleteFolder(status)) { |
165 | - window.location.href = "index.php?a=31&mode=deletefolder&path=" + current_path + "&folderpath=" + current_path + '/' + folder + "&token=<?= $newToken;?>"; |
|
165 | + window.location.href = "index.php?a=31&mode=deletefolder&path=" + current_path + "&folderpath=" + current_path + '/' + folder + "&token=<?= $newToken; ?>"; |
|
166 | 166 | return false; |
167 | 167 | } |
168 | 168 | } |
@@ -170,7 +170,7 @@ discard block |
||
170 | 170 | function deleteFile (file) |
171 | 171 | { |
172 | 172 | if (confirmDelete()) { |
173 | - window.location.href = "index.php?a=31&mode=delete&path=" + current_path + '/' + file + "&token=<?= $newToken;?>"; |
|
173 | + window.location.href = "index.php?a=31&mode=delete&path=" + current_path + '/' + file + "&token=<?= $newToken; ?>"; |
|
174 | 174 | return false; |
175 | 175 | } |
176 | 176 | } |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | { |
180 | 180 | var newFilename = prompt("<?= $_lang["files_dynamic_new_file_name"] ?>", file); |
181 | 181 | if (newFilename !== null && newFilename !== file) { |
182 | - window.location.href = "index.php?a=31&mode=duplicate&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken;?>"; |
|
182 | + window.location.href = "index.php?a=31&mode=duplicate&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken; ?>"; |
|
183 | 183 | } |
184 | 184 | } |
185 | 185 | |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | { |
188 | 188 | var newDirname = prompt("<?= $_lang["files_dynamic_new_folder_name"] ?>", dir); |
189 | 189 | if (newDirname !== null && newDirname !== dir) { |
190 | - window.location.href = "index.php?a=31&mode=renameFolder&path=" + current_path + '&dirname=' + dir + "&newDirname=" + newDirname + "&token=<?= $newToken;?>"; |
|
190 | + window.location.href = "index.php?a=31&mode=renameFolder&path=" + current_path + '&dirname=' + dir + "&newDirname=" + newDirname + "&token=<?= $newToken; ?>"; |
|
191 | 191 | } |
192 | 192 | } |
193 | 193 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | { |
196 | 196 | var newFilename = prompt("<?= $_lang["files_dynamic_new_file_name"] ?>", file); |
197 | 197 | if (newFilename !== null && newFilename !== file) { |
198 | - window.location.href = "index.php?a=31&mode=renameFile&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken;?>"; |
|
198 | + window.location.href = "index.php?a=31&mode=renameFile&path=" + current_path + '/' + file + "&newFilename=" + newFilename + "&token=<?= $newToken; ?>"; |
|
199 | 199 | } |
200 | 200 | } |
201 | 201 | |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | <?php endif ?> |
215 | 215 | <?php |
216 | 216 | if (isset($_GET['mode']) && $_GET['mode'] !== 'drill') { |
217 | - $href = 'a=31&path=' . urlencode($_REQUEST['path']); |
|
217 | + $href = 'a=31&path='.urlencode($_REQUEST['path']); |
|
218 | 218 | } else { |
219 | 219 | $href = 'a=2'; |
220 | 220 | } |
@@ -224,12 +224,12 @@ discard block |
||
224 | 224 | $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFolderName(this);"><i class="[+image+]"></i><span>[+subject+]</span></a>'; |
225 | 225 | $ph['image'] = $_style['files_folder-open']; |
226 | 226 | $ph['subject'] = $_lang['add_folder']; |
227 | - $ph['href'] = 'index.php?a=31&mode=newfolder&path=' . urlencode($startpath) . '&name='; |
|
227 | + $ph['href'] = 'index.php?a=31&mode=newfolder&path='.urlencode($startpath).'&name='; |
|
228 | 228 | $_ = parsePlaceholder($tpl, $ph); |
229 | 229 | |
230 | - $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFileName(this);"><i class="[+image+]"></i><span>' . $_lang['files.dynamic.php1'] . '</span></a>'; |
|
230 | + $tpl = '<a class="btn btn-secondary" href="[+href+]" onclick="return getFileName(this);"><i class="[+image+]"></i><span>'.$_lang['files.dynamic.php1'].'</span></a>'; |
|
231 | 231 | $ph['image'] = $_style['files_page_html']; |
232 | - $ph['href'] = 'index.php?a=31&mode=newfile&path=' . urlencode($startpath) . '&name='; |
|
232 | + $ph['href'] = 'index.php?a=31&mode=newfile&path='.urlencode($startpath).'&name='; |
|
233 | 233 | $_ .= parsePlaceholder($tpl, $ph); |
234 | 234 | echo $_; |
235 | 235 | } |
@@ -259,12 +259,12 @@ discard block |
||
259 | 259 | $ph = array(); |
260 | 260 | $ph['style_path'] = $theme_image_path; |
261 | 261 | // To Top Level with folder icon to the left |
262 | - if ($startpath == $filemanager_path || $startpath . '/' == $filemanager_path) { |
|
263 | - $ph['image'] = '' . $_style['files_top'] . ''; |
|
262 | + if ($startpath == $filemanager_path || $startpath.'/' == $filemanager_path) { |
|
263 | + $ph['image'] = ''.$_style['files_top'].''; |
|
264 | 264 | $ph['subject'] = '<span>Top</span>'; |
265 | 265 | } else { |
266 | - $ph['image'] = '' . $_style['files_top'] . ''; |
|
267 | - $ph['subject'] = '<a href="index.php?a=31&mode=drill&path=' . $filemanager_path . '">Top</a>/'; |
|
266 | + $ph['image'] = ''.$_style['files_top'].''; |
|
267 | + $ph['subject'] = '<a href="index.php?a=31&mode=drill&path='.$filemanager_path.'">Top</a>/'; |
|
268 | 268 | } |
269 | 269 | |
270 | 270 | echo parsePlaceholder($tpl, $ph); |
@@ -281,12 +281,12 @@ discard block |
||
281 | 281 | if (empty($v)) { |
282 | 282 | continue; |
283 | 283 | } |
284 | - $path .= rtrim($v, '/') . '/'; |
|
284 | + $path .= rtrim($v, '/').'/'; |
|
285 | 285 | if (1 < $count) { |
286 | - $href = 'index.php?a=31&mode=drill&path=' . urlencode($filemanager_path . $path); |
|
287 | - $pieces[$i] = '<a href="' . $href . '">' . trim($v, '/') . '</a>'; |
|
286 | + $href = 'index.php?a=31&mode=drill&path='.urlencode($filemanager_path.$path); |
|
287 | + $pieces[$i] = '<a href="'.$href.'">'.trim($v, '/').'</a>'; |
|
288 | 288 | } else { |
289 | - $pieces[$i] = '<span>' . trim($v, '/') . '</span>'; |
|
289 | + $pieces[$i] = '<span>'.trim($v, '/').'</span>'; |
|
290 | 290 | } |
291 | 291 | $count--; |
292 | 292 | } |
@@ -299,16 +299,16 @@ discard block |
||
299 | 299 | </div> |
300 | 300 | <?php |
301 | 301 | // check to see user isn't trying to move below the document_root |
302 | - if (substr(strtolower(str_replace('//', '/', $startpath . "/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path . '/'))) { |
|
302 | + if (substr(strtolower(str_replace('//', '/', $startpath."/")), 0, $len) != strtolower(str_replace('//', '/', $filemanager_path.'/'))) { |
|
303 | 303 | $modx->webAlertAndQuit($_lang["files_access_denied"]); |
304 | 304 | } |
305 | 305 | |
306 | 306 | // Unzip .zip files - by Raymond |
307 | 307 | if ($enablefileunzip && $_REQUEST['mode'] == 'unzip' && is_writable($startpath)) { |
308 | - if (!$err = unzip(realpath("{$startpath}/" . $_REQUEST['file']), realpath($startpath))) { |
|
309 | - echo '<span class="warning"><b>' . $_lang['file_unzip_fail'] . ($err === 0 ? 'Missing zip library (php_zip.dll / zip.so)' : '') . '</b></span><br /><br />'; |
|
308 | + if (!$err = unzip(realpath("{$startpath}/".$_REQUEST['file']), realpath($startpath))) { |
|
309 | + echo '<span class="warning"><b>'.$_lang['file_unzip_fail'].($err === 0 ? 'Missing zip library (php_zip.dll / zip.so)' : '').'</b></span><br /><br />'; |
|
310 | 310 | } else { |
311 | - echo '<span class="success"><b>' . $_lang['file_unzip'] . '</b></span><br /><br />'; |
|
311 | + echo '<span class="success"><b>'.$_lang['file_unzip'].'</b></span><br /><br />'; |
|
312 | 312 | } |
313 | 313 | } |
314 | 314 | // End Unzip - Raymond |
@@ -320,9 +320,9 @@ discard block |
||
320 | 320 | if ($_REQUEST['mode'] == 'deletefolder') { |
321 | 321 | $folder = $_REQUEST['folderpath']; |
322 | 322 | if (!$token_check || !@rrmdir($folder)) { |
323 | - echo '<span class="warning"><b>' . $_lang['file_folder_not_deleted'] . '</b></span><br /><br />'; |
|
323 | + echo '<span class="warning"><b>'.$_lang['file_folder_not_deleted'].'</b></span><br /><br />'; |
|
324 | 324 | } else { |
325 | - echo '<span class="success"><b>' . $_lang['file_folder_deleted'] . '</b></span><br /><br />'; |
|
325 | + echo '<span class="success"><b>'.$_lang['file_folder_deleted'].'</b></span><br /><br />'; |
|
326 | 326 | } |
327 | 327 | } |
328 | 328 | |
@@ -333,10 +333,10 @@ discard block |
||
333 | 333 | if (!mkdirs("{$startpath}/{$foldername}", 0777)) { |
334 | 334 | echo '<span class="warning"><b>', $_lang['file_folder_not_created'], '</b></span><br /><br />'; |
335 | 335 | } else { |
336 | - if (!@chmod($startpath . '/' . $foldername, $newfolderaccessmode)) { |
|
337 | - echo '<span class="warning"><b>' . $_lang['file_folder_chmod_error'] . '</b></span><br /><br />'; |
|
336 | + if (!@chmod($startpath.'/'.$foldername, $newfolderaccessmode)) { |
|
337 | + echo '<span class="warning"><b>'.$_lang['file_folder_chmod_error'].'</b></span><br /><br />'; |
|
338 | 338 | } else { |
339 | - echo '<span class="success"><b>' . $_lang['file_folder_created'] . '</b></span><br /><br />'; |
|
339 | + echo '<span class="success"><b>'.$_lang['file_folder_created'].'</b></span><br /><br />'; |
|
340 | 340 | } |
341 | 341 | } |
342 | 342 | umask($old_umask); |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | $filename = $modx->getDatabase()->escape($filename); |
349 | 349 | |
350 | 350 | if (!checkExtension($filename)) { |
351 | - echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />'; |
|
351 | + echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />'; |
|
352 | 352 | } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $filename) !== 0) { |
353 | 353 | echo $_lang['files.dynamic.php3']; |
354 | 354 | } else { |
@@ -370,11 +370,11 @@ discard block |
||
370 | 370 | $newFilename = $modx->getDatabase()->escape($newFilename); |
371 | 371 | |
372 | 372 | if (!checkExtension($newFilename)) { |
373 | - echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />'; |
|
373 | + echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />'; |
|
374 | 374 | } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) { |
375 | 375 | echo $_lang['files.dynamic.php3']; |
376 | 376 | } else { |
377 | - if (!copy($filename, MODX_BASE_PATH . $newFilename)) { |
|
377 | + if (!copy($filename, MODX_BASE_PATH.$newFilename)) { |
|
378 | 378 | echo $_lang['files.dynamic.php5']; |
379 | 379 | } |
380 | 380 | umask($old_umask); |
@@ -383,7 +383,7 @@ discard block |
||
383 | 383 | // Rename folder here |
384 | 384 | if ($_REQUEST['mode'] == 'renameFolder') { |
385 | 385 | $old_umask = umask(0); |
386 | - $dirname = $_REQUEST['path'] . '/' . $_REQUEST['dirname']; |
|
386 | + $dirname = $_REQUEST['path'].'/'.$_REQUEST['dirname']; |
|
387 | 387 | $dirname = $modx->getDatabase()->escape($dirname); |
388 | 388 | $newDirname = str_replace(array( |
389 | 389 | '..\\', |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | |
396 | 396 | if (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newDirname) !== 0) { |
397 | 397 | echo $_lang['files.dynamic.php3']; |
398 | - } else if (!rename($dirname, $_REQUEST['path'] . '/' . $newDirname)) { |
|
398 | + } else if (!rename($dirname, $_REQUEST['path'].'/'.$newDirname)) { |
|
399 | 399 | echo '<span class="warning"><b>', $_lang['file_folder_not_created'], '</b></span><br /><br />'; |
400 | 400 | } |
401 | 401 | umask($old_umask); |
@@ -415,11 +415,11 @@ discard block |
||
415 | 415 | $newFilename = $modx->getDatabase()->escape($newFilename); |
416 | 416 | |
417 | 417 | if (!checkExtension($newFilename)) { |
418 | - echo '<span class="warning"><b>' . $_lang['files_filetype_notok'] . '</b></span><br /><br />'; |
|
418 | + echo '<span class="warning"><b>'.$_lang['files_filetype_notok'].'</b></span><br /><br />'; |
|
419 | 419 | } elseif (preg_match('@(\\\\|\/|\:|\;|\,|\*|\?|\"|\<|\>|\||\?)@', $newFilename) !== 0) { |
420 | 420 | echo $_lang['files.dynamic.php3']; |
421 | 421 | } else { |
422 | - if (!rename($filename, $path . '/' . $newFilename)) { |
|
422 | + if (!rename($filename, $path.'/'.$newFilename)) { |
|
423 | 423 | echo $_lang['files.dynamic.php5']; |
424 | 424 | } |
425 | 425 | umask($old_umask); |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | ls($startpath); |
453 | 453 | echo "\n\n\n"; |
454 | 454 | if ($folders == 0 && $files == 0) { |
455 | - echo '<tr><td colspan="4"><i class="' . $_style['files_deleted_folder'] . ' FilesDeletedFolder"></i> <span style="color:#888;cursor:default;"> ' . $_lang['files_directory_is_empty'] . ' </span></td></tr>'; |
|
455 | + echo '<tr><td colspan="4"><i class="'.$_style['files_deleted_folder'].' FilesDeletedFolder"></i> <span style="color:#888;cursor:default;"> '.$_lang['files_directory_is_empty'].' </span></td></tr>'; |
|
456 | 456 | } |
457 | 457 | ?> |
458 | 458 | </table> |
@@ -461,10 +461,10 @@ discard block |
||
461 | 461 | <div class="container"> |
462 | 462 | <p> |
463 | 463 | <?php |
464 | - echo $_lang['files_directories'] . ': <b>' . $folders . '</b> '; |
|
465 | - echo $_lang['files_files'] . ': <b>' . $files . '</b> '; |
|
466 | - echo $_lang['files_data'] . ': <b><span dir="ltr">' . $modx->nicesize($filesizes) . '</span></b> '; |
|
467 | - echo $_lang['files_dirwritable'] . ' <b>' . (is_writable($startpath) == 1 ? $_lang['yes'] . '.' : $_lang['no']) . '.</b>' |
|
464 | + echo $_lang['files_directories'].': <b>'.$folders.'</b> '; |
|
465 | + echo $_lang['files_files'].': <b>'.$files.'</b> '; |
|
466 | + echo $_lang['files_data'].': <b><span dir="ltr">'.$modx->nicesize($filesizes).'</span></b> '; |
|
467 | + echo $_lang['files_dirwritable'].' <b>'.(is_writable($startpath) == 1 ? $_lang['yes'].'.' : $_lang['no']).'.</b>' |
|
468 | 468 | ?> |
469 | 469 | </p> |
470 | 470 | |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | </form> |
490 | 490 | <?php |
491 | 491 | } else { |
492 | - echo "<p>" . $_lang['files_upload_inhibited_msg'] . "</p>"; |
|
492 | + echo "<p>".$_lang['files_upload_inhibited_msg']."</p>"; |
|
493 | 493 | } |
494 | 494 | ?> |
495 | 495 | <div id="imageviewer"></div> |