@@ -30,7 +30,7 @@ discard block |
||
| 30 | 30 | $pre = null, |
| 31 | 31 | $charset = '', |
| 32 | 32 | $connection_method = 'SET CHARACTER SET' |
| 33 | - ) { |
|
| 33 | + ){ |
|
| 34 | 34 | $this->config['host'] = $host ? $host : $GLOBALS['database_server']; |
| 35 | 35 | $this->config['dbase'] = $dbase ? $dbase : $GLOBALS['dbase']; |
| 36 | 36 | $this->config['user'] = $uid ? $uid : $GLOBALS['database_user']; |
@@ -120,7 +120,7 @@ discard block |
||
| 120 | 120 | $referer = $modx->htmlspecialchars($_SERVER['HTTP_REFERER']); |
| 121 | 121 | |
| 122 | 122 | $modx->sendmail(array( |
| 123 | - 'subject' => 'Missing to create the database connection! from ' . $modx->config['site_name'], |
|
| 123 | + 'subject' => 'Missing to create the database connection! from '.$modx->config['site_name'], |
|
| 124 | 124 | 'body' => "{$logtitle}\n{$request_uri}\n{$ua}\n{$referer}", |
| 125 | 125 | 'type' => 'text' |
| 126 | 126 | ) |
@@ -137,15 +137,15 @@ discard block |
||
| 137 | 137 | } else { |
| 138 | 138 | $dbase = trim($dbase, '`'); // remove the `` chars |
| 139 | 139 | if (!@ mysql_select_db($dbase, $this->conn)) { |
| 140 | - $modx->messageQuit("Failed to select the database '" . $dbase . "'!"); |
|
| 140 | + $modx->messageQuit("Failed to select the database '".$dbase."'!"); |
|
| 141 | 141 | exit; |
| 142 | 142 | } |
| 143 | 143 | @mysql_query("{$connection_method} {$charset}", $this->conn); |
| 144 | 144 | $tend = $modx->getMicroTime(); |
| 145 | 145 | $totaltime = $tend - $tstart; |
| 146 | 146 | if ($modx->dumpSQL) { |
| 147 | - $modx->queryCode .= "<fieldset style='text-align:left'><legend>Database connection</legend>" . sprintf("Database connection was created in %2.4f s", |
|
| 148 | - $totaltime) . "</fieldset><br />"; |
|
| 147 | + $modx->queryCode .= "<fieldset style='text-align:left'><legend>Database connection</legend>".sprintf("Database connection was created in %2.4f s", |
|
| 148 | + $totaltime)."</fieldset><br />"; |
|
| 149 | 149 | } |
| 150 | 150 | if (function_exists('mysql_set_charset')) { |
| 151 | 151 | mysql_set_charset($this->config['charset']); |
@@ -225,7 +225,7 @@ discard block |
||
| 225 | 225 | case 1091: |
| 226 | 226 | break; |
| 227 | 227 | default: |
| 228 | - $modx->messageQuit('Execution of a query to the database failed - ' . $this->getLastError(), $sql); |
|
| 228 | + $modx->messageQuit('Execution of a query to the database failed - '.$this->getLastError(), $sql); |
|
| 229 | 229 | } |
| 230 | 230 | } else { |
| 231 | 231 | $tend = $modx->getMicroTime(); |
@@ -239,24 +239,24 @@ discard block |
||
| 239 | 239 | $debug_path[] = $line['function']; |
| 240 | 240 | } |
| 241 | 241 | $debug_path = implode(' > ', array_reverse($debug_path)); |
| 242 | - $modx->queryCode .= "<fieldset style='text-align:left'><legend>Query " . ($modx->executedQueries + 1) . " - " . sprintf("%2.2f ms", |
|
| 243 | - $totaltime * 1000) . "</legend>"; |
|
| 244 | - $modx->queryCode .= $sql . '<br><br>'; |
|
| 242 | + $modx->queryCode .= "<fieldset style='text-align:left'><legend>Query ".($modx->executedQueries + 1)." - ".sprintf("%2.2f ms", |
|
| 243 | + $totaltime * 1000)."</legend>"; |
|
| 244 | + $modx->queryCode .= $sql.'<br><br>'; |
|
| 245 | 245 | if ($modx->event->name) { |
| 246 | - $modx->queryCode .= 'Current Event => ' . $modx->event->name . '<br>'; |
|
| 246 | + $modx->queryCode .= 'Current Event => '.$modx->event->name.'<br>'; |
|
| 247 | 247 | } |
| 248 | 248 | if ($modx->event->activePlugin) { |
| 249 | - $modx->queryCode .= 'Current Plugin => ' . $modx->event->activePlugin . '<br>'; |
|
| 249 | + $modx->queryCode .= 'Current Plugin => '.$modx->event->activePlugin.'<br>'; |
|
| 250 | 250 | } |
| 251 | 251 | if ($modx->currentSnippet) { |
| 252 | - $modx->queryCode .= 'Current Snippet => ' . $modx->currentSnippet . '<br>'; |
|
| 252 | + $modx->queryCode .= 'Current Snippet => '.$modx->currentSnippet.'<br>'; |
|
| 253 | 253 | } |
| 254 | 254 | if (stripos($sql, 'select') === 0) { |
| 255 | - $modx->queryCode .= 'Record Count => ' . $this->getRecordCount($result) . '<br>'; |
|
| 255 | + $modx->queryCode .= 'Record Count => '.$this->getRecordCount($result).'<br>'; |
|
| 256 | 256 | } else { |
| 257 | - $modx->queryCode .= 'Affected Rows => ' . $this->getAffectedRows() . '<br>'; |
|
| 257 | + $modx->queryCode .= 'Affected Rows => '.$this->getAffectedRows().'<br>'; |
|
| 258 | 258 | } |
| 259 | - $modx->queryCode .= 'Functions Path => ' . $debug_path . '<br>'; |
|
| 259 | + $modx->queryCode .= 'Functions Path => '.$debug_path.'<br>'; |
|
| 260 | 260 | $modx->queryCode .= "</fieldset><br />"; |
| 261 | 261 | } |
| 262 | 262 | $modx->executedQueries = $modx->executedQueries + 1; |
@@ -350,9 +350,9 @@ discard block |
||
| 350 | 350 | if (is_null($value) || strtolower($value) === 'null') { |
| 351 | 351 | $flds = 'NULL'; |
| 352 | 352 | } else { |
| 353 | - $flds = "'" . $value . "'"; |
|
| 353 | + $flds = "'".$value."'"; |
|
| 354 | 354 | } |
| 355 | - $fields[$key] = "`{$key}` = " . $flds; |
|
| 355 | + $fields[$key] = "`{$key}` = ".$flds; |
|
| 356 | 356 | } |
| 357 | 357 | $fields = implode(",", $fields); |
| 358 | 358 | } |
@@ -380,13 +380,13 @@ discard block |
||
| 380 | 380 | $this->query("INSERT INTO {$intotable} {$fields}"); |
| 381 | 381 | } else { |
| 382 | 382 | if (empty($fromtable)) { |
| 383 | - $fields = "(`" . implode("`, `", array_keys($fields)) . "`) VALUES('" . implode("', '", |
|
| 384 | - array_values($fields)) . "')"; |
|
| 383 | + $fields = "(`".implode("`, `", array_keys($fields))."`) VALUES('".implode("', '", |
|
| 384 | + array_values($fields))."')"; |
|
| 385 | 385 | $rt = $this->query("INSERT INTO {$intotable} {$fields}"); |
| 386 | 386 | } else { |
| 387 | 387 | if (version_compare($this->getVersion(), "4.0.14") >= 0) { |
| 388 | 388 | $fromtable = $this->replaceFullTableName($fromtable); |
| 389 | - $fields = "(" . implode(",", array_keys($fields)) . ")"; |
|
| 389 | + $fields = "(".implode(",", array_keys($fields)).")"; |
|
| 390 | 390 | $where = trim($where); |
| 391 | 391 | $limit = trim($limit); |
| 392 | 392 | if ($where !== '' && stripos($where, 'WHERE') !== 0) { |
@@ -399,8 +399,8 @@ discard block |
||
| 399 | 399 | } else { |
| 400 | 400 | $ds = $this->select($fromfields, $fromtable, $where, '', $limit); |
| 401 | 401 | while ($row = $this->getRow($ds)) { |
| 402 | - $fields = "(" . implode(",", array_keys($fields)) . ") VALUES('" . implode("', '", |
|
| 403 | - $row) . "')"; |
|
| 402 | + $fields = "(".implode(",", array_keys($fields)).") VALUES('".implode("', '", |
|
| 403 | + $row)."')"; |
|
| 404 | 404 | $rt = $this->query("INSERT INTO {$intotable} {$fields}"); |
| 405 | 405 | } |
| 406 | 406 | } |
@@ -485,7 +485,7 @@ discard block |
||
| 485 | 485 | public function getInsertId($conn = null) |
| 486 | 486 | { |
| 487 | 487 | if (!is_resource($conn)) { |
| 488 | - $conn =& $this->conn; |
|
| 488 | + $conn = & $this->conn; |
|
| 489 | 489 | } |
| 490 | 490 | |
| 491 | 491 | return mysql_insert_id($conn); |
@@ -498,7 +498,7 @@ discard block |
||
| 498 | 498 | public function getAffectedRows($conn = null) |
| 499 | 499 | { |
| 500 | 500 | if (!is_resource($conn)) { |
| 501 | - $conn =& $this->conn; |
|
| 501 | + $conn = & $this->conn; |
|
| 502 | 502 | } |
| 503 | 503 | |
| 504 | 504 | return mysql_affected_rows($conn); |
@@ -511,7 +511,7 @@ discard block |
||
| 511 | 511 | public function getLastError($conn = null) |
| 512 | 512 | { |
| 513 | 513 | if (!is_resource($conn)) { |
| 514 | - $conn =& $this->conn; |
|
| 514 | + $conn = & $this->conn; |
|
| 515 | 515 | } |
| 516 | 516 | |
| 517 | 517 | return mysql_error($conn); |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | global $ContextMenuCnt; |
| 4 | 4 | $ContextMenuCnt = 0; |
| 5 | 5 | |
| 6 | -class ContextMenu { |
|
| 6 | +class ContextMenu{ |
|
| 7 | 7 | public $id; |
| 8 | 8 | /** |
| 9 | 9 | * @var string |
@@ -18,56 +18,56 @@ discard block |
||
| 18 | 18 | */ |
| 19 | 19 | public $width = 120; |
| 20 | 20 | |
| 21 | - public function __construct($id = '', $width = 120, $visible = false) { |
|
| 21 | + public function __construct($id = '', $width = 120, $visible = false){ |
|
| 22 | 22 | global $ContextMenuCnt; |
| 23 | 23 | $ContextMenuCnt++; |
| 24 | 24 | $this->html = ""; |
| 25 | 25 | $this->visible = $visible ? $visible : false; |
| 26 | - $this->width = is_numeric($width) ? (int)$width : 120; |
|
| 27 | - $this->id = $id ? $id : "cntxMnu" . $ContextMenuCnt; // set id |
|
| 26 | + $this->width = is_numeric($width) ? (int) $width : 120; |
|
| 27 | + $this->id = $id ? $id : "cntxMnu".$ContextMenuCnt; // set id |
|
| 28 | 28 | } |
| 29 | 29 | |
| 30 | - public function addItem($text, $action = "", $img = "", $disabled = 0) { |
|
| 30 | + public function addItem($text, $action = "", $img = "", $disabled = 0){ |
|
| 31 | 31 | global $base_url, $_style; |
| 32 | - if($disabled) { |
|
| 32 | + if ($disabled) { |
|
| 33 | 33 | return; |
| 34 | 34 | } |
| 35 | - if(!$img) { |
|
| 36 | - $img = $base_url . $_style['tx']; |
|
| 35 | + if (!$img) { |
|
| 36 | + $img = $base_url.$_style['tx']; |
|
| 37 | 37 | } |
| 38 | - if(substr($action, 0, 3) == "js:") { |
|
| 38 | + if (substr($action, 0, 3) == "js:") { |
|
| 39 | 39 | $action = substr($action, 3); |
| 40 | - } else if(substr($action, 0, 3) == "hl:") { |
|
| 41 | - $action = "window.location.href='" . substr($action, 3) . "'"; |
|
| 40 | + } else if (substr($action, 0, 3) == "hl:") { |
|
| 41 | + $action = "window.location.href='".substr($action, 3)."'"; |
|
| 42 | 42 | } else { |
| 43 | - $action = "window.location.href='" . $action . "'"; |
|
| 43 | + $action = "window.location.href='".$action."'"; |
|
| 44 | 44 | } |
| 45 | - $action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('" . $this->id . "');\""; |
|
| 46 | - $this->html .= "<div class='" . ($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem") . "' $action>"; |
|
| 47 | - if(substr($img, 0, 5) == 'fa fa') { |
|
| 48 | - $img = '<i class="' . $img . '"></i>'; |
|
| 49 | - } else if(substr($img, 0, 1) != '<') { |
|
| 50 | - $img = '<img src="' . $img . '" />'; |
|
| 45 | + $action = " onmouseover=\"this.className='cntxMnuItemOver';\" onmouseout=\"this.className='cntxMnuItem';\" onclick=\"$action; hideCntxMenu('".$this->id."');\""; |
|
| 46 | + $this->html .= "<div class='".($disabled ? "cntxMnuItemDisabled" : "cntxMnuItem")."' $action>"; |
|
| 47 | + if (substr($img, 0, 5) == 'fa fa') { |
|
| 48 | + $img = '<i class="'.$img.'"></i>'; |
|
| 49 | + } else if (substr($img, 0, 1) != '<') { |
|
| 50 | + $img = '<img src="'.$img.'" />'; |
|
| 51 | 51 | } |
| 52 | - $this->html .= $img . ' ' . $text . '</div>'; |
|
| 52 | + $this->html .= $img.' '.$text.'</div>'; |
|
| 53 | 53 | } |
| 54 | 54 | |
| 55 | - public function addSeparator() { |
|
| 55 | + public function addSeparator(){ |
|
| 56 | 56 | $this->html .= " |
| 57 | 57 | <div class='cntxMnuSeparator'></div> |
| 58 | 58 | "; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | - public function render() { |
|
| 61 | + public function render(){ |
|
| 62 | 62 | global $ContextMenuScript; |
| 63 | 63 | |
| 64 | - $html = $ContextMenuScript . "<div id='" . $this->id . "' class='contextMenu' style='width:" . $this->width . "px; visibility:" . ($this->visible ? 'visible' : 'hidden') . "'>" . $this->html . "</div>"; |
|
| 64 | + $html = $ContextMenuScript."<div id='".$this->id."' class='contextMenu' style='width:".$this->width."px; visibility:".($this->visible ? 'visible' : 'hidden')."'>".$this->html."</div>"; |
|
| 65 | 65 | $ContextMenuScript = ""; // reset css |
| 66 | 66 | return $html; |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | - public function getClientScriptObject() { |
|
| 70 | - return "getCntxMenu('" . $this->id . "')"; |
|
| 69 | + public function getClientScriptObject(){ |
|
| 70 | + return "getCntxMenu('".$this->id."')"; |
|
| 71 | 71 | } |
| 72 | 72 | } |
| 73 | 73 | |
@@ -1,9 +1,9 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | |
| 6 | -$lockElementId = (int)$lockElementId; |
|
| 6 | +$lockElementId = (int) $lockElementId; |
|
| 7 | 7 | |
| 8 | 8 | if ($lockElementId > 0) { |
| 9 | 9 | ?> |
@@ -18,7 +18,7 @@ discard block |
||
| 18 | 18 | var stay = document.getElementById('stay'); |
| 19 | 19 | // Trigger unlock |
| 20 | 20 | if ((stay && stay.value !== '2') || !form_save) { |
| 21 | - var url = '<?php echo MODX_MANAGER_URL; ?>?a=67&type=<?php echo $lockElementType;?>&id=<?php echo $lockElementId;?>&o=' + Math.random(); |
|
| 21 | + var url = '<?php echo MODX_MANAGER_URL; ?>?a=67&type=<?php echo $lockElementType; ?>&id=<?php echo $lockElementId; ?>&o=' + Math.random(); |
|
| 22 | 22 | if (navigator.sendBeacon) { |
| 23 | 23 | navigator.sendBeacon(url) |
| 24 | 24 | } else { |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('delete_plugin')) { |
|
| 5 | +if (!$modx->hasPermission('delete_plugin')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
| 10 | -if($id==0) { |
|
| 9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
@@ -37,5 +37,5 @@ discard block |
||
| 37 | 37 | $modx->clearCache('full'); |
| 38 | 38 | |
| 39 | 39 | // finished emptying cache - redirect |
| 40 | -$header="Location: index.php?a=76&r=2"; |
|
| 40 | +$header = "Location: index.php?a=76&r=2"; |
|
| 41 | 41 | header($header); |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('delete_snippet')) { |
|
| 5 | +if (!$modx->hasPermission('delete_snippet')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id'])? (int)$_GET['id'] : 0; |
|
| 10 | -if($id==0) { |
|
| 9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
@@ -34,5 +34,5 @@ discard block |
||
| 34 | 34 | $modx->clearCache('full'); |
| 35 | 35 | |
| 36 | 36 | // finished emptying cache - redirect |
| 37 | -$header="Location: index.php?a=76&r=2"; |
|
| 37 | +$header = "Location: index.php?a=76&r=2"; |
|
| 38 | 38 | header($header); |
@@ -1,12 +1,12 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | 5 | if (!$modx->hasPermission('save_snippet')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = (int)$_POST['id']; |
|
| 9 | +$id = (int) $_POST['id']; |
|
| 10 | 10 | $snippet = trim($_POST['post']); |
| 11 | 11 | $name = $modx->db->escape(trim($_POST['name'])); |
| 12 | 12 | $description = $modx->db->escape($_POST['description']); |
@@ -33,11 +33,11 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | //Kyle Jaebker - added category support |
| 35 | 35 | if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) { |
| 36 | - $categoryid = (int)$_POST['categoryid']; |
|
| 36 | + $categoryid = (int) $_POST['categoryid']; |
|
| 37 | 37 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
| 38 | 38 | $categoryid = 0; |
| 39 | 39 | } else { |
| 40 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 40 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 41 | 41 | $categoryid = checkCategory($_POST['newcategory']); |
| 42 | 42 | if (!$categoryid) { |
| 43 | 43 | $categoryid = newCategory($_POST['newcategory']); |
@@ -55,12 +55,12 @@ discard block |
||
| 55 | 55 | $moduleguid = isset($parsed['guid']) ? $parsed['guid'] : $moduleguid; |
| 56 | 56 | |
| 57 | 57 | $description = isset($parsed['description']) ? $parsed['description'] : $description; |
| 58 | - $version = isset($parsed['version']) ? '<b>' . $parsed['version'] . '</b> ' : ''; |
|
| 58 | + $version = isset($parsed['version']) ? '<b>'.$parsed['version'].'</b> ' : ''; |
|
| 59 | 59 | if ($version) { |
| 60 | - $description = $version . trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
| 60 | + $description = $version.trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
| 61 | 61 | } |
| 62 | 62 | if (isset($parsed['modx_category'])) { |
| 63 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 63 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 64 | 64 | $categoryid = getCategory($parsed['modx_category']); |
| 65 | 65 | } |
| 66 | 66 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | // finished emptying cache - redirect |
| 112 | 112 | if ($_POST['stay'] != '') { |
| 113 | 113 | $a = ($_POST['stay'] == '2') ? "22&id=$newid" : "23"; |
| 114 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
| 114 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
| 115 | 115 | header($header); |
| 116 | 116 | } else { |
| 117 | 117 | $header = "Location: index.php?a=76&r=2"; |
@@ -163,7 +163,7 @@ discard block |
||
| 163 | 163 | // finished emptying cache - redirect |
| 164 | 164 | if ($_POST['stay'] != '') { |
| 165 | 165 | $a = ($_POST['stay'] == '2') ? "22&id=$id" : "23"; |
| 166 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
| 166 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
| 167 | 167 | header($header); |
| 168 | 168 | } else { |
| 169 | 169 | $modx->unlockElement(4, $id); |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('access_permissions')) { |
|
| 5 | +if (!$modx->hasPermission('access_permissions')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | switch ($operation) { |
| 23 | 23 | case "add_user_group" : |
| 24 | 24 | $newgroup = $_REQUEST['newusergroup']; |
| 25 | - if(empty($newgroup)) { |
|
| 25 | + if (empty($newgroup)) { |
|
| 26 | 26 | $modx->webAlertAndQuit("No group name specified."); |
| 27 | 27 | } else { |
| 28 | 28 | $id = $modx->db->insert(array('name' => $modx->db->escape($newgroup)), $tbl_membergroup_names); |
@@ -36,7 +36,7 @@ discard block |
||
| 36 | 36 | break; |
| 37 | 37 | case "add_document_group" : |
| 38 | 38 | $newgroup = $_REQUEST['newdocgroup']; |
| 39 | - if(empty($newgroup)) { |
|
| 39 | + if (empty($newgroup)) { |
|
| 40 | 40 | $modx->webAlertAndQuit("No group name specified."); |
| 41 | 41 | } else { |
| 42 | 42 | $id = $modx->db->insert(array('name' => $modx->db->escape($newgroup)), $tbl_documentgroup_names); |
@@ -50,8 +50,8 @@ discard block |
||
| 50 | 50 | break; |
| 51 | 51 | case "delete_user_group" : |
| 52 | 52 | $updategroupaccess = true; |
| 53 | - $usergroup = (int)$_REQUEST['usergroup']; |
|
| 54 | - if(empty($usergroup)) { |
|
| 53 | + $usergroup = (int) $_REQUEST['usergroup']; |
|
| 54 | + if (empty($usergroup)) { |
|
| 55 | 55 | $modx->webAlertAndQuit("No user group id specified for deletion."); |
| 56 | 56 | } else { |
| 57 | 57 | $modx->db->delete($tbl_membergroup_names, "id='{$usergroup}'"); |
@@ -62,8 +62,8 @@ discard block |
||
| 62 | 62 | } |
| 63 | 63 | break; |
| 64 | 64 | case "delete_document_group" : |
| 65 | - $group = (int)$_REQUEST['documentgroup']; |
|
| 66 | - if(empty($group)) { |
|
| 65 | + $group = (int) $_REQUEST['documentgroup']; |
|
| 66 | + if (empty($group)) { |
|
| 67 | 67 | $modx->webAlertAndQuit("No document group id specified for deletion."); |
| 68 | 68 | } else { |
| 69 | 69 | $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); |
@@ -75,11 +75,11 @@ discard block |
||
| 75 | 75 | break; |
| 76 | 76 | case "rename_user_group" : |
| 77 | 77 | $newgroupname = $_REQUEST['newgroupname']; |
| 78 | - if(empty($newgroupname)) { |
|
| 78 | + if (empty($newgroupname)) { |
|
| 79 | 79 | $modx->webAlertAndQuit("No group name specified."); |
| 80 | 80 | } |
| 81 | - $groupid = (int)$_REQUEST['groupid']; |
|
| 82 | - if(empty($groupid)) { |
|
| 81 | + $groupid = (int) $_REQUEST['groupid']; |
|
| 82 | + if (empty($groupid)) { |
|
| 83 | 83 | $modx->webAlertAndQuit("No group id specified for rename."); |
| 84 | 84 | } |
| 85 | 85 | |
@@ -87,11 +87,11 @@ discard block |
||
| 87 | 87 | break; |
| 88 | 88 | case "rename_document_group" : |
| 89 | 89 | $newgroupname = $_REQUEST['newgroupname']; |
| 90 | - if(empty($newgroupname)) { |
|
| 90 | + if (empty($newgroupname)) { |
|
| 91 | 91 | $modx->webAlertAndQuit("No group name specified."); |
| 92 | 92 | } |
| 93 | - $groupid = (int)$_REQUEST['groupid']; |
|
| 94 | - if(empty($groupid)) { |
|
| 93 | + $groupid = (int) $_REQUEST['groupid']; |
|
| 94 | + if (empty($groupid)) { |
|
| 95 | 95 | $modx->webAlertAndQuit("No group id specified for rename."); |
| 96 | 96 | } |
| 97 | 97 | |
@@ -99,11 +99,11 @@ discard block |
||
| 99 | 99 | break; |
| 100 | 100 | case "add_document_group_to_user_group" : |
| 101 | 101 | $updategroupaccess = true; |
| 102 | - $usergroup = (int)$_REQUEST['usergroup']; |
|
| 103 | - $docgroup = (int)$_REQUEST['docgroup']; |
|
| 102 | + $usergroup = (int) $_REQUEST['usergroup']; |
|
| 103 | + $docgroup = (int) $_REQUEST['docgroup']; |
|
| 104 | 104 | $rs = $modx->db->select('COUNT(*)', $tbl_membergroup_access, "membergroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
| 105 | 105 | $limit = $modx->db->getValue($rs); |
| 106 | - if($limit<=0) { |
|
| 106 | + if ($limit <= 0) { |
|
| 107 | 107 | $modx->db->insert(array('membergroup' => $usergroup, 'documentgroup' => $docgroup), $tbl_membergroup_access); |
| 108 | 108 | } else { |
| 109 | 109 | //alert user that coupling already exists? |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | break; |
| 112 | 112 | case "remove_document_group_from_user_group" : |
| 113 | 113 | $updategroupaccess = true; |
| 114 | - $coupling = (int)$_REQUEST['coupling']; |
|
| 114 | + $coupling = (int) $_REQUEST['coupling']; |
|
| 115 | 115 | $modx->db->delete($tbl_membergroup_access, "id='{$coupling}'"); |
| 116 | 116 | break; |
| 117 | 117 | default : |
@@ -119,7 +119,7 @@ discard block |
||
| 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 | |
@@ -1,20 +1,20 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | -if(!$modx->hasPermission('delete_template')) { |
|
| 5 | +if (!$modx->hasPermission('delete_template')) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id']) ? (int)$_GET['id'] : 0; |
|
| 10 | -if($id == 0) { |
|
| 9 | +$id = isset($_GET['id']) ? (int) $_GET['id'] : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | // delete the template, but first check it doesn't have any documents using it |
| 15 | 15 | $rs = $modx->db->select('id, pagetitle,introtext', $modx->getFullTableName('site_content'), "template='{$id}' AND deleted=0"); |
| 16 | 16 | $limit = $modx->db->getRecordCount($rs); |
| 17 | -if($limit > 0) { |
|
| 17 | +if ($limit > 0) { |
|
| 18 | 18 | include "header.inc.php"; |
| 19 | 19 | ?> |
| 20 | 20 | |
@@ -28,8 +28,8 @@ discard block |
||
| 28 | 28 | <p>Documents using this template:</p> |
| 29 | 29 | <ul> |
| 30 | 30 | <?php |
| 31 | - while($row = $modx->db->getRow($rs)) { |
|
| 32 | - echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['introtext'] != '' ? ' - ' . $row['introtext'] : '') . '</li>'; |
|
| 31 | + while ($row = $modx->db->getRow($rs)) { |
|
| 32 | + echo '<li><span style="width: 200px"><a href="index.php?id='.$row['id'].'&a=27">'.$row['pagetitle'].'</a></span>'.($row['introtext'] != '' ? ' - '.$row['introtext'] : '').'</li>'; |
|
| 33 | 33 | } |
| 34 | 34 | ?> |
| 35 | 35 | </ul> |
@@ -40,7 +40,7 @@ discard block |
||
| 40 | 40 | exit; |
| 41 | 41 | } |
| 42 | 42 | |
| 43 | -if($id == $default_template) { |
|
| 43 | +if ($id == $default_template) { |
|
| 44 | 44 | $modx->webAlertAndQuit("This template is set as the default template. Please choose a different default template in the MODX configuration before deleting this template."); |
| 45 | 45 | } |
| 46 | 46 | |
@@ -1,8 +1,8 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
| 3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
| 4 | 4 | } |
| 5 | -if(!($modx->hasPermission('settings') && ($modx->hasPermission('logs')||$modx->hasPermission('bk_manager')))) { |
|
| 5 | +if (!($modx->hasPermission('settings') && ($modx->hasPermission('logs') || $modx->hasPermission('bk_manager')))) { |
|
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -32,6 +32,6 @@ discard block |
||
| 32 | 32 | $modx->webAlertAndQuit($_lang["error_no_optimise_tablename"]); |
| 33 | 33 | } |
| 34 | 34 | |
| 35 | -$mode = (int)$_REQUEST['mode']; |
|
| 36 | -$header="Location: index.php?a={$mode}&s=4"; |
|
| 35 | +$mode = (int) $_REQUEST['mode']; |
|
| 36 | +$header = "Location: index.php?a={$mode}&s=4"; |
|
| 37 | 37 | header($header); |