@@ -14,8 +14,11 @@ |
||
| 14 | 14 | // count duplicates |
| 15 | 15 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_snippets'), "id='{$id}'")); |
| 16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_snippets'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
| 17 | -if($count>=1) $count = ' '.($count+1); |
|
| 18 | -else $count = ''; |
|
| 17 | +if($count>=1) { |
|
| 18 | + $count = ' '.($count+1); |
|
| 19 | +} else { |
|
| 20 | + $count = ''; |
|
| 21 | +} |
|
| 19 | 22 | |
| 20 | 23 | // duplicate Snippet |
| 21 | 24 | $newid = $modx->db->insert( |
@@ -25,7 +25,10 @@ |
||
| 25 | 25 | |
| 26 | 26 | $id = $row['id']; |
| 27 | 27 | |
| 28 | - if(in_array($id,$latestIds)) continue; // Keep latest version of disabled plugins |
|
| 28 | + if(in_array($id,$latestIds)) { |
|
| 29 | + continue; |
|
| 30 | + } |
|
| 31 | + // Keep latest version of disabled plugins |
|
| 29 | 32 | |
| 30 | 33 | // invoke OnBeforePluginFormDelete event |
| 31 | 34 | $modx->invokeEvent('OnBeforePluginFormDelete', array('id'=> $id)); |
@@ -11,13 +11,13 @@ |
||
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | -if($id==1){ |
|
| 14 | +if($id==1) { |
|
| 15 | 15 | $modx->webAlertAndQuit("The role you are trying to delete is the admin role. This role cannot be deleted!"); |
| 16 | 16 | } |
| 17 | 17 | |
| 18 | 18 | $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_attributes'), "role='{$id}'"); |
| 19 | 19 | $count=$modx->db->getValue($rs); |
| 20 | -if($count>0){ |
|
| 20 | +if($count>0) { |
|
| 21 | 21 | $modx->webAlertAndQuit("There are users with this role. It can't be deleted."); |
| 22 | 22 | } |
| 23 | 23 | |
@@ -14,8 +14,11 @@ |
||
| 14 | 14 | // count duplicates |
| 15 | 15 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_htmlsnippets'), "id='{$id}'")); |
| 16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_htmlsnippets'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
| 17 | -if($count>=1) $count = ' '.($count+1); |
|
| 18 | -else $count = ''; |
|
| 17 | +if($count>=1) { |
|
| 18 | + $count = ' '.($count+1); |
|
| 19 | +} else { |
|
| 20 | + $count = ''; |
|
| 21 | +} |
|
| 19 | 22 | |
| 20 | 23 | // duplicate htmlsnippet |
| 21 | 24 | $newid = $modx->db->insert( |
@@ -10,11 +10,11 @@ |
||
| 10 | 10 | $pass1 = $_POST['pass1']; |
| 11 | 11 | $pass2 = $_POST['pass2']; |
| 12 | 12 | |
| 13 | -if($pass1!=$pass2){ |
|
| 13 | +if($pass1!=$pass2) { |
|
| 14 | 14 | $modx->webAlertAndQuit("Passwords don't match!"); |
| 15 | 15 | } |
| 16 | 16 | |
| 17 | -if(strlen($pass1)<6){ |
|
| 17 | +if(strlen($pass1)<6) { |
|
| 18 | 18 | $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); |
| 19 | 19 | } |
| 20 | 20 | |
@@ -14,8 +14,11 @@ |
||
| 14 | 14 | // count duplicates |
| 15 | 15 | $name = $modx->db->getValue($modx->db->select('templatename', $modx->getFullTableName('site_templates'), "id='{$id}'")); |
| 16 | 16 | $count = $modx->db->getRecordCount($modx->db->select('templatename', $modx->getFullTableName('site_templates'), "templatename LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
| 17 | -if($count>=1) $count = ' '.($count+1); |
|
| 18 | -else $count = ''; |
|
| 17 | +if($count>=1) { |
|
| 18 | + $count = ' '.($count+1); |
|
| 19 | +} else { |
|
| 20 | + $count = ''; |
|
| 21 | +} |
|
| 19 | 22 | |
| 20 | 23 | // duplicate template |
| 21 | 24 | $newid = $modx->db->insert( |
@@ -10,9 +10,13 @@ |
||
| 10 | 10 | $userid = $_REQUEST['user']; |
| 11 | 11 | $groupid = $_REQUEST['group']; |
| 12 | 12 | $subject = $modx->db->escape($_REQUEST['messagesubject']); |
| 13 | -if($subject=="") $subject="(no subject)"; |
|
| 13 | +if($subject=="") { |
|
| 14 | + $subject="(no subject)"; |
|
| 15 | +} |
|
| 14 | 16 | $message = $modx->db->escape($_REQUEST['messagebody']); |
| 15 | -if($message=="") $message="(no message)"; |
|
| 17 | +if($message=="") { |
|
| 18 | + $message="(no message)"; |
|
| 19 | +} |
|
| 16 | 20 | $postdate = time(); |
| 17 | 21 | |
| 18 | 22 | if($sendto=='u') { |
@@ -119,7 +119,7 @@ |
||
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | // secure manager documents - flag as private |
| 122 | -if($updategroupaccess==true){ |
|
| 122 | +if($updategroupaccess==true) { |
|
| 123 | 123 | include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
| 124 | 124 | secureMgrDocument(); |
| 125 | 125 | |
@@ -61,9 +61,13 @@ discard block |
||
| 61 | 61 | $mgr_dir = substr($self_dir,strrpos($self_dir,'/')+1); |
| 62 | 62 | $base_path = str_replace($mgr_dir . '/index.php','',$self); |
| 63 | 63 | $site_mgr_path = $base_path . 'assets/cache/siteManager.php'; |
| 64 | -if(is_file($site_mgr_path)) include_once($site_mgr_path); |
|
| 64 | +if(is_file($site_mgr_path)) { |
|
| 65 | + include_once($site_mgr_path); |
|
| 66 | +} |
|
| 65 | 67 | $site_hostnames_path = $base_path . 'assets/cache/siteHostnames.php'; |
| 66 | -if(is_file($site_hostnames_path)) include_once($site_hostnames_path); |
|
| 68 | +if(is_file($site_hostnames_path)) { |
|
| 69 | + include_once($site_hostnames_path); |
|
| 70 | +} |
|
| 67 | 71 | if(!defined('MGR_DIR') || MGR_DIR!==$mgr_dir) { |
| 68 | 72 | $src = "<?php\n"; |
| 69 | 73 | $src .= "define('MGR_DIR', '{$mgr_dir}');\n"; |
@@ -117,9 +121,15 @@ discard block |
||
| 117 | 121 | $incPath = str_replace("\\","/",dirname(__FILE__)."/includes/"); // Mod by Raymond |
| 118 | 122 | set_include_path(get_include_path() . PATH_SEPARATOR . $incPath); |
| 119 | 123 | |
| 120 | -if (!defined('ENT_COMPAT')) define('ENT_COMPAT', 2); |
|
| 121 | -if (!defined('ENT_NOQUOTES')) define('ENT_NOQUOTES', 0); |
|
| 122 | -if (!defined('ENT_QUOTES')) define('ENT_QUOTES', 3); |
|
| 124 | +if (!defined('ENT_COMPAT')) { |
|
| 125 | + define('ENT_COMPAT', 2); |
|
| 126 | +} |
|
| 127 | +if (!defined('ENT_NOQUOTES')) { |
|
| 128 | + define('ENT_NOQUOTES', 0); |
|
| 129 | +} |
|
| 130 | +if (!defined('ENT_QUOTES')) { |
|
| 131 | + define('ENT_QUOTES', 3); |
|
| 132 | +} |
|
| 123 | 133 | |
| 124 | 134 | // set the document_root :| |
| 125 | 135 | if(!isset($_SERVER['DOCUMENT_ROOT']) || empty($_SERVER['DOCUMENT_ROOT'])) { |
@@ -182,10 +192,11 @@ discard block |
||
| 182 | 192 | |
| 183 | 193 | $s = array('[+MGR_DIR+]'); |
| 184 | 194 | $r = array(MGR_DIR); |
| 185 | -foreach($_lang as $k=>$v) |
|
| 186 | -{ |
|
| 187 | - if(strpos($v,'[+')!==false) $_lang[$k] = str_replace($s, $r, $v); |
|
| 188 | -} |
|
| 195 | +foreach($_lang as $k=>$v) { |
|
| 196 | + if(strpos($v,'[+')!==false) { |
|
| 197 | + $_lang[$k] = str_replace($s, $r, $v); |
|
| 198 | + } |
|
| 199 | + } |
|
| 189 | 200 | |
| 190 | 201 | // send the charset header |
| 191 | 202 | header('Content-Type: text/html; charset='.$modx_manager_charset); |
@@ -198,7 +209,7 @@ discard block |
||
| 198 | 209 | include_once "accesscontrol.inc.php"; |
| 199 | 210 | |
| 200 | 211 | // double check the session |
| 201 | -if(!isset($_SESSION['mgrValidated'])){ |
|
| 212 | +if(!isset($_SESSION['mgrValidated'])) { |
|
| 202 | 213 | echo "Not Logged In!"; |
| 203 | 214 | exit; |
| 204 | 215 | } |
@@ -215,7 +226,9 @@ discard block |
||
| 215 | 226 | } |
| 216 | 227 | |
| 217 | 228 | // Initialize System Alert Message Queque |
| 218 | -if (!isset($_SESSION['SystemAlertMsgQueque'])) $_SESSION['SystemAlertMsgQueque'] = array(); |
|
| 229 | +if (!isset($_SESSION['SystemAlertMsgQueque'])) { |
|
| 230 | + $_SESSION['SystemAlertMsgQueque'] = array(); |
|
| 231 | +} |
|
| 219 | 232 | $SystemAlertMsgQueque = &$_SESSION['SystemAlertMsgQueque']; |
| 220 | 233 | |
| 221 | 234 | // first we check to see if this is a frameset request |
@@ -223,7 +236,7 @@ discard block |
||
| 223 | 236 | // this looks to be a top-level frameset request, so let's serve up a frameset |
| 224 | 237 | if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/frames/1.php")) { |
| 225 | 238 | include_once "media/style/".$manager_theme."/frames/1.php"; |
| 226 | - }else{ |
|
| 239 | + } else { |
|
| 227 | 240 | include_once "frames/1.php"; |
| 228 | 241 | } |
| 229 | 242 | exit; |
@@ -231,10 +244,15 @@ discard block |
||
| 231 | 244 | |
| 232 | 245 | // OK, let's retrieve the action directive from the request |
| 233 | 246 | $option = array('min_range'=>1,'max_range'=>2000); |
| 234 | -if(isset($_GET['a']) && isset($_POST['a'])) $modx->webAlertAndQuit($_lang['error_double_action']); |
|
| 235 | -elseif(isset($_GET['a'])) $action = filter_input(INPUT_GET, 'a',FILTER_VALIDATE_INT,$option); |
|
| 236 | -elseif(isset($_POST['a'])) $action = filter_input(INPUT_POST,'a',FILTER_VALIDATE_INT,$option); |
|
| 237 | -else $action = null; |
|
| 247 | +if(isset($_GET['a']) && isset($_POST['a'])) { |
|
| 248 | + $modx->webAlertAndQuit($_lang['error_double_action']); |
|
| 249 | +} elseif(isset($_GET['a'])) { |
|
| 250 | + $action = filter_input(INPUT_GET, 'a',FILTER_VALIDATE_INT,$option); |
|
| 251 | +} elseif(isset($_POST['a'])) { |
|
| 252 | + $action = filter_input(INPUT_POST,'a',FILTER_VALIDATE_INT,$option); |
|
| 253 | +} else { |
|
| 254 | + $action = null; |
|
| 255 | +} |
|
| 238 | 256 | |
| 239 | 257 | if (isset($_POST['updateMsgCount']) && $modx->hasPermission('messages')) { |
| 240 | 258 | include_once 'messageCount.inc.php'; |
@@ -264,11 +282,12 @@ discard block |
||
| 264 | 282 | $modx->invokeEvent("OnManagerPageInit", array("action" => $action)); |
| 265 | 283 | |
| 266 | 284 | // return element filepath |
| 267 | -function includeFileProcessor ($filepath,$manager_theme) { |
|
| 285 | +function includeFileProcessor ($filepath,$manager_theme) |
|
| 286 | +{ |
|
| 268 | 287 | $element = ""; |
| 269 | 288 | if(is_file(MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath)) { |
| 270 | 289 | $element = MODX_MANAGER_PATH."media/style/".$manager_theme."/".$filepath; |
| 271 | - }else{ |
|
| 290 | + } else { |
|
| 272 | 291 | $element = $filepath; |
| 273 | 292 | } |
| 274 | 293 | return $element; |