@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | -if(!$modx->hasPermission('delete_user')) { |
|
| 2 | +if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | +if (!$modx->hasPermission('delete_user')) { |
|
| 4 | 4 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -$id = isset($_GET['id'])? intval($_GET['id']) : 0; |
|
| 8 | -if($id==0) { |
|
| 7 | +$id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
|
| 8 | +if ($id == 0) { |
|
| 9 | 9 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | // delete the user, but first check if we are deleting our own record |
| 13 | -if($id==$modx->getLoginUserID()) { |
|
| 13 | +if ($id == $modx->getLoginUserID()) { |
|
| 14 | 14 | $modx->webAlertAndQuit("You can't delete yourself!"); |
| 15 | 15 | } |
| 16 | 16 | |
@@ -48,5 +48,5 @@ discard block |
||
| 48 | 48 | "id" => $id |
| 49 | 49 | )); |
| 50 | 50 | |
| 51 | -$header="Location: index.php?a=75"; |
|
| 51 | +$header = "Location: index.php?a=75"; |
|
| 52 | 52 | header($header); |
@@ -1,13 +1,13 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (IN_MANAGER_MODE!="true") { |
|
| 2 | +if (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('messages')) { |
| 6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 7 | 7 | } |
| 8 | 8 | |
| 9 | -$id = isset($_GET['id'])? intval($_GET['id']) : 0; |
|
| 10 | -if ($id==0) { |
|
| 9 | +$id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
@@ -18,12 +18,12 @@ discard block |
||
| 18 | 18 | $modx->webAlertAndQuit("Wrong number of messages returned!"); |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | -if ($message['recipient']!=$modx->getLoginUserID()) { |
|
| 21 | +if ($message['recipient'] != $modx->getLoginUserID()) { |
|
| 22 | 22 | $modx->webAlertAndQuit("You are not allowed to delete this message!"); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | 25 | // delete message |
| 26 | 26 | $modx->db->delete($modx->getFullTableName('user_messages'), "id='{$id}'"); |
| 27 | 27 | |
| 28 | -$header="Location: index.php?a=10"; |
|
| 28 | +$header = "Location: index.php?a=10"; |
|
| 29 | 29 | header($header); |
@@ -1,24 +1,24 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE != "true") { |
|
| 2 | +if (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 | 9 | $id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
| 10 | -if($id == 0) { |
|
| 10 | +if ($id == 0) { |
|
| 11 | 11 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 12 | 12 | } |
| 13 | 13 | |
| 14 | 14 | $forced = isset($_GET['force']) ? $_GET['force'] : 0; |
| 15 | 15 | |
| 16 | 16 | // check for relations |
| 17 | -if(!$forced) { |
|
| 18 | - $drs = $modx->db->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content') . " AS sc |
|
| 19 | - INNER JOIN " . $modx->getFullTableName('site_tmplvar_contentvalues') . " AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'"); |
|
| 17 | +if (!$forced) { |
|
| 18 | + $drs = $modx->db->select('sc.id, sc.pagetitle,sc.description', $modx->getFullTableName('site_content')." AS sc |
|
| 19 | + INNER JOIN " . $modx->getFullTableName('site_tmplvar_contentvalues')." AS stcv ON stcv.contentid=sc.id", "stcv.tmplvarid='{$id}'"); |
|
| 20 | 20 | $count = $modx->db->getRecordCount($drs); |
| 21 | - if($count > 0) { |
|
| 21 | + if ($count > 0) { |
|
| 22 | 22 | include_once "header.inc.php"; |
| 23 | 23 | ?> |
| 24 | 24 | <script> |
@@ -42,8 +42,8 @@ discard block |
||
| 42 | 42 | <p><?= $_lang['tmplvar_inuse'] ?></p> |
| 43 | 43 | <ul> |
| 44 | 44 | <?php |
| 45 | - while($row = $modx->db->getRow($drs)) { |
|
| 46 | - echo '<li><span style="width: 200px"><a href="index.php?id=' . $row['id'] . '&a=27">' . $row['pagetitle'] . '</a></span>' . ($row['description'] != '' ? ' - ' . $row['description'] : '') . '</li>'; |
|
| 45 | + while ($row = $modx->db->getRow($drs)) { |
|
| 46 | + echo '<li><span style="width: 200px"><a href="index.php?id='.$row['id'].'&a=27">'.$row['pagetitle'].'</a></span>'.($row['description'] != '' ? ' - '.$row['description'] : '').'</li>'; |
|
| 47 | 47 | } |
| 48 | 48 | ?> |
| 49 | 49 | </ul> |
@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
| 30 | 30 | $categoryid = 0; |
| 31 | 31 | } else { |
| 32 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 32 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 33 | 33 | $categoryid = checkCategory($_POST['newcategory']); |
| 34 | 34 | if (!$categoryid) { |
| 35 | 35 | $categoryid = newCategory($_POST['newcategory']); |
@@ -48,12 +48,12 @@ discard block |
||
| 48 | 48 | $enable_sharedparams = isset($parsed['shareparams']) ? intval($parsed['shareparams']) : $enable_sharedparams; |
| 49 | 49 | |
| 50 | 50 | $description = isset($parsed['description']) ? $parsed['description'] : $description; |
| 51 | - $version = isset($parsed['version']) ? '<b>' . $parsed['version'] . '</b> ' : ''; |
|
| 51 | + $version = isset($parsed['version']) ? '<b>'.$parsed['version'].'</b> ' : ''; |
|
| 52 | 52 | if ($version) { |
| 53 | - $description = $version . trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
| 53 | + $description = $version.trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
| 54 | 54 | } |
| 55 | 55 | if (isset($parsed['modx_category'])) { |
| 56 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
| 56 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
| 57 | 57 | $categoryid = getCategory($parsed['modx_category']); |
| 58 | 58 | } |
| 59 | 59 | } |
@@ -111,7 +111,7 @@ discard block |
||
| 111 | 111 | // finished emptying cache - redirect |
| 112 | 112 | if ($_POST['stay'] != '') { |
| 113 | 113 | $a = ($_POST['stay'] == '2') ? "108&id=$newid" : "107"; |
| 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=106&r=2"; |
@@ -168,7 +168,7 @@ discard block |
||
| 168 | 168 | // finished emptying cache - redirect |
| 169 | 169 | if ($_POST['stay'] != '') { |
| 170 | 170 | $a = ($_POST['stay'] == '2') ? "108&id=$id" : "107"; |
| 171 | - $header = "Location: index.php?a=" . $a . "&r=2&stay=" . $_POST['stay']; |
|
| 171 | + $header = "Location: index.php?a=".$a."&r=2&stay=".$_POST['stay']; |
|
| 172 | 172 | header($header); |
| 173 | 173 | } else { |
| 174 | 174 | $modx->unlockElement(6, $id); |
@@ -1,11 +1,11 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | -if(!$modx->hasPermission('delete_snippet')) { |
|
| 2 | +if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | +if (!$modx->hasPermission('delete_snippet')) { |
|
| 4 | 4 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -$id = isset($_GET['id'])? intval($_GET['id']) : 0; |
|
| 8 | -if($id==0) { |
|
| 7 | +$id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
|
| 8 | +if ($id == 0) { |
|
| 9 | 9 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 10 | 10 | } |
| 11 | 11 | |
@@ -32,5 +32,5 @@ discard block |
||
| 32 | 32 | $modx->clearCache('full'); |
| 33 | 33 | |
| 34 | 34 | // finished emptying cache - redirect |
| 35 | -$header="Location: index.php?a=76&r=2"; |
|
| 35 | +$header = "Location: index.php?a=76&r=2"; |
|
| 36 | 36 | header($header); |
@@ -1,16 +1,16 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | -if(!$modx->hasPermission('exec_module')) { |
|
| 2 | +if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | +if (!$modx->hasPermission('exec_module')) { |
|
| 4 | 4 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -$id = isset($_GET['id'])? intval($_GET['id']) : 0; |
|
| 8 | -if($id==0) { |
|
| 7 | +$id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
|
| 8 | +if ($id == 0) { |
|
| 9 | 9 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | // check if user has access permission, except admins |
| 13 | -if($_SESSION['mgrRole']!=1){ |
|
| 13 | +if ($_SESSION['mgrRole'] != 1) { |
|
| 14 | 14 | $rs = $modx->db->select( |
| 15 | 15 | 'sma.usergroup,mg.member', |
| 16 | 16 | $modx->getFullTableName("site_module_access")." sma |
@@ -22,18 +22,18 @@ discard block |
||
| 22 | 22 | $permissionAccessInt = -1; |
| 23 | 23 | |
| 24 | 24 | while ($row = $modx->db->getRow($rs)) { |
| 25 | - if($row["usergroup"] && $row["member"]) { |
|
| 25 | + if ($row["usergroup"] && $row["member"]) { |
|
| 26 | 26 | //if there are permissions and this member has permission, ofcourse |
| 27 | 27 | //this is granted |
| 28 | 28 | $permissionAccessInt = 1; |
| 29 | - } elseif ($permissionAccessInt==-1) { |
|
| 29 | + } elseif ($permissionAccessInt == -1) { |
|
| 30 | 30 | //if there are permissions but this member has no permission and the |
| 31 | 31 | //variable was still in init state we set permission to 0; no permissions |
| 32 | 32 | $permissionAccessInt = 0; |
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | - if($permissionAccessInt==0) { |
|
| 36 | + if ($permissionAccessInt == 0) { |
|
| 37 | 37 | $modx->webAlertAndQuit("You do not sufficient privileges to execute this module.", "index.php?a=106"); |
| 38 | 38 | } |
| 39 | 39 | } |
@@ -41,10 +41,10 @@ discard block |
||
| 41 | 41 | // get module data |
| 42 | 42 | $rs = $modx->db->select('*', $modx->getFullTableName("site_modules"), "id='{$id}'"); |
| 43 | 43 | $content = $modx->db->getRow($rs); |
| 44 | -if(!$content) { |
|
| 44 | +if (!$content) { |
|
| 45 | 45 | $modx->webAlertAndQuit("No record found for id {$id}.", "index.php?a=106"); |
| 46 | 46 | } |
| 47 | -if($content['disabled']) { |
|
| 47 | +if ($content['disabled']) { |
|
| 48 | 48 | $modx->webAlertAndQuit("This module is disabled and cannot be executed.", "index.php?a=106"); |
| 49 | 49 | } |
| 50 | 50 | |
@@ -57,15 +57,15 @@ discard block |
||
| 57 | 57 | // Set the item name for logger |
| 58 | 58 | $_SESSION['itemname'] = $content['name']; |
| 59 | 59 | |
| 60 | -$output = evalModule($content["modulecode"],$parameter); |
|
| 60 | +$output = evalModule($content["modulecode"], $parameter); |
|
| 61 | 61 | echo $output; |
| 62 | 62 | include MODX_MANAGER_PATH."includes/sysalert.display.inc.php"; |
| 63 | 63 | |
| 64 | 64 | // evalModule |
| 65 | -function evalModule($moduleCode,$params){ |
|
| 65 | +function evalModule($moduleCode, $params){ |
|
| 66 | 66 | global $modx; |
| 67 | 67 | $modx->event->params = &$params; // store params inside event object |
| 68 | - if(is_array($params)) { |
|
| 68 | + if (is_array($params)) { |
|
| 69 | 69 | extract($params, EXTR_SKIP); |
| 70 | 70 | } |
| 71 | 71 | ob_start(); |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | if (isset($php_errormsg)) |
| 76 | 76 | { |
| 77 | 77 | $error_info = error_get_last(); |
| 78 | - switch($error_info['type']) |
|
| 78 | + switch ($error_info['type']) |
|
| 79 | 79 | { |
| 80 | 80 | case E_NOTICE : |
| 81 | 81 | $error_level = 1; |
@@ -89,9 +89,9 @@ discard block |
||
| 89 | 89 | default: |
| 90 | 90 | $error_level = 99; |
| 91 | 91 | } |
| 92 | - if($modx->config['error_reporting']==='99' || 2<$error_level) |
|
| 92 | + if ($modx->config['error_reporting'] === '99' || 2 < $error_level) |
|
| 93 | 93 | { |
| 94 | - $modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'] . ' - Module', $error_info['message'], $error_info['line'], $msg); |
|
| 94 | + $modx->messageQuit('PHP Parse Error', '', true, $error_info['type'], $error_info['file'], $_SESSION['itemname'].' - Module', $error_info['message'], $error_info['line'], $msg); |
|
| 95 | 95 | $modx->event->alert("An error occurred while loading. Please see the event log for more information<p>{$msg}</p>"); |
| 96 | 96 | } |
| 97 | 97 | } |
@@ -1,20 +1,20 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE != "true") { |
|
| 2 | +if (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 | 9 | $id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
| 10 | -if($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,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | -if(!$modx->hasPermission('web_access_permissions')) { |
|
| 2 | +if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | +if (!$modx->hasPermission('web_access_permissions')) { |
|
| 4 | 4 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 5 | 5 | } |
| 6 | 6 | |
@@ -20,7 +20,7 @@ discard block |
||
| 20 | 20 | switch ($operation) { |
| 21 | 21 | case "add_user_group" : |
| 22 | 22 | $newgroup = $_REQUEST['newusergroup']; |
| 23 | - if(empty($newgroup)) { |
|
| 23 | + if (empty($newgroup)) { |
|
| 24 | 24 | $modx->webAlertAndQuit("No group name specified."); |
| 25 | 25 | } else { |
| 26 | 26 | $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_webgroup_names); |
@@ -34,7 +34,7 @@ discard block |
||
| 34 | 34 | break; |
| 35 | 35 | case "add_document_group" : |
| 36 | 36 | $newgroup = $_REQUEST['newdocgroup']; |
| 37 | - if(empty($newgroup)) { |
|
| 37 | + if (empty($newgroup)) { |
|
| 38 | 38 | $modx->webAlertAndQuit("No group name specified."); |
| 39 | 39 | } else { |
| 40 | 40 | $id = $modx->db->insert(array('name'=>$modx->db->escape($newgroup)), $tbl_documentgroup_names); |
@@ -49,7 +49,7 @@ discard block |
||
| 49 | 49 | case "delete_user_group" : |
| 50 | 50 | $updategroupaccess = true; |
| 51 | 51 | $usergroup = intval($_REQUEST['usergroup']); |
| 52 | - if(empty($usergroup)) { |
|
| 52 | + if (empty($usergroup)) { |
|
| 53 | 53 | $modx->webAlertAndQuit("No user group id specified for deletion."); |
| 54 | 54 | } else { |
| 55 | 55 | $modx->db->delete($tbl_webgroup_names, "id='{$usergroup}'"); |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | break; |
| 62 | 62 | case "delete_document_group" : |
| 63 | 63 | $group = intval($_REQUEST['documentgroup']); |
| 64 | - if(empty($group)) { |
|
| 64 | + if (empty($group)) { |
|
| 65 | 65 | $modx->webAlertAndQuit("No document group id specified for deletion."); |
| 66 | 66 | } else { |
| 67 | 67 | $modx->db->delete($tbl_documentgroup_names, "id='{$group}'"); |
@@ -73,22 +73,22 @@ discard block |
||
| 73 | 73 | break; |
| 74 | 74 | case "rename_user_group" : |
| 75 | 75 | $newgroupname = $_REQUEST['newgroupname']; |
| 76 | - if(empty($newgroupname)) { |
|
| 76 | + if (empty($newgroupname)) { |
|
| 77 | 77 | $modx->webAlertAndQuit("No group name specified."); |
| 78 | 78 | } |
| 79 | 79 | $groupid = intval($_REQUEST['groupid']); |
| 80 | - if(empty($groupid)) { |
|
| 80 | + if (empty($groupid)) { |
|
| 81 | 81 | $modx->webAlertAndQuit("No user group id specified for rename."); |
| 82 | 82 | } |
| 83 | 83 | $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); |
| 84 | 84 | break; |
| 85 | 85 | case "rename_document_group" : |
| 86 | 86 | $newgroupname = $_REQUEST['newgroupname']; |
| 87 | - if(empty($newgroupname)) { |
|
| 87 | + if (empty($newgroupname)) { |
|
| 88 | 88 | $modx->webAlertAndQuit("No group name specified."); |
| 89 | 89 | } |
| 90 | 90 | $groupid = intval($_REQUEST['groupid']); |
| 91 | - if(empty($groupid)) { |
|
| 91 | + if (empty($groupid)) { |
|
| 92 | 92 | $modx->webAlertAndQuit("No document group id specified for rename."); |
| 93 | 93 | } |
| 94 | 94 | $modx->db->update(array('name' => $modx->db->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); |
@@ -99,7 +99,7 @@ discard block |
||
| 99 | 99 | $docgroup = intval($_REQUEST['docgroup']); |
| 100 | 100 | $rs = $modx->db->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
| 101 | 101 | $limit = $modx->db->getValue($rs); |
| 102 | - if($limit<=0) { |
|
| 102 | + if ($limit <= 0) { |
|
| 103 | 103 | $modx->db->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); |
| 104 | 104 | } else { |
| 105 | 105 | //alert user that coupling already exists? |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | |
| 117 | 117 | // secure web documents - flag as private |
| 118 | -if($updategroupaccess==true){ |
|
| 118 | +if ($updategroupaccess == true) { |
|
| 119 | 119 | include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
| 120 | 120 | secureWebDocument(); |
| 121 | 121 | |
@@ -1,27 +1,27 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if(IN_MANAGER_MODE!="true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | -if(!$modx->hasPermission('new_module')) { |
|
| 2 | +if (IN_MANAGER_MODE != "true") die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
| 3 | +if (!$modx->hasPermission('new_module')) { |
|
| 4 | 4 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
| 5 | 5 | } |
| 6 | 6 | |
| 7 | -$id = isset($_GET['id'])? intval($_GET['id']) : 0; |
|
| 8 | -if($id==0) { |
|
| 7 | +$id = isset($_GET['id']) ? intval($_GET['id']) : 0; |
|
| 8 | +if ($id == 0) { |
|
| 9 | 9 | $modx->webAlertAndQuit($_lang["error_no_id"]); |
| 10 | 10 | } |
| 11 | 11 | |
| 12 | 12 | // create globally unique identifiers (guid) |
| 13 | 13 | function createGUID(){ |
| 14 | - srand((double)microtime()*1000000); |
|
| 15 | - $r = rand() ; |
|
| 16 | - $u = uniqid(getmypid() . $r . (double)microtime()*1000000,1); |
|
| 17 | - $m = md5 ($u); |
|
| 14 | + srand((double) microtime() * 1000000); |
|
| 15 | + $r = rand(); |
|
| 16 | + $u = uniqid(getmypid().$r.(double) microtime() * 1000000, 1); |
|
| 17 | + $m = md5($u); |
|
| 18 | 18 | return $m; |
| 19 | 19 | } |
| 20 | 20 | |
| 21 | 21 | // count duplicates |
| 22 | 22 | $name = $modx->db->getValue($modx->db->select('name', $modx->getFullTableName('site_modules'), "id='{$id}'")); |
| 23 | 23 | $count = $modx->db->getRecordCount($modx->db->select('name', $modx->getFullTableName('site_modules'), "name LIKE '{$name} {$_lang['duplicated_el_suffix']}%'")); |
| 24 | -if($count>=1) $count = ' '.($count+1); |
|
| 24 | +if ($count >= 1) $count = ' '.($count + 1); |
|
| 25 | 25 | else $count = ''; |
| 26 | 26 | |
| 27 | 27 | // duplicate module |
@@ -66,5 +66,5 @@ discard block |
||
| 66 | 66 | $_SESSION['itemname'] = $name; |
| 67 | 67 | |
| 68 | 68 | // finish duplicating - redirect to new module |
| 69 | -$header="Location: index.php?r=2&a=108&id=$newid"; |
|
| 69 | +$header = "Location: index.php?r=2&a=108&id=$newid"; |
|
| 70 | 70 | header($header); |