@@ -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_plugin')) { |
6 | 6 | $modx->webAlertAndQuit($_lang['error_no_privileges']); |
7 | 7 | } |
8 | 8 | |
9 | -$id = (int)$_POST['id']; |
|
9 | +$id = (int) $_POST['id']; |
|
10 | 10 | $name = $modx->db->escape(trim($_POST['name'])); |
11 | 11 | $description = $modx->db->escape($_POST['description']); |
12 | 12 | $locked = $_POST['locked'] == 'on' ? '1' : '0'; |
@@ -20,11 +20,11 @@ discard block |
||
20 | 20 | |
21 | 21 | //Kyle Jaebker - added category support |
22 | 22 | if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) { |
23 | - $categoryid = (int)$_POST['categoryid']; |
|
23 | + $categoryid = (int) $_POST['categoryid']; |
|
24 | 24 | } elseif (empty($_POST['newcategory']) && $_POST['categoryid'] <= 0) { |
25 | 25 | $categoryid = 0; |
26 | 26 | } else { |
27 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
27 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
28 | 28 | $categoryid = getCategory($_POST['newcategory']); |
29 | 29 | } |
30 | 30 | |
@@ -40,12 +40,12 @@ discard block |
||
40 | 40 | $moduleguid = isset($parsed['guid']) ? $parsed['guid'] : $moduleguid; |
41 | 41 | |
42 | 42 | $description = isset($parsed['description']) ? $parsed['description'] : $description; |
43 | - $version = isset($parsed['version']) ? '<b>' . $parsed['version'] . '</b> ' : ''; |
|
43 | + $version = isset($parsed['version']) ? '<b>'.$parsed['version'].'</b> ' : ''; |
|
44 | 44 | if ($version) { |
45 | - $description = $version . trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
45 | + $description = $version.trim(preg_replace('/(<b>.+?)+(<\/b>)/i', '', $description)); |
|
46 | 46 | } |
47 | 47 | if (isset($parsed['modx_category'])) { |
48 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
48 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
49 | 49 | $categoryid = getCategory($parsed['modx_category']); |
50 | 50 | } |
51 | 51 | } |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | // finished emptying cache - redirect |
104 | 104 | if ($_POST['stay'] != '') { |
105 | 105 | $a = ($_POST['stay'] == '2') ? "102&id=$newid" : '101'; |
106 | - $header = 'Location: index.php?a=' . $a . '&r=2&stay=' . $_POST['stay']; |
|
106 | + $header = 'Location: index.php?a='.$a.'&r=2&stay='.$_POST['stay']; |
|
107 | 107 | header($header); |
108 | 108 | } else { |
109 | 109 | $header = 'Location: index.php?a=76&r=2'; |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | // finished emptying cache - redirect |
159 | 159 | if ($_POST['stay'] != '') { |
160 | 160 | $a = ($_POST['stay'] == '2') ? "102&id=$id" : '101'; |
161 | - $header = 'Location: index.php?a=' . $a . '&r=2&stay=' . $_POST['stay']; |
|
161 | + $header = 'Location: index.php?a='.$a.'&r=2&stay='.$_POST['stay']; |
|
162 | 162 | header($header); |
163 | 163 | } else { |
164 | 164 | $modx->unlockElement(5, $id); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | // save selected system events |
178 | 178 | $formEventList = array(); |
179 | 179 | foreach ($sysevents as $evtId) { |
180 | - if(!preg_match('@^[1-9][0-9]*$@',$evtId)) $evtId = getEventIdByName($evtId); |
|
180 | + if (!preg_match('@^[1-9][0-9]*$@', $evtId)) $evtId = getEventIdByName($evtId); |
|
181 | 181 | if ($mode == '101') { |
182 | 182 | $rs = $modx->db->select('max(priority) as priority', '[+prefix+]site_plugin_events', "evtid='{$evtId}'"); |
183 | 183 | } else { |
@@ -202,13 +202,13 @@ discard block |
||
202 | 202 | $rs = $modx->db->select('*', '[+prefix+]site_plugin_events', sprintf("pluginid='%s'", $id)); |
203 | 203 | $dbEventList = array(); |
204 | 204 | $del = array(); |
205 | - while($row = $modx->db->getRow($rs)) { |
|
206 | - if(!in_array($row['evtid'], $evtids)) $del[] = $row['evtid']; |
|
205 | + while ($row = $modx->db->getRow($rs)) { |
|
206 | + if (!in_array($row['evtid'], $evtids)) $del[] = $row['evtid']; |
|
207 | 207 | } |
208 | 208 | |
209 | - if(empty($del)) return; |
|
209 | + if (empty($del)) return; |
|
210 | 210 | |
211 | - foreach($del as $delid) { |
|
211 | + foreach ($del as $delid) { |
|
212 | 212 | $modx->db->delete('[+prefix+]site_plugin_events', sprintf("evtid='%s' AND pluginid='%s'", $delid, $id)); |
213 | 213 | } |
214 | 214 | } |
@@ -220,9 +220,9 @@ discard block |
||
220 | 220 | function getEventIdByName($name) |
221 | 221 | { |
222 | 222 | $modx = evolutionCMS(); |
223 | - static $eventIds=array(); |
|
223 | + static $eventIds = array(); |
|
224 | 224 | |
225 | - if(isset($eventIds[$name])) return $eventIds[$name]; |
|
225 | + if (isset($eventIds[$name])) return $eventIds[$name]; |
|
226 | 226 | |
227 | 227 | $rs = $modx->db->select('id, name', '[+prefix+]system_eventnames'); |
228 | 228 | while ($row = $modx->db->getRow($rs)) { |
@@ -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('edit_document')) { |
|
5 | +if (!$modx->hasPermission('edit_document')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$newParentID = isset($_REQUEST['new_parent']) ? (int)$_REQUEST['new_parent'] : 0; |
|
10 | -$documentID = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
9 | +$newParentID = isset($_REQUEST['new_parent']) ? (int) $_REQUEST['new_parent'] : 0; |
|
10 | +$documentID = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
11 | 11 | |
12 | 12 | // ok, two things to check. |
13 | 13 | // first, document cannot be moved to itself |
14 | 14 | // second, new parent must be a folder. If not, set it to folder. |
15 | -if($documentID==$newParentID) $modx->webAlertAndQuit($_lang["error_movedocument1"]); |
|
16 | -if($documentID <= 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
17 | -if($newParentID < 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
15 | +if ($documentID == $newParentID) $modx->webAlertAndQuit($_lang["error_movedocument1"]); |
|
16 | +if ($documentID <= 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
17 | +if ($newParentID < 0) $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
|
18 | 18 | |
19 | 19 | $parents = $modx->getParentIds($newParentID); |
20 | 20 | if (in_array($documentID, $parents)) $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
@@ -26,7 +26,7 @@ discard block |
||
26 | 26 | |
27 | 27 | if ($use_udperms == 1) { |
28 | 28 | if ($oldparent != $newParentID) { |
29 | - include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; |
|
29 | + include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; |
|
30 | 30 | $udperms = new udperms(); |
31 | 31 | $udperms->user = $modx->getLoginUserID(); |
32 | 32 | $udperms->document = $newParentID; |
@@ -42,28 +42,28 @@ discard block |
||
42 | 42 | * @param int $currDocID |
43 | 43 | * @return array |
44 | 44 | */ |
45 | -function allChildren($currDocID) { |
|
45 | +function allChildren($currDocID){ |
|
46 | 46 | $modx = evolutionCMS(); |
47 | - $children= array(); |
|
47 | + $children = array(); |
|
48 | 48 | $currDocID = $modx->db->escape($currDocID); |
49 | 49 | $rs = $modx->db->select('id', $modx->getFullTableName('site_content'), "parent = '{$currDocID}'"); |
50 | - while ($child= $modx->db->getRow($rs)) { |
|
51 | - $children[]= $child['id']; |
|
52 | - $children= array_merge($children, allChildren($child['id'])); |
|
50 | + while ($child = $modx->db->getRow($rs)) { |
|
51 | + $children[] = $child['id']; |
|
52 | + $children = array_merge($children, allChildren($child['id'])); |
|
53 | 53 | } |
54 | 54 | return $children; |
55 | 55 | } |
56 | 56 | |
57 | -$evtOut = $modx->invokeEvent("onBeforeMoveDocument", array ( |
|
57 | +$evtOut = $modx->invokeEvent("onBeforeMoveDocument", array( |
|
58 | 58 | "id_document" => $documentID, |
59 | 59 | "old_parent" => $oldparent, |
60 | 60 | "new_parent" => $newParentID |
61 | 61 | )); |
62 | -if (is_array($evtOut) && count($evtOut) > 0){ |
|
62 | +if (is_array($evtOut) && count($evtOut) > 0) { |
|
63 | 63 | $newParent = array_pop($evtOut); |
64 | - if($newParent == $oldparent) { |
|
64 | + if ($newParent == $oldparent) { |
|
65 | 65 | $modx->webAlertAndQuit($_lang["error_movedocument2"]); |
66 | - }else{ |
|
66 | + } else { |
|
67 | 67 | $newParentID = $newParent; |
68 | 68 | } |
69 | 69 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | $rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('site_content'), "parent='{$oldparent}'"); |
85 | 85 | $limit = $modx->db->getValue($rs); |
86 | 86 | |
87 | - if(!$limit>0) { |
|
87 | + if (!$limit > 0) { |
|
88 | 88 | $modx->db->update(array( |
89 | 89 | 'isfolder' => 0, |
90 | 90 | ), $modx->getFullTableName('site_content'), "id='{$oldparent}'"); |
@@ -93,7 +93,7 @@ discard block |
||
93 | 93 | $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$documentID}'")); |
94 | 94 | $_SESSION['itemname'] = $pagetitle; |
95 | 95 | |
96 | - $modx->invokeEvent("onAfterMoveDocument", array ( |
|
96 | + $modx->invokeEvent("onAfterMoveDocument", array( |
|
97 | 97 | "id_document" => $documentID, |
98 | 98 | "old_parent" => $oldparent, |
99 | 99 | "new_parent" => $newParentID |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | // empty cache & sync site |
103 | 103 | $modx->clearCache('full'); |
104 | 104 | |
105 | - $header="Location: index.php?a=3&id={$documentID}&r=9"; |
|
105 | + $header = "Location: index.php?a=3&id={$documentID}&r=9"; |
|
106 | 106 | header($header); |
107 | 107 | } else { |
108 | 108 | $modx->webAlertAndQuit("You cannot move a document to a child document!"); |
@@ -1,27 +1,27 @@ 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('new_document') || !$modx->hasPermission('save_document')) { |
|
5 | +if (!$modx->hasPermission('new_document') || !$modx->hasPermission('save_document')) { |
|
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 | $children = array(); |
15 | 15 | |
16 | 16 | // check permissions on the document |
17 | -include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; |
|
17 | +include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; |
|
18 | 18 | $udperms = new udperms(); |
19 | 19 | $udperms->user = $modx->getLoginUserID(); |
20 | 20 | $udperms->document = $id; |
21 | 21 | $udperms->role = $_SESSION['mgrRole']; |
22 | 22 | $udperms->duplicateDoc = true; |
23 | 23 | |
24 | -if(!$udperms->checkPermissions()) { |
|
24 | +if (!$udperms->checkPermissions()) { |
|
25 | 25 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
26 | 26 | } |
27 | 27 | |
@@ -33,7 +33,7 @@ discard block |
||
33 | 33 | $_SESSION['itemname'] = $name; |
34 | 34 | |
35 | 35 | // finish cloning - redirect |
36 | -$header="Location: index.php?r=1&a=3&id=$id"; |
|
36 | +$header = "Location: index.php?r=1&a=3&id=$id"; |
|
37 | 37 | header($header); |
38 | 38 | |
39 | 39 | /** |
@@ -42,7 +42,7 @@ discard block |
||
42 | 42 | * @param int $_toplevel |
43 | 43 | * @return int |
44 | 44 | */ |
45 | -function duplicateDocument($docid, $parent=null, $_toplevel=0) { |
|
45 | +function duplicateDocument($docid, $parent = null, $_toplevel = 0){ |
|
46 | 46 | $modx = evolutionCMS(); global $_lang; |
47 | 47 | |
48 | 48 | // invoke OnBeforeDocDuplicate event |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | $content = $modx->db->getRow($rs); |
64 | 64 | |
65 | 65 | // Handle incremental ID |
66 | - switch($modx->config['docid_incrmnt_method']) |
|
66 | + switch ($modx->config['docid_incrmnt_method']) |
|
67 | 67 | { |
68 | 68 | case '1': |
69 | 69 | $from = "{$tblsc} AS T0 LEFT JOIN {$tblsc} AS T1 ON T0.id + 1 = T1.id"; |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $content['id'] = $modx->db->getValue($rs); |
72 | 72 | break; |
73 | 73 | case '2': |
74 | - $rs = $modx->db->select('MAX(id)+1',$tblsc); |
|
74 | + $rs = $modx->db->select('MAX(id)+1', $tblsc); |
|
75 | 75 | $content['id'] = $modx->db->getValue($rs); |
76 | 76 | break; |
77 | 77 | |
@@ -85,12 +85,12 @@ discard block |
||
85 | 85 | $pagetitle = $modx->db->getValue($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "id='{$docid}'")); |
86 | 86 | $pagetitle = $modx->db->escape($pagetitle); |
87 | 87 | $count = $modx->db->getRecordCount($modx->db->select('pagetitle', $modx->getFullTableName('site_content'), "pagetitle LIKE '{$pagetitle} Duplicate%'")); |
88 | - if($count>=1) $count = ' '.($count+1); |
|
88 | + if ($count >= 1) $count = ' '.($count + 1); |
|
89 | 89 | else $count = ''; |
90 | 90 | |
91 | 91 | $content['pagetitle'] = $_lang['duplicated_el_suffix'].$count.' '.$content['pagetitle']; |
92 | 92 | $content['alias'] = null; |
93 | - } elseif($modx->config['friendly_urls'] == 0 || $modx->config['allow_duplicate_alias'] == 0) { |
|
93 | + } elseif ($modx->config['friendly_urls'] == 0 || $modx->config['allow_duplicate_alias'] == 0) { |
|
94 | 94 | $content['alias'] = null; |
95 | 95 | } |
96 | 96 | |
@@ -153,8 +153,8 @@ discard block |
||
153 | 153 | |
154 | 154 | $tbltvc = $modx->getFullTableName('site_tmplvar_contentvalues'); |
155 | 155 | |
156 | - $newid = (int)$newid; |
|
157 | - $oldid = (int)$oldid; |
|
156 | + $newid = (int) $newid; |
|
157 | + $oldid = (int) $oldid; |
|
158 | 158 | |
159 | 159 | $modx->db->insert( |
160 | 160 | array('contentid'=>'', 'tmplvarid'=>'', 'value'=>''), $tbltvc, // Insert into |
@@ -173,8 +173,8 @@ discard block |
||
173 | 173 | |
174 | 174 | $tbldg = $modx->getFullTableName('document_groups'); |
175 | 175 | |
176 | - $newid = (int)$newid; |
|
177 | - $oldid = (int)$oldid; |
|
176 | + $newid = (int) $newid; |
|
177 | + $oldid = (int) $oldid; |
|
178 | 178 | |
179 | 179 | $modx->db->insert( |
180 | 180 | array('document'=>'', 'document_group'=>''), $tbldg, // Insert into |
@@ -4,14 +4,14 @@ discard block |
||
4 | 4 | $site_sessionname = genEvoSessionName(); // For legacy extras not using startCMSSession |
5 | 5 | |
6 | 6 | |
7 | -if( ! function_exists('evolutionCMS')) { |
|
7 | +if (!function_exists('evolutionCMS')) { |
|
8 | 8 | /** |
9 | 9 | * @return DocumentParser |
10 | 10 | */ |
11 | 11 | function evolutionCMS() |
12 | 12 | { |
13 | - if( ! defined('MODX_CLASS')) { |
|
14 | - if( ! class_exists('DocumentParser')) { |
|
13 | + if (!defined('MODX_CLASS')) { |
|
14 | + if (!class_exists('DocumentParser')) { |
|
15 | 15 | throw new RuntimeException('MODX_CLASS not defined and DocumentParser class not exists'); |
16 | 16 | } |
17 | 17 | define('MODX_CLASS', 'DocumentParser'); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | $_ = crc32(__FILE__); |
30 | 30 | $_ = sprintf('%u', $_); |
31 | 31 | |
32 | - return 'evo' . base_convert($_, 10, 36); |
|
32 | + return 'evo'.base_convert($_, 10, 36); |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | function startCMSSession() |
39 | 39 | { |
40 | 40 | global $site_sessionname, $https_port, $session_cookie_path, $session_cookie_domain; |
41 | - if(MODX_CLI) return; |
|
41 | + if (MODX_CLI) return; |
|
42 | 42 | |
43 | 43 | session_name($site_sessionname); |
44 | 44 | removeInvalidCmsSessionIds($site_sessionname); |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | session_start(); |
51 | 51 | $key = "modx.mgr.session.cookie.lifetime"; |
52 | 52 | if (isset($_SESSION[$key]) && is_numeric($_SESSION[$key])) { |
53 | - $cookieLifetime = (int)$_SESSION[$key]; |
|
53 | + $cookieLifetime = (int) $_SESSION[$key]; |
|
54 | 54 | if ($cookieLifetime) { |
55 | 55 | $cookieExpiration = $_SERVER['REQUEST_TIME'] + $cookieLifetime; |
56 | 56 | } |
@@ -79,7 +79,7 @@ discard block |
||
79 | 79 | */ |
80 | 80 | function removeInvalidCmsSessionIds($session_name) |
81 | 81 | { |
82 | - if(MODX_CLI) return; |
|
82 | + if (MODX_CLI) return; |
|
83 | 83 | // session ids is invalid iff it is empty string |
84 | 84 | // storage priorioty can see in PHP source ext/session/session.c |
85 | 85 | removeInvalidCmsSessionFromStorage($_COOKIE, $session_name); |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | // Determine upgradeability |
3 | 3 | $upgradeable = 0; |
4 | -if (is_file($base_path . MGR_DIR . '/includes/config.inc.php')) { // Include the file so we can test its validity |
|
5 | - include_once $base_path . MGR_DIR . '/includes/config.inc.php'; |
|
4 | +if (is_file($base_path.MGR_DIR.'/includes/config.inc.php')) { // Include the file so we can test its validity |
|
5 | + include_once $base_path.MGR_DIR.'/includes/config.inc.php'; |
|
6 | 6 | // We need to have all connection settings - tho prefix may be empty so we have to ignore it |
7 | 7 | if (isset($dbase)) { |
8 | 8 | if (!$conn = @mysqli_connect($database_server, $database_user, $database_password)) |
@@ -17,16 +17,16 @@ discard block |
||
17 | 17 | } |
18 | 18 | |
19 | 19 | $ph['moduleName'] = $moduleName; |
20 | -$ph['displayNew'] = ($upgradeable!=0) ? 'display:none;' : ''; |
|
21 | -$ph['displayUpg'] = ($upgradeable==0) ? 'display:none;' : ''; |
|
20 | +$ph['displayNew'] = ($upgradeable != 0) ? 'display:none;' : ''; |
|
21 | +$ph['displayUpg'] = ($upgradeable == 0) ? 'display:none;' : ''; |
|
22 | 22 | $ph['displayAdvUpg'] = $ph['displayUpg']; |
23 | -$ph['checkedNew'] = !$upgradeable ? 'checked' : ''; |
|
24 | -$ph['checkedUpg'] = ($_POST['installmode']==1 || $upgradeable==1) ? 'checked' : ''; |
|
25 | -$ph['checkedAdvUpg'] = ($_POST['installmode']==2 || $upgradeable==2) ? 'checked' : ''; |
|
23 | +$ph['checkedNew'] = !$upgradeable ? 'checked' : ''; |
|
24 | +$ph['checkedUpg'] = ($_POST['installmode'] == 1 || $upgradeable == 1) ? 'checked' : ''; |
|
25 | +$ph['checkedAdvUpg'] = ($_POST['installmode'] == 2 || $upgradeable == 2) ? 'checked' : ''; |
|
26 | 26 | $ph['install_language'] = $install_language; |
27 | -$ph['disabledUpg'] = ($upgradeable!=1) ? 'disabled' : ''; |
|
28 | -$ph['disabledAdvUpg'] = ($upgradeable==0) ? 'disabled' : ''; |
|
27 | +$ph['disabledUpg'] = ($upgradeable != 1) ? 'disabled' : ''; |
|
28 | +$ph['disabledAdvUpg'] = ($upgradeable == 0) ? 'disabled' : ''; |
|
29 | 29 | |
30 | -$tpl = file_get_contents($base_path . 'install/actions/tpl_mode.html'); |
|
30 | +$tpl = file_get_contents($base_path.'install/actions/tpl_mode.html'); |
|
31 | 31 | $content = parse($tpl, $ph); |
32 | -echo parse($content, $_lang,'[%','%]'); |
|
32 | +echo parse($content, $_lang, '[%', '%]'); |
@@ -278,7 +278,7 @@ discard block |
||
278 | 278 | case 'new' : |
279 | 279 | |
280 | 280 | // invoke OnBeforeDocFormSave event |
281 | - switch($modx->config['docid_incrmnt_method']) |
|
281 | + switch ($modx->config['docid_incrmnt_method']) |
|
282 | 282 | { |
283 | 283 | case '1': |
284 | 284 | $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
@@ -489,7 +489,7 @@ discard block |
||
489 | 489 | if (!$was_published && $published) { |
490 | 490 | $publishedon = $currentdate; |
491 | 491 | $publishedby = $modx->getLoginUserID(); |
492 | - }elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
|
492 | + }elseif ((!empty($pub_date) && $pub_date <= $currentdate && $published)) { |
|
493 | 493 | $publishedon = $pub_date; |
494 | 494 | $publishedby = $modx->getLoginUserID(); |
495 | 495 | }elseif ($was_published && !$published) { |
@@ -501,7 +501,7 @@ discard block |
||
501 | 501 | } |
502 | 502 | |
503 | 503 | // invoke OnBeforeDocFormSave event |
504 | - $modx->invokeEvent("OnBeforeDocFormSave", array ( |
|
504 | + $modx->invokeEvent("OnBeforeDocFormSave", array( |
|
505 | 505 | "mode" => "upd", |
506 | 506 | "id" => $id |
507 | 507 | )); |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | . "menuindex={$menuindex}, " |
527 | 527 | . "searchable={$searchable}, " |
528 | 528 | . "cacheable={$cacheable}, " |
529 | - . "editedby=" . $modx->getLoginUserID() . ", " |
|
529 | + . "editedby=".$modx->getLoginUserID().", " |
|
530 | 530 | . "editedon={$currentdate}, " |
531 | 531 | . "publishedon={$publishedon}, " |
532 | 532 | . "publishedby={$publishedby}, " |
@@ -540,7 +540,7 @@ discard block |
||
540 | 540 | |
541 | 541 | // update template variables |
542 | 542 | $rs = $modx->db->select('id, tmplvarid', $tbl_site_tmplvar_contentvalues, "contentid='{$id}'"); |
543 | - $tvIds = array (); |
|
543 | + $tvIds = array(); |
|
544 | 544 | while ($row = $modx->db->getRow($rs)) { |
545 | 545 | $tvIds[$row['tmplvarid']] = $row['id']; |
546 | 546 | } |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | 'groups.id, groups.document_group', |
594 | 594 | "{$tbl_document_groups} AS groups |
595 | 595 | LEFT JOIN {$tbl_documentgroup_names} AS dgn ON dgn.id = groups.document_group", |
596 | - "((1=".(int)$isManager." AND dgn.private_memgroup) OR (1=".(int)$isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" |
|
596 | + "((1=".(int) $isManager." AND dgn.private_memgroup) OR (1=".(int) $isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" |
|
597 | 597 | ); |
598 | 598 | $old_groups = array(); |
599 | 599 | while ($row = $modx->db->getRow($rs)) $old_groups[$row['document_group']] = $row['id']; |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | unset($old_groups[$group]); |
606 | 606 | continue; |
607 | 607 | } elseif ($link_id == 'new') { |
608 | - $insertions[] = '('.(int)$group.','.$id.')'; |
|
608 | + $insertions[] = '('.(int) $group.','.$id.')'; |
|
609 | 609 | } |
610 | 610 | } |
611 | 611 | if (!empty($insertions)) { |
@@ -637,17 +637,17 @@ discard block |
||
637 | 637 | |
638 | 638 | |
639 | 639 | // invoke OnDocFormSave event |
640 | - $modx->invokeEvent("OnDocFormSave", array ( |
|
640 | + $modx->invokeEvent("OnDocFormSave", array( |
|
641 | 641 | "mode" => "upd", |
642 | 642 | "id" => $id |
643 | 643 | )); |
644 | 644 | |
645 | 645 | // secure web documents - flag as private |
646 | - include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; |
|
646 | + include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
|
647 | 647 | secureWebDocument($id); |
648 | 648 | |
649 | 649 | // secure manager documents - flag as private |
650 | - include MODX_MANAGER_PATH . "includes/secure_mgr_documents.inc.php"; |
|
650 | + include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
|
651 | 651 | secureMgrDocument($id); |
652 | 652 | |
653 | 653 | // Set the item name for logger |
@@ -673,13 +673,13 @@ discard block |
||
673 | 673 | // document |
674 | 674 | $a = ($_POST['stay'] == '2') ? "27&id=$id" : "4&pid=$parent"; |
675 | 675 | } |
676 | - $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'].$add_path; |
|
676 | + $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay'].$add_path; |
|
677 | 677 | } else { |
678 | 678 | $header = "Location: index.php?a=3&id=$id&r=1".$add_path; |
679 | 679 | } |
680 | 680 | } |
681 | 681 | if (headers_sent()) { |
682 | - $header = str_replace('Location: ','',$header); |
|
682 | + $header = str_replace('Location: ', '', $header); |
|
683 | 683 | echo "<script>document.location.href='$header';</script>\n"; |
684 | 684 | } else { |
685 | 685 | header($header); |
@@ -1,5 +1,5 @@ |
||
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 | ?> |
@@ -1,5 +1,5 @@ |
||
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 | ?> |
@@ -1,5 +1,5 @@ |
||
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 | ?> |