@@ -45,7 +45,7 @@ discard block |
||
45 | 45 | * ----------------------------- |
46 | 46 | */ |
47 | 47 | |
48 | -$autoloader = __DIR__ . '/vendor/autoload.php'; |
|
48 | +$autoloader = __DIR__.'/vendor/autoload.php'; |
|
49 | 49 | if (file_exists($autoloader) && is_readable($autoloader)) { |
50 | 50 | include_once($autoloader); |
51 | 51 | } |
@@ -54,15 +54,15 @@ discard block |
||
54 | 54 | $_SERVER['REQUEST_TIME_FLOAT'] = microtime(true); |
55 | 55 | } |
56 | 56 | |
57 | -$base_path = str_replace('\\', '/', dirname(__FILE__)) . '/'; |
|
58 | -if (is_file($base_path . 'assets/cache/siteManager.php')) { |
|
59 | - include_once($base_path . 'assets/cache/siteManager.php'); |
|
57 | +$base_path = str_replace('\\', '/', dirname(__FILE__)).'/'; |
|
58 | +if (is_file($base_path.'assets/cache/siteManager.php')) { |
|
59 | + include_once($base_path.'assets/cache/siteManager.php'); |
|
60 | 60 | } |
61 | 61 | if (!defined('MGR_DIR') && is_dir("{$base_path}manager")) { |
62 | 62 | define('MGR_DIR', 'manager'); |
63 | 63 | } |
64 | -if (is_file($base_path . 'assets/cache/siteHostnames.php')) { |
|
65 | - include_once($base_path . 'assets/cache/siteHostnames.php'); |
|
64 | +if (is_file($base_path.'assets/cache/siteHostnames.php')) { |
|
65 | + include_once($base_path.'assets/cache/siteHostnames.php'); |
|
66 | 66 | } |
67 | 67 | if (!defined('MODX_SITE_HOSTNAMES')) { |
68 | 68 | define('MODX_SITE_HOSTNAMES', ''); |
@@ -72,7 +72,7 @@ discard block |
||
72 | 72 | $mstart = memory_get_usage(); |
73 | 73 | |
74 | 74 | // harden it |
75 | -require_once(dirname(__FILE__) . '/' . MGR_DIR . '/includes/protect.inc.php'); |
|
75 | +require_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/protect.inc.php'); |
|
76 | 76 | |
77 | 77 | // set some settings, and address some IE issues |
78 | 78 | @ini_set('url_rewriter.tags', ''); |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | */ |
90 | 90 | |
91 | 91 | define('IN_PARSER_MODE', true); |
92 | -if (! defined('IN_MANAGER_MODE')) { |
|
92 | +if (!defined('IN_MANAGER_MODE')) { |
|
93 | 93 | define('IN_MANAGER_MODE', false); |
94 | 94 | } |
95 | 95 | if (!defined('MODX_API_MODE')) { |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | } |
98 | 98 | |
99 | 99 | // get the required includes |
100 | -if (!isset($database_user) || $database_user=="") { |
|
101 | - $rt = @include_once(dirname(__FILE__) . '/' . MGR_DIR . '/includes/config.inc.php'); |
|
100 | +if (!isset($database_user) || $database_user == "") { |
|
101 | + $rt = @include_once(dirname(__FILE__).'/'.MGR_DIR.'/includes/config.inc.php'); |
|
102 | 102 | // Be sure config.inc.php is there and that it contains some important values |
103 | 103 | if (!$rt || !$database_type || !$database_server || !$database_user || !$dbase) { |
104 | 104 | readfile('install/not_installed.tpl'); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | $modx = new $coreClass; |
115 | 115 | } |
116 | 116 | if (!isset($modx) || !($modx instanceof \DocumentParser)) { |
117 | - include_once(MODX_MANAGER_PATH . 'includes/document.parser.class.inc.php'); |
|
117 | + include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); |
|
118 | 118 | $modx = DocumentParser::getInstance(); |
119 | 119 | } |
120 | 120 |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * content |
49 | 49 | */ |
50 | 50 | |
51 | -$autoloader = realpath(__DIR__ . '/../vendor/autoload.php'); |
|
51 | +$autoloader = realpath(__DIR__.'/../vendor/autoload.php'); |
|
52 | 52 | if (file_exists($autoloader) && is_readable($autoloader)) { |
53 | 53 | include_once($autoloader); |
54 | 54 | } |
@@ -58,17 +58,17 @@ discard block |
||
58 | 58 | $mstart = memory_get_usage(); |
59 | 59 | $self = str_replace('\\', '/', __FILE__); |
60 | 60 | $self_dir = str_replace('/index.php', '', $self); |
61 | -$mgr_dir = substr($self_dir, strrpos($self_dir, '/')+1); |
|
62 | -$base_path = str_replace($mgr_dir . '/index.php', '', $self); |
|
63 | -$site_mgr_path = $base_path . 'assets/cache/siteManager.php'; |
|
61 | +$mgr_dir = substr($self_dir, strrpos($self_dir, '/') + 1); |
|
62 | +$base_path = str_replace($mgr_dir.'/index.php', '', $self); |
|
63 | +$site_mgr_path = $base_path.'assets/cache/siteManager.php'; |
|
64 | 64 | if (is_file($site_mgr_path)) { |
65 | 65 | include_once($site_mgr_path); |
66 | 66 | } |
67 | -$site_hostnames_path = $base_path . 'assets/cache/siteHostnames.php'; |
|
67 | +$site_hostnames_path = $base_path.'assets/cache/siteHostnames.php'; |
|
68 | 68 | if (is_file($site_hostnames_path)) { |
69 | 69 | include_once($site_hostnames_path); |
70 | 70 | } |
71 | -if (!defined('MGR_DIR') || MGR_DIR!==$mgr_dir) { |
|
71 | +if (!defined('MGR_DIR') || MGR_DIR !== $mgr_dir) { |
|
72 | 72 | $src = "<?php\n"; |
73 | 73 | $src .= "define('MGR_DIR', '{$mgr_dir}');\n"; |
74 | 74 | $rs = file_put_contents($site_mgr_path, $src); |
@@ -77,13 +77,13 @@ discard block |
||
77 | 77 | exit; |
78 | 78 | } |
79 | 79 | sleep(1); |
80 | - header('Location:' . $_SERVER['REQUEST_URI']); |
|
80 | + header('Location:'.$_SERVER['REQUEST_URI']); |
|
81 | 81 | exit; |
82 | 82 | } |
83 | 83 | |
84 | 84 | // we use this to make sure files are accessed through |
85 | 85 | // the manager instead of seperately. |
86 | -if (! defined('IN_MANAGER_MODE')) { |
|
86 | +if (!defined('IN_MANAGER_MODE')) { |
|
87 | 87 | define('IN_MANAGER_MODE', true); |
88 | 88 | } |
89 | 89 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | |
93 | 93 | // send anti caching headers |
94 | 94 | header("Expires: Mon, 26 Jul 1997 05:00:00 GMT"); |
95 | -header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT"); |
|
95 | +header("Last-Modified: ".gmdate("D, d M Y H:i:s")." GMT"); |
|
96 | 96 | header("Cache-Control: no-store, no-cache, must-revalidate"); |
97 | 97 | header("Cache-Control: post-check=0, pre-check=0", false); |
98 | 98 | header("Pragma: no-cache"); |
@@ -104,7 +104,7 @@ discard block |
||
104 | 104 | include_once "includes/lang/english.inc.php"; |
105 | 105 | |
106 | 106 | // check PHP version. EVO is compatible with php 5 (5.0.0+) |
107 | -$php_ver_comp = version_compare(phpversion(), "5.0.0"); |
|
107 | +$php_ver_comp = version_compare(phpversion(), "5.0.0"); |
|
108 | 108 | // -1 if left is less, 0 if equal, +1 if left is higher |
109 | 109 | if ($php_ver_comp < 0) { |
110 | 110 | echo sprintf($_lang['php_version_check'], phpversion()); |
@@ -118,8 +118,8 @@ discard block |
||
118 | 118 | } |
119 | 119 | |
120 | 120 | // set some runtime options |
121 | -$incPath = str_replace("\\", "/", dirname(__FILE__) . "/includes/"); // Mod by Raymond |
|
122 | -set_include_path(get_include_path() . PATH_SEPARATOR . $incPath); |
|
121 | +$incPath = str_replace("\\", "/", dirname(__FILE__)."/includes/"); // Mod by Raymond |
|
122 | +set_include_path(get_include_path().PATH_SEPARATOR.$incPath); |
|
123 | 123 | |
124 | 124 | if (!defined('ENT_COMPAT')) { |
125 | 125 | define('ENT_COMPAT', 2); |
@@ -133,7 +133,7 @@ discard block |
||
133 | 133 | |
134 | 134 | // set the document_root :| |
135 | 135 | if (!isset($_SERVER['DOCUMENT_ROOT']) || empty($_SERVER['DOCUMENT_ROOT'])) { |
136 | - $_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['PATH_INFO'], "", preg_replace("/\\\\/", "/", $_SERVER['PATH_TRANSLATED'])) . "/"; |
|
136 | + $_SERVER['DOCUMENT_ROOT'] = str_replace($_SERVER['PATH_INFO'], "", preg_replace("/\\\\/", "/", $_SERVER['PATH_TRANSLATED']))."/"; |
|
137 | 137 | } |
138 | 138 | |
139 | 139 | // include_once config file |
@@ -152,7 +152,7 @@ discard block |
||
152 | 152 | $modx = new $coreClass; |
153 | 153 | } |
154 | 154 | if (!isset($modx) || !($modx instanceof DocumentParser)) { |
155 | - include_once(MODX_MANAGER_PATH . 'includes/document.parser.class.inc.php'); |
|
155 | + include_once(MODX_MANAGER_PATH.'includes/document.parser.class.inc.php'); |
|
156 | 156 | $modx = evolutionCMS(); |
157 | 157 | } |
158 | 158 | |
@@ -171,35 +171,35 @@ discard block |
||
171 | 171 | // Now that session is given get user settings and merge into $modx->config |
172 | 172 | $usersettings = $modx->getUserSettings(); |
173 | 173 | |
174 | -$settings =& $modx->config; |
|
174 | +$settings = & $modx->config; |
|
175 | 175 | extract($modx->config, EXTR_OVERWRITE); |
176 | 176 | |
177 | 177 | // now include_once different language file as english |
178 | -if (!isset($manager_language) || !file_exists(MODX_MANAGER_PATH . "includes/lang/" . $manager_language . ".inc.php")) { |
|
178 | +if (!isset($manager_language) || !file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) { |
|
179 | 179 | $manager_language = "english"; // if not set, get the english language file. |
180 | 180 | } |
181 | 181 | |
182 | 182 | // $length_eng_lang = count($_lang); // Not used for now, required for difference-check with other languages than english (i.e. inside installer) |
183 | 183 | |
184 | -if ($manager_language!="english" && file_exists(MODX_MANAGER_PATH . "includes/lang/" . $manager_language . ".inc.php")) { |
|
185 | - include_once "lang/" . $manager_language . ".inc.php"; |
|
184 | +if ($manager_language != "english" && file_exists(MODX_MANAGER_PATH."includes/lang/".$manager_language.".inc.php")) { |
|
185 | + include_once "lang/".$manager_language.".inc.php"; |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | // allow custom language overrides not altered by future EVO-updates |
189 | -if (file_exists(MODX_MANAGER_PATH . "includes/lang/override/" . $manager_language . ".inc.php")) { |
|
190 | - include_once "lang/override/" . $manager_language . ".inc.php"; |
|
189 | +if (file_exists(MODX_MANAGER_PATH."includes/lang/override/".$manager_language.".inc.php")) { |
|
190 | + include_once "lang/override/".$manager_language.".inc.php"; |
|
191 | 191 | } |
192 | 192 | |
193 | 193 | $s = array('[+MGR_DIR+]'); |
194 | 194 | $r = array(MGR_DIR); |
195 | 195 | foreach ($_lang as $k=>$v) { |
196 | - if (strpos($v, '[+')!==false) { |
|
196 | + if (strpos($v, '[+') !== false) { |
|
197 | 197 | $_lang[$k] = str_replace($s, $r, $v); |
198 | 198 | } |
199 | 199 | } |
200 | 200 | |
201 | 201 | // send the charset header |
202 | -header('Content-Type: text/html; charset=' . $modx_manager_charset); |
|
202 | +header('Content-Type: text/html; charset='.$modx_manager_charset); |
|
203 | 203 | |
204 | 204 | /* |
205 | 205 | * include_once "version.inc.php"; //include version info. Use $modx->getVersionData() |
@@ -217,11 +217,11 @@ discard block |
||
217 | 217 | // include_once the style variables file |
218 | 218 | if (isset($manager_theme) && !isset($_style)) { |
219 | 219 | $_style = array(); |
220 | - include_once "media/style/" . $manager_theme . "/style.php"; |
|
220 | + include_once "media/style/".$manager_theme."/style.php"; |
|
221 | 221 | } |
222 | 222 | |
223 | 223 | // check if user is allowed to access manager interface |
224 | -if (isset($allow_manager_access) && $allow_manager_access==0) { |
|
224 | +if (isset($allow_manager_access) && $allow_manager_access == 0) { |
|
225 | 225 | include_once "manager.lockout.inc.php"; |
226 | 226 | } |
227 | 227 | |
@@ -234,8 +234,8 @@ discard block |
||
234 | 234 | // first we check to see if this is a frameset request |
235 | 235 | if (!isset($_POST['a']) && !isset($_GET['a']) && !isset($_POST['updateMsgCount'])) { |
236 | 236 | // this looks to be a top-level frameset request, so let's serve up a frameset |
237 | - if (is_file(MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/frames/1.php")) { |
|
238 | - include_once "media/style/" . $manager_theme . "/frames/1.php"; |
|
237 | + if (is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) { |
|
238 | + include_once "media/style/".$manager_theme."/frames/1.php"; |
|
239 | 239 | } else { |
240 | 240 | include_once "frames/1.php"; |
241 | 241 | } |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | } |
244 | 244 | |
245 | 245 | // OK, let's retrieve the action directive from the request |
246 | -$option = array('min_range'=>1,'max_range'=>2000); |
|
246 | +$option = array('min_range'=>1, 'max_range'=>2000); |
|
247 | 247 | if (isset($_GET['a']) && isset($_POST['a'])) { |
248 | 248 | $modx->webAlertAndQuit($_lang['error_double_action']); |
249 | 249 | } elseif (isset($_GET['a'])) { |
@@ -262,12 +262,12 @@ discard block |
||
262 | 262 | $modx->manager->action = $action; |
263 | 263 | |
264 | 264 | // attempt to foil some simple types of CSRF attacks |
265 | -if (isset($modx->config['validate_referer']) && (int)$modx->config['validate_referer']) { |
|
265 | +if (isset($modx->config['validate_referer']) && (int) $modx->config['validate_referer']) { |
|
266 | 266 | if (isset($_SERVER['HTTP_REFERER'])) { |
267 | 267 | $referer = $_SERVER['HTTP_REFERER']; |
268 | 268 | |
269 | 269 | if (!empty($referer)) { |
270 | - if (!preg_match('/^' . preg_quote(MODX_SITE_URL, '/') . '/i', $referer)) { |
|
270 | + if (!preg_match('/^'.preg_quote(MODX_SITE_URL, '/').'/i', $referer)) { |
|
271 | 271 | $modx->webAlertAndQuit("A possible CSRF attempt was detected from referer: {$referer}.", "index.php"); |
272 | 272 | } |
273 | 273 | } else { |
@@ -285,8 +285,8 @@ discard block |
||
285 | 285 | function includeFileProcessor($filepath, $manager_theme) |
286 | 286 | { |
287 | 287 | $element = ""; |
288 | - if (is_file(MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/" . $filepath)) { |
|
289 | - $element = MODX_MANAGER_PATH . "media/style/" . $manager_theme . "/" . $filepath; |
|
288 | + if (is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) { |
|
289 | + $element = MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath; |
|
290 | 290 | } else { |
291 | 291 | $element = $filepath; |
292 | 292 | } |
@@ -301,10 +301,10 @@ discard block |
||
301 | 301 | case 1: |
302 | 302 | // get the requested frame |
303 | 303 | $frame = preg_replace('/[^a-z0-9]/i', '', $_REQUEST['f']); |
304 | - if ($frame>9) { |
|
305 | - $enable_debug=false; // this is to stop the debug thingy being attached to the framesets |
|
304 | + if ($frame > 9) { |
|
305 | + $enable_debug = false; // this is to stop the debug thingy being attached to the framesets |
|
306 | 306 | } |
307 | - include_once(includeFileProcessor("frames/" . $frame . ".php", $manager_theme)); |
|
307 | + include_once(includeFileProcessor("frames/".$frame.".php", $manager_theme)); |
|
308 | 308 | break; |
309 | 309 | /********************************************************************/ |
310 | 310 | /* show the homepage */ |
@@ -992,9 +992,9 @@ discard block |
||
992 | 992 | // say that what was requested doesn't do anything yet |
993 | 993 | include_once(includeFileProcessor("includes/header.inc.php", $manager_theme)); |
994 | 994 | echo " |
995 | - <div class='sectionHeader'>" . $_lang['functionnotimpl'] . "</div> |
|
995 | + <div class='sectionHeader'>" . $_lang['functionnotimpl']."</div> |
|
996 | 996 | <div class='sectionBody'> |
997 | - <p>" . $_lang['functionnotimpl_message'] . "</p> |
|
997 | + <p>" . $_lang['functionnotimpl_message']."</p> |
|
998 | 998 | </div> |
999 | 999 | "; |
1000 | 1000 | include_once(includeFileProcessor("includes/footer.inc.php", $manager_theme)); |
@@ -1002,7 +1002,7 @@ discard block |
||
1002 | 1002 | |
1003 | 1003 | /********************************************************************/ |
1004 | 1004 | // log action, unless it's a frame request |
1005 | -if ($action!=1 && $action!=7 && $action!=2) { |
|
1005 | +if ($action != 1 && $action != 7 && $action != 2) { |
|
1006 | 1006 | include_once "log.class.inc.php"; |
1007 | 1007 | $log = new logHandler; |
1008 | 1008 | $log->initAndWriteLog(); |
@@ -39,13 +39,13 @@ discard block |
||
39 | 39 | case 'publishedon': |
40 | 40 | case 'pub_date': |
41 | 41 | case 'unpub_date': |
42 | - $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.' . $_SESSION['tree_sortby'], 'sc.' . $_SESSION['tree_sortby']); |
|
42 | + $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.'.$_SESSION['tree_sortby'], 'sc.'.$_SESSION['tree_sortby']); |
|
43 | 43 | break; |
44 | 44 | default: |
45 | - $sortby = 'sc.' . $_SESSION['tree_sortby']; |
|
45 | + $sortby = 'sc.'.$_SESSION['tree_sortby']; |
|
46 | 46 | }; |
47 | 47 | |
48 | - $orderby = $modx->db->escape($sortby . ' ' . $_SESSION['tree_sortdir']); |
|
48 | + $orderby = $modx->db->escape($sortby.' '.$_SESSION['tree_sortdir']); |
|
49 | 49 | |
50 | 50 | // Folder sorting gets special setup ;) Add menuindex and pagetitle |
51 | 51 | if ($_SESSION['tree_sortby'] == 'isfolder') { |
@@ -59,11 +59,11 @@ discard block |
||
59 | 59 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
60 | 60 | $showProtected = false; |
61 | 61 | if (isset($modx->config['tree_show_protected'])) { |
62 | - $showProtected = (boolean)$modx->config['tree_show_protected']; |
|
62 | + $showProtected = (boolean) $modx->config['tree_show_protected']; |
|
63 | 63 | } |
64 | - $mgrRole = (isset($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
64 | + $mgrRole = (isset($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
65 | 65 | if ($showProtected == false) { |
66 | - $access = "AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
66 | + $access = "AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
67 | 67 | } else { |
68 | 68 | $access = ''; |
69 | 69 | } |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | } |
100 | 100 | |
101 | 101 | $weblinkDisplay = $row['type'] == 'reference' ? sprintf(' %s', $_style['tree_linkgo']) : ''; |
102 | - $pageIdDisplay = '<small>(' . ($modx_textdir ? '‏' : '') . $row['id'] . ')</small>'; |
|
102 | + $pageIdDisplay = '<small>('.($modx_textdir ? '‏' : '').$row['id'].')</small>'; |
|
103 | 103 | |
104 | 104 | // Prepare displaying user-locks |
105 | 105 | $lockedByUser = ''; |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | 'element_type' => $_lang["lock_element_type_7"], |
111 | 111 | 'lasthit_df' => $rowLock['lasthit_df'] |
112 | 112 | )); |
113 | - $lockedByUser = '<span title="' . $title . '" class="editResource">' . $_style['tree_preview_resource'] . '</span>'; |
|
113 | + $lockedByUser = '<span title="'.$title.'" class="editResource">'.$_style['tree_preview_resource'].'</span>'; |
|
114 | 114 | } else { |
115 | 115 | $title = $modx->parseText($_lang["lock_element_locked_by"], array( |
116 | 116 | 'element_type' => $_lang["lock_element_type_7"], |
@@ -118,9 +118,9 @@ discard block |
||
118 | 118 | 'lasthit_df' => $rowLock['lasthit_df'] |
119 | 119 | )); |
120 | 120 | if ($modx->hasPermission('remove_locks')) { |
121 | - $lockedByUser = '<span onclick="modx.tree.unlockElement(7, ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>'; |
|
121 | + $lockedByUser = '<span onclick="modx.tree.unlockElement(7, '.$row['id'].', this);return false;" title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>'; |
|
122 | 122 | } else { |
123 | - $lockedByUser = '<span title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>'; |
|
123 | + $lockedByUser = '<span title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>'; |
|
124 | 124 | } |
125 | 125 | } |
126 | 126 | } |
@@ -129,22 +129,22 @@ discard block |
||
129 | 129 | |
130 | 130 | $title = ''; |
131 | 131 | if (isDateNode($nodeNameSource)) { |
132 | - $title = $_lang['pagetitle'] . ': ' . $row['pagetitle'] . '[+lf+]'; |
|
132 | + $title = $_lang['pagetitle'].': '.$row['pagetitle'].'[+lf+]'; |
|
133 | 133 | } |
134 | - $title .= $_lang['id'] . ': ' . $row['id']; |
|
135 | - $title .= '[+lf+]' . $_lang['resource_opt_menu_title'] . ': ' . $row['menutitle']; |
|
136 | - $title .= '[+lf+]' . $_lang['resource_opt_menu_index'] . ': ' . $row['menuindex']; |
|
137 | - $title .= '[+lf+]' . $_lang['alias'] . ': ' . (!empty($row['alias']) ? $row['alias'] : '-'); |
|
138 | - $title .= '[+lf+]' . $_lang['template'] . ': ' . $row['templatename']; |
|
139 | - $title .= '[+lf+]' . $_lang['publish_date'] . ': ' . $modx->toDateFormat($row['pub_date']); |
|
140 | - $title .= '[+lf+]' . $_lang['unpublish_date'] . ': ' . $modx->toDateFormat($row['unpub_date']); |
|
141 | - $title .= '[+lf+]' . $_lang['page_data_web_access'] . ': ' . ($row['privateweb'] ? $_lang['private'] : $_lang['public']); |
|
142 | - $title .= '[+lf+]' . $_lang['page_data_mgr_access'] . ': ' . ($row['privatemgr'] ? $_lang['private'] : $_lang['public']); |
|
143 | - $title .= '[+lf+]' . $_lang['resource_opt_richtext'] . ': ' . ($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
144 | - $title .= '[+lf+]' . $_lang['page_data_searchable'] . ': ' . ($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
145 | - $title .= '[+lf+]' . $_lang['page_data_cacheable'] . ': ' . ($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
134 | + $title .= $_lang['id'].': '.$row['id']; |
|
135 | + $title .= '[+lf+]'.$_lang['resource_opt_menu_title'].': '.$row['menutitle']; |
|
136 | + $title .= '[+lf+]'.$_lang['resource_opt_menu_index'].': '.$row['menuindex']; |
|
137 | + $title .= '[+lf+]'.$_lang['alias'].': '.(!empty($row['alias']) ? $row['alias'] : '-'); |
|
138 | + $title .= '[+lf+]'.$_lang['template'].': '.$row['templatename']; |
|
139 | + $title .= '[+lf+]'.$_lang['publish_date'].': '.$modx->toDateFormat($row['pub_date']); |
|
140 | + $title .= '[+lf+]'.$_lang['unpublish_date'].': '.$modx->toDateFormat($row['unpub_date']); |
|
141 | + $title .= '[+lf+]'.$_lang['page_data_web_access'].': '.($row['privateweb'] ? $_lang['private'] : $_lang['public']); |
|
142 | + $title .= '[+lf+]'.$_lang['page_data_mgr_access'].': '.($row['privatemgr'] ? $_lang['private'] : $_lang['public']); |
|
143 | + $title .= '[+lf+]'.$_lang['resource_opt_richtext'].': '.($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
144 | + $title .= '[+lf+]'.$_lang['page_data_searchable'].': '.($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
145 | + $title .= '[+lf+]'.$_lang['page_data_cacheable'].': '.($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
146 | 146 | $title = $modx->htmlspecialchars($title); |
147 | - $title = str_replace('[+lf+]', ' ', $title); // replace line-breaks with empty space as fall-back |
|
147 | + $title = str_replace('[+lf+]', ' ', $title); // replace line-breaks with empty space as fall-back |
|
148 | 148 | |
149 | 149 | $data = array( |
150 | 150 | 'id' => $row['id'], |
@@ -228,7 +228,7 @@ discard block |
||
228 | 228 | } |
229 | 229 | |
230 | 230 | if ($ph['contextmenu']) { |
231 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
231 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
232 | 232 | } |
233 | 233 | |
234 | 234 | if ($_SESSION['tree_show_only_folders']) { |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | } |
286 | 286 | |
287 | 287 | if ($ph['contextmenu']) { |
288 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
288 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | $node .= $modx->parseText($tpl, $ph); |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | } |
324 | 324 | |
325 | 325 | if ($ph['contextmenu']) { |
326 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
326 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | $node .= $modx->parseText($tpl, $ph); |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | } |
375 | 375 | |
376 | 376 | if ($ph['contextmenu']) { |
377 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
377 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | $node .= $modx->parseText($tpl, $ph); |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | } |
417 | 417 | |
418 | 418 | if ($ph['contextmenu']) { |
419 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
419 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | $node .= $modx->parseText($tpl, $ph); |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | $nodetitle .= $modx->config['friendly_url_suffix']; |
494 | 494 | } |
495 | 495 | } |
496 | - $nodetitle = $modx->config['friendly_url_prefix'] . $nodetitle; |
|
496 | + $nodetitle = $modx->config['friendly_url_prefix'].$nodetitle; |
|
497 | 497 | break; |
498 | 498 | case 'pagetitle': |
499 | 499 | $nodetitle = $row['pagetitle']; |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | { |
554 | 554 | $modx = evolutionCMS(); |
555 | 555 | |
556 | - return (int)$modx->db->getValue($modx->db->query('SELECT count(*) FROM ' . $modx->getFullTableName('site_content') . ' WHERE parent=' . $parent . ' AND isfolder=' . $isfolder . ' ')); |
|
556 | + return (int) $modx->db->getValue($modx->db->query('SELECT count(*) FROM '.$modx->getFullTableName('site_content').' WHERE parent='.$parent.' AND isfolder='.$isfolder.' ')); |
|
557 | 557 | } |
558 | 558 | |
559 | 559 | /** |
@@ -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 | |
@@ -36,19 +36,19 @@ discard block |
||
36 | 36 | |
37 | 37 | <?php if ($use_browser && $modx->hasPermission('assets_images')) { |
38 | 38 | ?> |
39 | - <a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a> |
|
39 | + <a class="treeButton" id="treeMenu_openimages" title="<?php echo $_lang["images_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['images_management']; ?></a> |
|
40 | 40 | <?php |
41 | 41 | } ?> |
42 | 42 | |
43 | 43 | <?php if ($use_browser && $modx->hasPermission('assets_files')) { |
44 | 44 | ?> |
45 | - <a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a> |
|
45 | + <a class="treeButton" id="treeMenu_openfiles" title="<?php echo $_lang["files_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['files_management']; ?></a> |
|
46 | 46 | <?php |
47 | 47 | } ?> |
48 | 48 | |
49 | 49 | <?php if ($modx->hasPermission('edit_template') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_plugin')) { |
50 | 50 | ?> |
51 | - <a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"] . "\n" . $_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a> |
|
51 | + <a class="treeButton" id="treeMenu_openelements" title="<?php echo $_lang["element_management"]."\n".$_lang['em_button_shift'] ?>"><?php echo $_style['element_management']; ?></a> |
|
52 | 52 | <?php |
53 | 53 | } ?> |
54 | 54 |
@@ -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 | '', |
@@ -36,7 +36,7 @@ discard block |
||
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;', |
@@ -52,7 +52,7 @@ discard block |
||
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;', |
@@ -68,7 +68,7 @@ discard block |
||
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;', |
@@ -84,7 +84,7 @@ discard block |
||
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;', |
@@ -101,8 +101,8 @@ discard block |
||
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', |
@@ -116,8 +116,8 @@ discard block |
||
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', |
@@ -131,8 +131,8 @@ discard block |
||
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', |
@@ -146,8 +146,8 @@ discard block |
||
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', |
@@ -161,8 +161,8 @@ discard block |
||
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', |
@@ -178,7 +178,7 @@ discard block |
||
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 | '', |
@@ -193,7 +193,7 @@ discard block |
||
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 | '', |
@@ -210,7 +210,7 @@ discard block |
||
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 | '', |
@@ -225,21 +225,21 @@ discard block |
||
225 | 225 | if ($modx->hasPermission('exec_module')) { |
226 | 226 | if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
227 | 227 | $rs = $modx->db->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->db->select('*', $modx->getFullTableName('site_modules'), 'disabled != 1', 'name'); |
235 | 235 | } |
236 | 236 | if ($modx->db->getRecordCount($rs)) { |
237 | 237 | while ($row = $modx->db->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 | '', |
@@ -258,7 +258,7 @@ discard block |
||
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 | '', |
@@ -274,7 +274,7 @@ discard block |
||
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 | '', |
@@ -290,7 +290,7 @@ discard block |
||
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 | '', |
@@ -306,7 +306,7 @@ discard block |
||
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 | '', |
@@ -322,7 +322,7 @@ discard block |
||
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 | '', |
@@ -378,7 +378,7 @@ discard block |
||
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 | '', |
@@ -394,7 +394,7 @@ discard block |
||
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 | '', |
@@ -410,7 +410,7 @@ discard block |
||
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 | '', |
@@ -426,7 +426,7 @@ discard block |
||
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 | '', |
@@ -446,15 +446,15 @@ discard block |
||
446 | 446 | $newmenu = array_merge($newmenu, unserialize($item)); |
447 | 447 | } |
448 | 448 | } |
449 | - if (count($newmenu)> 0) { |
|
449 | + if (count($newmenu) > 0) { |
|
450 | 450 | $sitemenu = $newmenu; |
451 | 451 | } |
452 | 452 | } |
453 | 453 | |
454 | -if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/includes/menu.class.inc.php')) { |
|
455 | - include_once(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')) { |
|
455 | + include_once(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/includes/menu.class.inc.php'); |
|
456 | 456 | } else { |
457 | - include_once(MODX_MANAGER_PATH . 'includes/menu.class.inc.php'); |
|
457 | + include_once(MODX_MANAGER_PATH.'includes/menu.class.inc.php'); |
|
458 | 458 | } |
459 | 459 | $menu = new EVOmenu(); |
460 | 460 | $menu->Build($sitemenu, array( |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | header("X-XSS-Protection: 0"); |
@@ -47,9 +47,9 @@ discard block |
||
47 | 47 | |
48 | 48 | $theme_modes = array('', 'lightness', 'light', 'dark', 'darkness'); |
49 | 49 | if (!empty($theme_modes[$_COOKIE['MODX_themeMode']])) { |
50 | - $body_class .= ' ' . $theme_modes[$_COOKIE['MODX_themeMode']]; |
|
50 | + $body_class .= ' '.$theme_modes[$_COOKIE['MODX_themeMode']]; |
|
51 | 51 | } elseif (!empty($theme_modes[$modx->config['manager_theme_mode']])) { |
52 | - $body_class .= ' ' . $theme_modes[$modx->config['manager_theme_mode']]; |
|
52 | + $body_class .= ' '.$theme_modes[$modx->config['manager_theme_mode']]; |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | $navbar_position = $modx->config['manager_menu_position']; |
@@ -82,36 +82,36 @@ discard block |
||
82 | 82 | $user['which_browser'] = $modx->config['which_browser']; |
83 | 83 | } |
84 | 84 | |
85 | -$css = 'media/style/' . $modx->config['manager_theme'] . '/css/page.css?v=' . $lastInstallTime; |
|
85 | +$css = 'media/style/'.$modx->config['manager_theme'].'/css/page.css?v='.$lastInstallTime; |
|
86 | 86 | |
87 | 87 | if ($modx->config['manager_theme'] == 'default') { |
88 | - if (!file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css') && is_writable(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css')) { |
|
89 | - require_once MODX_BASE_PATH . 'assets/lib/Formatter/CSSMinify.php'; |
|
88 | + if (!file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css') && is_writable(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css')) { |
|
89 | + require_once MODX_BASE_PATH.'assets/lib/Formatter/CSSMinify.php'; |
|
90 | 90 | $minifier = new Formatter\CSSMinify(); |
91 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
92 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
93 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/fonts.css'); |
|
94 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/forms.css'); |
|
95 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/mainmenu.css'); |
|
96 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tree.css'); |
|
97 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/custom.css'); |
|
98 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/tabpane.css'); |
|
99 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/contextmenu.css'); |
|
100 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/index.css'); |
|
101 | - $minifier->addFile(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/main.css'); |
|
91 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/bootstrap/css/bootstrap.min.css'); |
|
92 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/common/font-awesome/css/font-awesome.min.css'); |
|
93 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/fonts.css'); |
|
94 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/forms.css'); |
|
95 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/mainmenu.css'); |
|
96 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tree.css'); |
|
97 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/custom.css'); |
|
98 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/tabpane.css'); |
|
99 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/contextmenu.css'); |
|
100 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/index.css'); |
|
101 | + $minifier->addFile(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/main.css'); |
|
102 | 102 | $css = $minifier->minify(); |
103 | - file_put_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css', $css); |
|
103 | + file_put_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css', $css); |
|
104 | 104 | } |
105 | - if (file_exists(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css')) { |
|
106 | - $css = 'media/style/' . $modx->config['manager_theme'] . '/css/styles.min.css?v=' . $lastInstallTime; |
|
105 | + if (file_exists(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css')) { |
|
106 | + $css = 'media/style/'.$modx->config['manager_theme'].'/css/styles.min.css?v='.$lastInstallTime; |
|
107 | 107 | } |
108 | 108 | } |
109 | 109 | |
110 | -$modx->config['global_tabs'] = (int)($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin'))); |
|
110 | +$modx->config['global_tabs'] = (int) ($modx->config['global_tabs'] && ($user['role'] == 1 || $modx->hasPermission('edit_template') || $modx->hasPermission('edit_chunk') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('edit_plugin'))); |
|
111 | 111 | |
112 | 112 | ?> |
113 | 113 | <!DOCTYPE html> |
114 | -<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="') . $mxla . '" xml:lang="' . $mxla . '"' ?>> |
|
114 | +<html <?= (isset($modx_textdir) && $modx_textdir ? 'dir="rtl" lang="' : 'lang="').$mxla.'" xml:lang="'.$mxla.'"' ?>> |
|
115 | 115 | <head> |
116 | 116 | <title><?= $site_name ?>- (EVO CMS Manager)</title> |
117 | 117 | <meta http-equiv="Content-Type" content="text/html; charset=<?= $modx_manager_charset ?>" /> |
@@ -144,21 +144,21 @@ discard block |
||
144 | 144 | MODX_SITE_URL: '<?= MODX_SITE_URL ?>', |
145 | 145 | MODX_MANAGER_URL: '<?= MODX_MANAGER_URL ?>', |
146 | 146 | user: { |
147 | - role: <?= (int)$user['role'] ?>, |
|
147 | + role: <?= (int) $user['role'] ?>, |
|
148 | 148 | username: '<?= $user['username'] ?>' |
149 | 149 | }, |
150 | 150 | config: { |
151 | 151 | mail_check_timeperiod: <?= $modx->config['mail_check_timeperiod'] ?>, |
152 | - menu_height: <?= (int)$menu_height ?>, |
|
153 | - tree_width: <?= (int)$tree_width ?>, |
|
154 | - tree_min_width: <?= (int)$tree_min_width ?>, |
|
155 | - session_timeout: <?= (int)$modx->config['session_timeout'] ?>, |
|
156 | - site_start: <?= (int)$modx->config['site_start'] ?>, |
|
157 | - tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int)$modx->config['tree_page_click'] : 27) ?>, |
|
152 | + menu_height: <?= (int) $menu_height ?>, |
|
153 | + tree_width: <?= (int) $tree_width ?>, |
|
154 | + tree_min_width: <?= (int) $tree_min_width ?>, |
|
155 | + session_timeout: <?= (int) $modx->config['session_timeout'] ?>, |
|
156 | + site_start: <?= (int) $modx->config['site_start'] ?>, |
|
157 | + tree_page_click: <?=(!empty($modx->config['tree_page_click']) ? (int) $modx->config['tree_page_click'] : 27) ?>, |
|
158 | 158 | theme: '<?= $modx->config['manager_theme'] ?>', |
159 | 159 | theme_mode: '<?= $modx->config['manager_theme_mode'] ?>', |
160 | 160 | which_browser: '<?= $user['which_browser'] ?>', |
161 | - layout: <?= (int)$manager_layout ?>, |
|
161 | + layout: <?= (int) $manager_layout ?>, |
|
162 | 162 | textdir: '<?= $modx_textdir ?>', |
163 | 163 | global_tabs: <?= $modx->config['global_tabs'] ?> |
164 | 164 | |
@@ -243,11 +243,11 @@ discard block |
||
243 | 243 | delete a[b]; |
244 | 244 | }, |
245 | 245 | openedArray: [], |
246 | - lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE) . "\n" ?> |
|
246 | + lockedElementsTranslation: <?= json_encode($unlockTranslations, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE)."\n" ?> |
|
247 | 247 | }; |
248 | 248 | <?php |
249 | 249 | $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray']))); |
250 | - echo(empty($opened) ? '' : 'modx.openedArray[' . implode("] = 1;\n modx.openedArray[", $opened) . '] = 1;') . "\n"; |
|
250 | + echo(empty($opened) ? '' : 'modx.openedArray['.implode("] = 1;\n modx.openedArray[", $opened).'] = 1;')."\n"; |
|
251 | 251 | ?> |
252 | 252 | </script> |
253 | 253 | <script src="media/style/<?= $modx->config['manager_theme'] ?>/js/modx.min.js?v=<?= $lastInstallTime ?>"></script> |
@@ -342,7 +342,7 @@ discard block |
||
342 | 342 | <span class="username"><?= $user['username'] ?></span> |
343 | 343 | <?php if ($user['photo']) { |
344 | 344 | ?> |
345 | - <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL . $user['photo'] ?>);"></span> |
|
345 | + <span class="icon photo" style="background-image: url(<?= MODX_SITE_URL.$user['photo'] ?>);"></span> |
|
346 | 346 | <?php |
347 | 347 | } else { |
348 | 348 | ?> |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | $version = 'Evolution'; |
375 | 375 | ?> |
376 | 376 | <?php |
377 | - echo sprintf('<li><span class="dropdown-item" title="%s – %s" %s>' . $version . ' %s</span></li>', $site_name, $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']); |
|
377 | + echo sprintf('<li><span class="dropdown-item" title="%s – %s" %s>'.$version.' %s</span></li>', $site_name, $modx->getVersionData('full_appname'), $style, $modx->config['settings_version']); |
|
378 | 378 | ?> |
379 | 379 | </ul> |
380 | 380 | </li> |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | */ |
578 | 578 | function constructLink($action, $img, $text, $allowed) |
579 | 579 | { |
580 | - if ((bool)$allowed) { |
|
580 | + if ((bool) $allowed) { |
|
581 | 581 | echo sprintf('<div class="menuLink" id="item%s" onclick="modx.tree.menuHandler(%s);">', $action, $action); |
582 | 582 | echo sprintf('<i class="%s"></i> %s</div>', $img, $text); |
583 | 583 | } |
@@ -614,7 +614,7 @@ discard block |
||
614 | 614 | document.getElementById('treeMenu_openimages').onclick = function(e) { |
615 | 615 | e.preventDefault(); |
616 | 616 | if (modx.config.global_tabs && !e.shiftKey) { |
617 | - modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'}); |
|
617 | + modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=images' ?>', title: '<?= $_lang["images_management"] ?>'}); |
|
618 | 618 | } else { |
619 | 619 | var randomNum = '<?= $_lang["files_files"] ?>'; |
620 | 620 | if (e.shiftKey) { |
@@ -634,7 +634,7 @@ discard block |
||
634 | 634 | document.getElementById('treeMenu_openfiles').onclick = function(e) { |
635 | 635 | e.preventDefault(); |
636 | 636 | if (modx.config.global_tabs && !e.shiftKey) { |
637 | - modx.tabs({url: '<?= MODX_MANAGER_URL . 'media/browser/' . $which_browser . '/browse.php?filemanager=media/browser/' . $which_browser . '/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'}); |
|
637 | + modx.tabs({url: '<?= MODX_MANAGER_URL.'media/browser/'.$which_browser.'/browse.php?filemanager=media/browser/'.$which_browser.'/browse.php&type=files' ?>', title: '<?= $_lang["files_files"] ?>'}); |
|
638 | 638 | } else { |
639 | 639 | var randomNum = '<?= $_lang["files_files"] ?>'; |
640 | 640 | if (e.shiftKey) { |
@@ -691,7 +691,7 @@ discard block |
||
691 | 691 | |
692 | 692 | </div> |
693 | 693 | <?php if ($modx->config['show_picker'] != "0") { |
694 | - include('media/style/' . $modx->config['manager_theme'] . '/color.switcher.php'); |
|
694 | + include('media/style/'.$modx->config['manager_theme'].'/color.switcher.php'); |
|
695 | 695 | } ?> |
696 | 696 | </body> |
697 | 697 | </html> |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | * here, they can be accessed in config.php via $GLOBALS array. |
20 | 20 | * It's recommended to use constants instead. |
21 | 21 | */ |
22 | -include_once(dirname(__FILE__) . "/../../../../../assets/cache/siteManager.php"); |
|
22 | +include_once(dirname(__FILE__)."/../../../../../assets/cache/siteManager.php"); |
|
23 | 23 | require_once('../../../includes/protect.inc.php'); |
24 | 24 | include_once('../../../includes/config.inc.php'); |
25 | 25 | include_once('../../../includes/document.parser.class.inc.php'); |
@@ -34,15 +34,15 @@ 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 | -include_once "../../../includes/lang/" . $manager_language . ".inc.php"; |
|
40 | +include_once "../../../includes/lang/".$manager_language.".inc.php"; |
|
41 | 41 | $_GET['langCode'] = $modx_lang_attribute; |
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 | |
@@ -78,7 +78,7 @@ discard block |
||
78 | 78 | ); |
79 | 79 | } |
80 | 80 | if (isset($classes[$class])) { |
81 | - require dirname(__FILE__) . $classes[$class]; |
|
81 | + require dirname(__FILE__).$classes[$class]; |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | spl_autoload_register('autoloadda9d06472ccb71b84928677ce2a6ca89', true); |
@@ -88,14 +88,14 @@ discard block |
||
88 | 88 | if (!function_exists("json_encode")) { |
89 | 89 | function kcfinder_json_string_encode($string) |
90 | 90 | { |
91 | - return '"' . |
|
91 | + return '"'. |
|
92 | 92 | str_replace('/', "\\/", |
93 | 93 | str_replace("\t", "\\t", |
94 | 94 | str_replace("\r", "\\r", |
95 | 95 | str_replace("\n", "\\n", |
96 | 96 | str_replace('"', "\\\"", |
97 | 97 | str_replace("\\", "\\\\", |
98 | - $string)))))) . '"'; |
|
98 | + $string)))))).'"'; |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | function json_encode($data) |
@@ -106,16 +106,16 @@ discard block |
||
106 | 106 | // OBJECT |
107 | 107 | if (array_keys($data) !== range(0, count($data) - 1)) { |
108 | 108 | foreach ($data as $key => $val) { |
109 | - $ret[] = kcfinder_json_string_encode($key) . ':' . json_encode($val); |
|
109 | + $ret[] = kcfinder_json_string_encode($key).':'.json_encode($val); |
|
110 | 110 | } |
111 | - return "{" . implode(",", $ret) . "}"; |
|
111 | + return "{".implode(",", $ret)."}"; |
|
112 | 112 | |
113 | 113 | // ARRAY |
114 | 114 | } else { |
115 | 115 | foreach ($data as $val) { |
116 | 116 | $ret[] = json_encode($val); |
117 | 117 | } |
118 | - return "[" . implode(",", $ret) . "]"; |
|
118 | + return "[".implode(",", $ret)."]"; |
|
119 | 119 | } |
120 | 120 | |
121 | 121 | // BOOLEAN OR NULL |
@@ -73,8 +73,8 @@ discard block |
||
73 | 73 | |
74 | 74 | /** Next three properties are got from the current language file |
75 | 75 | * @var string */ |
76 | - protected $dateTimeFull; // Currently not used |
|
77 | - protected $dateTimeMid; // Currently not used |
|
76 | + protected $dateTimeFull; // Currently not used |
|
77 | + protected $dateTimeMid; // Currently not used |
|
78 | 78 | protected $dateTimeSmall; |
79 | 79 | |
80 | 80 | /** Contain Specified language labels |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | |
228 | 228 | // COOKIES INIT |
229 | 229 | $ip = '(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'; |
230 | - $ip = '/^' . implode('\.', array($ip, $ip, $ip, $ip)) . '$/'; |
|
230 | + $ip = '/^'.implode('\.', array($ip, $ip, $ip, $ip)).'$/'; |
|
231 | 231 | if (preg_match($ip, $_SERVER['HTTP_HOST']) || |
232 | 232 | preg_match('/^[^\.]+$/', $_SERVER['HTTP_HOST']) |
233 | 233 | ) { |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | ) { |
248 | 248 | list($unused, $protocol, $domain, $unused, $port, $path) = $patt; |
249 | 249 | $path = path::normalize($path); |
250 | - $this->config['uploadURL'] = "$protocol://$domain" . (strlen($port) ? ":$port" : "") . "/$path"; |
|
250 | + $this->config['uploadURL'] = "$protocol://$domain".(strlen($port) ? ":$port" : "")."/$path"; |
|
251 | 251 | $this->config['uploadDir'] = strlen($this->config['uploadDir']) |
252 | 252 | ? path::normalize($this->config['uploadDir']) |
253 | 253 | : path::url2fullPath("/$path"); |
@@ -293,7 +293,7 @@ discard block |
||
293 | 293 | foreach ($this->langInputNames as $key) { |
294 | 294 | if (isset($this->get[$key]) && |
295 | 295 | preg_match('/^[a-z][a-z\._\-]*$/i', $this->get[$key]) && |
296 | - file_exists("lang/" . strtolower($this->get[$key]) . ".php") |
|
296 | + file_exists("lang/".strtolower($this->get[$key]).".php") |
|
297 | 297 | ) { |
298 | 298 | $this->lang = $this->get[$key]; |
299 | 299 | break; |
@@ -364,7 +364,7 @@ discard block |
||
364 | 364 | } |
365 | 365 | |
366 | 366 | $filename = $this->normalizeFilename($file['name']); |
367 | - $target = file::getInexistantFilename($dir . $filename); |
|
367 | + $target = file::getInexistantFilename($dir.$filename); |
|
368 | 368 | |
369 | 369 | if (!@move_uploaded_file($file['tmp_name'], $target) && |
370 | 370 | !@rename($file['tmp_name'], $target) && |
@@ -380,11 +380,11 @@ discard block |
||
380 | 380 | if (isset($udir)) { |
381 | 381 | $url .= "/$udir"; |
382 | 382 | } |
383 | - $url .= "/" . basename($target); |
|
383 | + $url .= "/".basename($target); |
|
384 | 384 | if (preg_match('/^([a-z]+)\:\/\/([^\/^\:]+)(\:(\d+))?\/(.+)$/', $url, $patt)) { |
385 | 385 | list($unused, $protocol, $domain, $unused, $port, $path) = $patt; |
386 | - $base = "$protocol://$domain" . (strlen($port) ? ":$port" : "") . "/"; |
|
387 | - $url = $base . path::urlPathEncode($path); |
|
386 | + $base = "$protocol://$domain".(strlen($port) ? ":$port" : "")."/"; |
|
387 | + $url = $base.path::urlPathEncode($path); |
|
388 | 388 | } else { |
389 | 389 | $url = path::urlPathEncode($url); |
390 | 390 | } |
@@ -412,7 +412,7 @@ discard block |
||
412 | 412 | |
413 | 413 | // Cleaning uploaded filename? |
414 | 414 | $setting = $modx->db->select('count(*)', $modx->getFullTableName('system_settings'), 'setting_name="clean_uploaded_filename" AND setting_value=1'); |
415 | - if ($modx->db->getValue($setting)>0) { |
|
415 | + if ($modx->db->getValue($setting) > 0) { |
|
416 | 416 | // Transalias plugin active? |
417 | 417 | $res = $modx->db->select('properties', $modx->getFullTableName('site_plugins'), 'name="TransAlias" AND disabled=0'); |
418 | 418 | if ($properties = $modx->db->getValue($res)) { |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | if ($this->getTransaliasSettings()) { |
433 | 433 | $format = strrchr($filename, "."); |
434 | 434 | $filename = str_replace($format, "", $filename); |
435 | - $filename = $this->modx->stripAlias($filename) . $format; |
|
435 | + $filename = $this->modx->stripAlias($filename).$format; |
|
436 | 436 | } |
437 | 437 | return $filename; |
438 | 438 | } |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | return $this->modx->stripAlias($dirname); |
443 | 443 | } |
444 | 444 | |
445 | - protected function checkUploadedFile(array $aFile=null) |
|
445 | + protected function checkUploadedFile(array $aFile = null) |
|
446 | 446 | { |
447 | 447 | $config = &$this->config; |
448 | 448 | $file = ($aFile === null) ? $this->file : $aFile; |
@@ -484,8 +484,7 @@ discard block |
||
484 | 484 | ($file['error'] == UPLOAD_ERR_NO_TMP_DIR) ? |
485 | 485 | $this->label("Missing a temporary folder.") : ( |
486 | 486 | ($file['error'] == UPLOAD_ERR_CANT_WRITE) ? |
487 | - $this->label("Failed to write file.") : |
|
488 | - $this->label("Unknown error.") |
|
487 | + $this->label("Failed to write file.") : $this->label("Unknown error.") |
|
489 | 488 | ))))); |
490 | 489 | } |
491 | 490 | |
@@ -527,15 +526,15 @@ discard block |
||
527 | 526 | |
528 | 527 | |
529 | 528 | // CHECK FOR MODX MAX FILE SIZE |
530 | - $actualfilesize=filesize($file['tmp_name']); |
|
529 | + $actualfilesize = filesize($file['tmp_name']); |
|
531 | 530 | if (isset($this->config['maxfilesize']) && $actualfilesize > $this->config['maxfilesize']) { |
532 | - return $this->label("File is too big: " . $actualfilesize . " Bytes. (max " . $this->config['maxfilesize'] . " Bytes)"); |
|
531 | + return $this->label("File is too big: ".$actualfilesize." Bytes. (max ".$this->config['maxfilesize']." Bytes)"); |
|
533 | 532 | } |
534 | 533 | |
535 | 534 | return true; |
536 | 535 | } |
537 | 536 | |
538 | - protected function checkInputDir($dir, $inclType=true, $existing=true) |
|
537 | + protected function checkInputDir($dir, $inclType = true, $existing = true) |
|
539 | 538 | { |
540 | 539 | $dir = path::normalize($dir); |
541 | 540 | if (substr($dir, 0, 1) == "/") { |
@@ -607,7 +606,7 @@ discard block |
||
607 | 606 | ? $patt[1] : ""; |
608 | 607 | } |
609 | 608 | |
610 | - protected function imageResize($image, $file=null) |
|
609 | + protected function imageResize($image, $file = null) |
|
611 | 610 | { |
612 | 611 | if (!($image instanceof image)) { |
613 | 612 | $img = image::factory($this->imageDriver, $image); |
@@ -702,7 +701,7 @@ discard block |
||
702 | 701 | $img->watermark($this->config['watermark']['file'], $left, $top); |
703 | 702 | } |
704 | 703 | |
705 | - $options = array( 'file' => $file ); |
|
704 | + $options = array('file' => $file); |
|
706 | 705 | |
707 | 706 | $type = exif_imagetype($file); |
708 | 707 | |
@@ -714,11 +713,11 @@ discard block |
||
714 | 713 | return $img->output('png', $options); |
715 | 714 | |
716 | 715 | default: |
717 | - return $img->output('jpeg', array_merge($options, array( 'quality' => $this->config['jpegQuality'] ))); |
|
716 | + return $img->output('jpeg', array_merge($options, array('quality' => $this->config['jpegQuality']))); |
|
718 | 717 | } |
719 | 718 | } |
720 | 719 | |
721 | - protected function makeThumb($file, $overwrite=true) |
|
720 | + protected function makeThumb($file, $overwrite = true) |
|
722 | 721 | { |
723 | 722 | $img = image::factory($this->imageDriver, $file); |
724 | 723 | |
@@ -728,7 +727,7 @@ discard block |
||
728 | 727 | } |
729 | 728 | |
730 | 729 | $thumb = substr($file, strlen($this->config['uploadDir'])); |
731 | - $thumb = $this->config['uploadDir'] . "/" . $this->config['thumbsDir'] . "/" . $thumb; |
|
730 | + $thumb = $this->config['uploadDir']."/".$this->config['thumbsDir']."/".$thumb; |
|
732 | 731 | $thumb = path::normalize($thumb); |
733 | 732 | $thumbDir = dirname($thumb); |
734 | 733 | if (!is_dir($thumbDir) && !@mkdir($thumbDir, $this->config['dirPerms'], true)) { |
@@ -757,8 +756,8 @@ discard block |
||
757 | 756 | if ($this->imageDriver == 'gd') { |
758 | 757 | $width = imagesx($img->image); |
759 | 758 | $height = imagesy($img->image); |
760 | - $back = image::factory($this->imageDriver, array( $width, $height )); |
|
761 | - $tile = image::factory($this->imageDriver, __DIR__ . '/../themes/' . $this->config['theme'] . '/img/bg_transparent.png'); |
|
759 | + $back = image::factory($this->imageDriver, array($width, $height)); |
|
760 | + $tile = image::factory($this->imageDriver, __DIR__.'/../themes/'.$this->config['theme'].'/img/bg_transparent.png'); |
|
762 | 761 | |
763 | 762 | imagesettile($back->image, $tile->image); |
764 | 763 | imagefilledrectangle($back->image, 0, 0, $width, $height, IMG_COLOR_TILED); |
@@ -790,7 +789,7 @@ discard block |
||
790 | 789 | $this->labels = $lang; |
791 | 790 | } |
792 | 791 | |
793 | - protected function label($string, array $data=null) |
|
792 | + protected function label($string, array $data = null) |
|
794 | 793 | { |
795 | 794 | $return = isset($this->labels[$string]) ? $this->labels[$string] : $string; |
796 | 795 | if (is_array($data)) { |
@@ -801,7 +800,7 @@ discard block |
||
801 | 800 | return $return; |
802 | 801 | } |
803 | 802 | |
804 | - protected function backMsg($message, array $data=null) |
|
803 | + protected function backMsg($message, array $data = null) |
|
805 | 804 | { |
806 | 805 | $message = $this->label($message, $data); |
807 | 806 | if (isset($this->file['tmp_name']) && file_exists($this->file['tmp_name'])) { |
@@ -811,7 +810,7 @@ discard block |
||
811 | 810 | die; |
812 | 811 | } |
813 | 812 | |
814 | - protected function callBack($url, $message="") |
|
813 | + protected function callBack($url, $message = "") |
|
815 | 814 | { |
816 | 815 | $message = text::jsValue($message); |
817 | 816 | $CKfuncNum = isset($this->opener['CKEditor']['funcNum']) |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $this->get['dir'] = $dir; |
39 | 39 | } |
40 | 40 | |
41 | - $thumbsDir = $this->config['uploadDir'] . "/" . $this->config['thumbsDir']; |
|
41 | + $thumbsDir = $this->config['uploadDir']."/".$this->config['thumbsDir']; |
|
42 | 42 | if (( |
43 | 43 | !is_dir($thumbsDir) && |
44 | 44 | !@mkdir($thumbsDir, $this->config['dirPerms']) |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | $this->session['dir'] = $this->type; |
109 | 109 | } else { |
110 | 110 | $type = $this->getTypeFromPath($this->session['dir']); |
111 | - $dir = $this->config['uploadDir'] . "/" . $this->session['dir']; |
|
111 | + $dir = $this->config['uploadDir']."/".$this->session['dir']; |
|
112 | 112 | if (($type != $this->type) || !is_dir($dir) || !is_readable($dir)) { |
113 | 113 | $this->session['dir'] = $this->type; |
114 | 114 | } |
@@ -172,7 +172,7 @@ discard block |
||
172 | 172 | } |
173 | 173 | $file = "{$this->thumbsDir}/{$this->type}/{$this->get['dir']}/$file"; |
174 | 174 | if (!is_file($file) || !is_readable($file)) { |
175 | - $file = "{$this->config['uploadDir']}/{$this->type}/{$this->get['dir']}/" . basename($file); |
|
175 | + $file = "{$this->config['uploadDir']}/{$this->type}/{$this->get['dir']}/".basename($file); |
|
176 | 176 | if (!is_file($file) || !is_readable($file)) { |
177 | 177 | $this->sendDefaultThumb($file); |
178 | 178 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | protected function act_chDir() |
206 | 206 | { |
207 | 207 | $this->postDir(); // Just for existing check |
208 | - $this->session['dir'] = $this->type . "/" . $this->post['dir']; |
|
208 | + $this->session['dir'] = $this->type."/".$this->post['dir']; |
|
209 | 209 | $dirWritable = dir::isWritable("{$this->config['uploadDir']}/{$this->session['dir']}"); |
210 | 210 | return json_encode(array( |
211 | 211 | 'files' => $this->getFiles($this->session['dir']), |
@@ -262,12 +262,12 @@ discard block |
||
262 | 262 | if (substr($newName, 0, 1) == ".") { |
263 | 263 | $this->errorMsg("Folder name shouldn't begins with '.'"); |
264 | 264 | } |
265 | - if (!@rename($dir, dirname($dir) . "/$newName")) { |
|
265 | + if (!@rename($dir, dirname($dir)."/$newName")) { |
|
266 | 266 | $this->errorMsg("Cannot rename the folder."); |
267 | 267 | } |
268 | 268 | $thumbDir = "$this->thumbsTypeDir/{$this->post['dir']}"; |
269 | 269 | if (is_dir($thumbDir)) { |
270 | - @rename($thumbDir, dirname($thumbDir) . "/$newName"); |
|
270 | + @rename($thumbDir, dirname($thumbDir)."/$newName"); |
|
271 | 271 | } |
272 | 272 | return json_encode(array('name' => $newName)); |
273 | 273 | } |
@@ -332,7 +332,7 @@ discard block |
||
332 | 332 | $dir = $this->postDir(); |
333 | 333 | if (!isset($this->post['dir']) || |
334 | 334 | !isset($this->post['file']) || |
335 | - strpos($this->post['file'], '../')!==false || |
|
335 | + strpos($this->post['file'], '../') !== false || |
|
336 | 336 | (false === ($file = "$dir/{$this->post['file']}")) || |
337 | 337 | !file_exists($file) || !is_readable($file) |
338 | 338 | ) { |
@@ -344,9 +344,9 @@ discard block |
||
344 | 344 | header("Cache-Control: must-revalidate, post-check=0, pre-check=0"); |
345 | 345 | header("Cache-Control: private", false); |
346 | 346 | header("Content-Type: application/octet-stream"); |
347 | - header('Content-Disposition: attachment; filename="' . str_replace('"', "_", $this->post['file']) . '"'); |
|
347 | + header('Content-Disposition: attachment; filename="'.str_replace('"', "_", $this->post['file']).'"'); |
|
348 | 348 | header("Content-Transfer-Encoding: binary"); |
349 | - header("Content-Length: " . filesize($file)); |
|
349 | + header("Content-Length: ".filesize($file)); |
|
350 | 350 | readfile($file); |
351 | 351 | die; |
352 | 352 | } |
@@ -357,7 +357,7 @@ discard block |
||
357 | 357 | if (!$this->config['access']['files']['rename'] || |
358 | 358 | !isset($this->post['dir']) || |
359 | 359 | !isset($this->post['file']) || |
360 | - strpos($this->post['file'], '../')!==false || |
|
360 | + strpos($this->post['file'], '../') !== false || |
|
361 | 361 | !isset($this->post['newName']) || |
362 | 362 | (false === ($file = "$dir/{$this->post['file']}")) || |
363 | 363 | !file_exists($file) || !is_readable($file) || !file::isWritable($file) |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | $thumbFile = "$thumbDir/{$this->post['file']}"; |
401 | 401 | |
402 | 402 | if (file_exists($thumbFile)) { |
403 | - @rename($thumbFile, "$thumbDir/" . basename($newName)); |
|
403 | + @rename($thumbFile, "$thumbDir/".basename($newName)); |
|
404 | 404 | } |
405 | 405 | return true; |
406 | 406 | } |
@@ -411,7 +411,7 @@ discard block |
||
411 | 411 | if (!$this->config['access']['files']['delete'] || |
412 | 412 | !isset($this->post['dir']) || |
413 | 413 | !isset($this->post['file']) || |
414 | - strpos($this->post['file'], '../')!==false || |
|
414 | + strpos($this->post['file'], '../') !== false || |
|
415 | 415 | (false === ($file = "$dir/{$this->post['file']}")) || |
416 | 416 | !file_exists($file) || !is_readable($file) || !file::isWritable($file) || |
417 | 417 | !@unlink($file) |
@@ -456,11 +456,11 @@ discard block |
||
456 | 456 | if (!file_exists($path)) { |
457 | 457 | $error[] = $this->label("The file '{file}' does not exist.", $replace); |
458 | 458 | } elseif (substr($base, 0, 1) == ".") { |
459 | - $error[] = "$base: " . $this->label("File name shouldn't begins with '.'"); |
|
459 | + $error[] = "$base: ".$this->label("File name shouldn't begins with '.'"); |
|
460 | 460 | } elseif (!$this->validateExtension($ext, $type)) { |
461 | - $error[] = "$base: " . $this->label("Denied file extension."); |
|
461 | + $error[] = "$base: ".$this->label("Denied file extension."); |
|
462 | 462 | } elseif (file_exists("$dir/$base")) { |
463 | - $error[] = "$base: " . $this->label("A file or folder with that name already exists."); |
|
463 | + $error[] = "$base: ".$this->label("A file or folder with that name already exists."); |
|
464 | 464 | } elseif (!is_readable($path) || !is_file($path)) { |
465 | 465 | $error[] = $this->label("Cannot read '{file}'.", $replace); |
466 | 466 | } elseif (!@copy($path, "$dir/$base")) { |
@@ -516,11 +516,11 @@ discard block |
||
516 | 516 | if (!file_exists($path)) { |
517 | 517 | $error[] = $this->label("The file '{file}' does not exist.", $replace); |
518 | 518 | } elseif (substr($base, 0, 1) == ".") { |
519 | - $error[] = "$base: " . $this->label("File name shouldn't begins with '.'"); |
|
519 | + $error[] = "$base: ".$this->label("File name shouldn't begins with '.'"); |
|
520 | 520 | } elseif (!$this->validateExtension($ext, $type)) { |
521 | - $error[] = "$base: " . $this->label("Denied file extension."); |
|
521 | + $error[] = "$base: ".$this->label("Denied file extension."); |
|
522 | 522 | } elseif (file_exists("$dir/$base")) { |
523 | - $error[] = "$base: " . $this->label("A file or folder with that name already exists."); |
|
523 | + $error[] = "$base: ".$this->label("A file or folder with that name already exists."); |
|
524 | 524 | } elseif (!is_readable($path) || !is_file($path)) { |
525 | 525 | $error[] = $this->label("Cannot read '{file}'.", $replace); |
526 | 526 | } elseif (!file::isWritable($path) || !@rename($path, "$dir/$base")) { |
@@ -593,15 +593,15 @@ discard block |
||
593 | 593 | if (!isset($this->post['dir']) || $this->config['denyZipDownload']) { |
594 | 594 | $this->errorMsg("Unknown error."); |
595 | 595 | } |
596 | - $filename = basename($dir) . ".zip"; |
|
596 | + $filename = basename($dir).".zip"; |
|
597 | 597 | do { |
598 | - $file = md5(time() . session_id()); |
|
598 | + $file = md5(time().session_id()); |
|
599 | 599 | $file = "{$this->config['uploadDir']}/$file.zip"; |
600 | 600 | } while (file_exists($file)); |
601 | 601 | new zipFolder($file, $dir); |
602 | 602 | header("Content-Type: application/x-zip"); |
603 | - header('Content-Disposition: attachment; filename="' . str_replace('"', "_", $filename) . '"'); |
|
604 | - header("Content-Length: " . filesize($file)); |
|
603 | + header('Content-Disposition: attachment; filename="'.str_replace('"', "_", $filename).'"'); |
|
604 | + header("Content-Length: ".filesize($file)); |
|
605 | 605 | readfile($file); |
606 | 606 | unlink($file); |
607 | 607 | die; |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | } |
633 | 633 | |
634 | 634 | do { |
635 | - $file = md5(time() . session_id()); |
|
635 | + $file = md5(time().session_id()); |
|
636 | 636 | $file = "{$this->config['uploadDir']}/$file.zip"; |
637 | 637 | } while (file_exists($file)); |
638 | 638 | |
@@ -645,8 +645,8 @@ discard block |
||
645 | 645 | $zip->close(); |
646 | 646 | } |
647 | 647 | header("Content-Type: application/x-zip"); |
648 | - header('Content-Disposition: attachment; filename="selected_files_' . basename($file) . '"'); |
|
649 | - header("Content-Length: " . filesize($file)); |
|
648 | + header('Content-Disposition: attachment; filename="selected_files_'.basename($file).'"'); |
|
649 | + header("Content-Length: ".filesize($file)); |
|
650 | 650 | readfile($file); |
651 | 651 | unlink($file); |
652 | 652 | die; |
@@ -672,7 +672,7 @@ discard block |
||
672 | 672 | if ($type != $this->type) { |
673 | 673 | continue; |
674 | 674 | } |
675 | - $file = $this->config['uploadDir'] . "/$file"; |
|
675 | + $file = $this->config['uploadDir']."/$file"; |
|
676 | 676 | if (!is_file($file) || !is_readable($file)) { |
677 | 677 | continue; |
678 | 678 | } |
@@ -680,7 +680,7 @@ discard block |
||
680 | 680 | } |
681 | 681 | |
682 | 682 | do { |
683 | - $file = md5(time() . session_id()); |
|
683 | + $file = md5(time().session_id()); |
|
684 | 684 | $file = "{$this->config['uploadDir']}/$file.zip"; |
685 | 685 | } while (file_exists($file)); |
686 | 686 | |
@@ -693,8 +693,8 @@ discard block |
||
693 | 693 | $zip->close(); |
694 | 694 | } |
695 | 695 | header("Content-Type: application/x-zip"); |
696 | - header('Content-Disposition: attachment; filename="clipboard_' . basename($file) . '"'); |
|
697 | - header("Content-Length: " . filesize($file)); |
|
696 | + header('Content-Disposition: attachment; filename="clipboard_'.basename($file).'"'); |
|
697 | + header("Content-Length: ".filesize($file)); |
|
698 | 698 | readfile($file); |
699 | 699 | unlink($file); |
700 | 700 | die; |
@@ -746,23 +746,23 @@ discard block |
||
746 | 746 | } elseif ( |
747 | 747 | function_exists("curl_init") && |
748 | 748 | (false !== ($curl = @curl_init($url))) && |
749 | - (@ob_start() || (@curl_close($curl) && false)) && |
|
750 | - (@curl_exec($curl) || (@curl_close($curl) && false)) && |
|
751 | - ((false !== ($ver = @ob_get_clean())) || (@curl_close($curl) && false)) && |
|
752 | - (@curl_close($curl) || true) && |
|
749 | + (@ob_start() || (@curl_close($curl) && false)) && |
|
750 | + (@curl_exec($curl) || (@curl_close($curl) && false)) && |
|
751 | + ((false !== ($ver = @ob_get_clean())) || (@curl_close($curl) && false)) && |
|
752 | + (@curl_close($curl) || true) && |
|
753 | 753 | preg_match($pattern, $ver) |
754 | 754 | |
755 | 755 | // Socket extension |
756 | 756 | ) { |
757 | 757 | } elseif (function_exists('socket_create')) { |
758 | 758 | $cmd = |
759 | - "GET $path " . strtoupper($protocol) . "/1.1\r\n" . |
|
760 | - "Host: $host\r\n" . |
|
759 | + "GET $path ".strtoupper($protocol)."/1.1\r\n". |
|
760 | + "Host: $host\r\n". |
|
761 | 761 | "Connection: Close\r\n\r\n"; |
762 | 762 | |
763 | 763 | if ((false !== ($socket = @socket_create(AF_INET, SOCK_STREAM, SOL_TCP))) && |
764 | - (false !== @socket_connect($socket, $host, $port)) && |
|
765 | - (false !== @socket_write($socket, $cmd, strlen($cmd))) && |
|
764 | + (false !== @socket_connect($socket, $host, $port)) && |
|
765 | + (false !== @socket_write($socket, $cmd, strlen($cmd))) && |
|
766 | 766 | (false !== ($ver = @socket_read($socket, 2048))) && |
767 | 767 | preg_match($responsePattern, $ver, $match) |
768 | 768 | ) { |
@@ -795,14 +795,14 @@ discard block |
||
795 | 795 | } |
796 | 796 | |
797 | 797 | $filename = $this->normalizeFilename($file['name']); |
798 | - $target = "$dir/" . file::getInexistantFilename($filename, $dir); |
|
798 | + $target = "$dir/".file::getInexistantFilename($filename, $dir); |
|
799 | 799 | |
800 | 800 | if (!@move_uploaded_file($file['tmp_name'], $target) && |
801 | 801 | !@rename($file['tmp_name'], $target) && |
802 | 802 | !@copy($file['tmp_name'], $target) |
803 | 803 | ) { |
804 | 804 | @unlink($file['tmp_name']); |
805 | - return "{$file['name']}: " . $this->label("Cannot move uploaded file to target folder."); |
|
805 | + return "{$file['name']}: ".$this->label("Cannot move uploaded file to target folder."); |
|
806 | 806 | } elseif (function_exists('chmod')) { |
807 | 807 | chmod($target, $this->config['filePerms']); |
808 | 808 | } |
@@ -814,10 +814,10 @@ discard block |
||
814 | 814 | |
815 | 815 | $this->makeThumb($target); |
816 | 816 | |
817 | - return "/" . basename($target); |
|
817 | + return "/".basename($target); |
|
818 | 818 | } |
819 | 819 | |
820 | - protected function sendDefaultThumb($file=null) |
|
820 | + protected function sendDefaultThumb($file = null) |
|
821 | 821 | { |
822 | 822 | if ($file !== null) { |
823 | 823 | $ext = file::getExtension($file); |
@@ -844,10 +844,10 @@ discard block |
||
844 | 844 | foreach ($files as $file) { |
845 | 845 | $ext = file::getExtension($file); |
846 | 846 | $smallThumb = false; |
847 | - if (in_array(strtolower($ext), array('png', 'jpg', 'gif', 'jpeg' ))) { |
|
847 | + if (in_array(strtolower($ext), array('png', 'jpg', 'gif', 'jpeg'))) { |
|
848 | 848 | $size = @getimagesize($file); |
849 | 849 | if (is_array($size) && count($size)) { |
850 | - $thumb_file = "$thumbDir/" . basename($file); |
|
850 | + $thumb_file = "$thumbDir/".basename($file); |
|
851 | 851 | if (!is_file($thumb_file) || filemtime($file) > filemtime($thumb_file)) { |
852 | 852 | $this->makeThumb($file); |
853 | 853 | } |
@@ -863,7 +863,7 @@ discard block |
||
863 | 863 | } |
864 | 864 | $name = basename($file); |
865 | 865 | $types = $this->config['types']; |
866 | - $types = explode(' ', $types['images'] . ' ' . $types['image']); |
|
866 | + $types = explode(' ', $types['images'].' '.$types['image']); |
|
867 | 867 | if (substr($name, 0, 1) == '.' && !$this->config['showHiddenFiles']) { |
868 | 868 | continue; |
869 | 869 | } |
@@ -889,7 +889,7 @@ discard block |
||
889 | 889 | return $return; |
890 | 890 | } |
891 | 891 | |
892 | - protected function getTree($dir, $index=0) |
|
892 | + protected function getTree($dir, $index = 0) |
|
893 | 893 | { |
894 | 894 | $path = explode("/", $dir); |
895 | 895 | |
@@ -927,11 +927,11 @@ discard block |
||
927 | 927 | return $dirs; |
928 | 928 | } |
929 | 929 | |
930 | - protected function postDir($existent=true) |
|
930 | + protected function postDir($existent = true) |
|
931 | 931 | { |
932 | 932 | $dir = $this->typeDir; |
933 | 933 | if (isset($this->post['dir'])) { |
934 | - $dir .= "/" . $this->post['dir']; |
|
934 | + $dir .= "/".$this->post['dir']; |
|
935 | 935 | } |
936 | 936 | if ($existent && (!is_dir($dir) || !is_readable($dir))) { |
937 | 937 | $this->errorMsg("Inexistant or inaccessible folder."); |
@@ -939,11 +939,11 @@ discard block |
||
939 | 939 | return $dir; |
940 | 940 | } |
941 | 941 | |
942 | - protected function getDir($existent=true) |
|
942 | + protected function getDir($existent = true) |
|
943 | 943 | { |
944 | 944 | $dir = $this->typeDir; |
945 | 945 | if (isset($this->get['dir'])) { |
946 | - $dir .= "/" . $this->get['dir']; |
|
946 | + $dir .= "/".$this->get['dir']; |
|
947 | 947 | } |
948 | 948 | if ($existent && (!is_dir($dir) || !is_readable($dir))) { |
949 | 949 | $this->errorMsg("Inexistant or inaccessible folder."); |
@@ -969,7 +969,7 @@ discard block |
||
969 | 969 | return $return; |
970 | 970 | } |
971 | 971 | |
972 | - protected function getDirInfo($dir, $removable=false) |
|
972 | + protected function getDirInfo($dir, $removable = false) |
|
973 | 973 | { |
974 | 974 | if ((substr(basename($dir), 0, 1) == ".") || !is_dir($dir) || !is_readable($dir)) { |
975 | 975 | return false; |
@@ -1002,7 +1002,7 @@ discard block |
||
1002 | 1002 | return $info; |
1003 | 1003 | } |
1004 | 1004 | |
1005 | - protected function output($data=null, $template=null) |
|
1005 | + protected function output($data = null, $template = null) |
|
1006 | 1006 | { |
1007 | 1007 | if (!is_array($data)) { |
1008 | 1008 | $data = array(); |
@@ -1028,7 +1028,7 @@ discard block |
||
1028 | 1028 | return ""; |
1029 | 1029 | } |
1030 | 1030 | |
1031 | - protected function errorMsg($message, array $data=null) |
|
1031 | + protected function errorMsg($message, array $data = null) |
|
1032 | 1032 | { |
1033 | 1033 | if (in_array($this->action, array("thumb", "upload", "download", "downloadDir"))) { |
1034 | 1034 | die($this->label($message, $data)); |