@@ -1,3 +1,3 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once MODX_MANAGER_PATH . 'includes/functions/tv.php'; |
|
3 | +include_once MODX_MANAGER_PATH.'includes/functions/tv.php'; |
@@ -1,3 +1,3 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -include_once MODX_MANAGER_PATH . 'includes/functions/tv.php'; |
|
3 | +include_once MODX_MANAGER_PATH.'includes/functions/tv.php'; |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | <?php endif; ?> |
66 | 66 | <?php endif; ?> |
67 | 67 | |
68 | -<?php if ($installLevel >= 2 && $moduleSQLBaseFile) : ?> |
|
68 | +<?php if ($installLevel >= 2 && $moduleSQLBaseFile) : ?> |
|
69 | 69 | <?php if ($sqlParser->installFailed === false) : ?> |
70 | 70 | <p> |
71 | 71 | <?=$_lang['setup_database_creating_tables']?> |
@@ -76,7 +76,7 @@ discard block |
||
76 | 76 | <?php $sqlErrors = count($sqlParser->mysqlErrors); ?> |
77 | 77 | <?php for ($i = 0; $i < $sqlErrors; $i++) : ?> |
78 | 78 | <em><?=$sqlParser->mysqlErrors[$i]["error"]?></em> |
79 | - <?=$_lang['during_execution_of_sql'];?> |
|
79 | + <?=$_lang['during_execution_of_sql']; ?> |
|
80 | 80 | <span class="mono"><?=strip_tags($sqlParser->mysqlErrors[$i]["sql"])?></span> |
81 | 81 | <hr /> |
82 | 82 | <?php endfor; ?> |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | <?php $sqlErrors = count($sqlParser->mysqlErrors); ?> |
113 | 113 | <?php for ($i = 0; $i < $sqlErrors; $i++) : ?> |
114 | 114 | <em><?=$sqlParser->mysqlErrors[$i]["error"]?></em> <?=$_lang['during_execution_of_sql']?> |
115 | - <span class='mono'><?=strip_tags($sqlParser->mysqlErrors[$i]["sql"]);?></span> |
|
115 | + <span class='mono'><?=strip_tags($sqlParser->mysqlErrors[$i]["sql"]); ?></span> |
|
116 | 116 | <hr /> |
117 | 117 | <?php endfor; ?> |
118 | 118 | </p> |
@@ -130,9 +130,9 @@ discard block |
||
130 | 130 | <h3><?=$_lang['templates']?>:</h3> |
131 | 131 | <?php foreach ($installDataLevel['templates'] as $itemName => $itemData) : ?> |
132 | 132 | <?php if (empty($itemData['error'])) : ?> |
133 | - <?php if($itemData['type'] === 'create') : ?> |
|
133 | + <?php if ($itemData['type'] === 'create') : ?> |
|
134 | 134 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
135 | - <?php elseif($itemData['type'] === 'update') : ?> |
|
135 | + <?php elseif ($itemData['type'] === 'update') : ?> |
|
136 | 136 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p> |
137 | 137 | <?php endif; ?> |
138 | 138 | <?php else : ?> |
@@ -154,11 +154,11 @@ discard block |
||
154 | 154 | <h3><?=$_lang['tvs']?>:</h3> |
155 | 155 | <?php foreach ($installDataLevel['tvs'] as $itemName => $itemData) : ?> |
156 | 156 | <?php if (empty($itemData['error'])) : ?> |
157 | - <?php if($itemData['type'] === 'create') : ?> |
|
157 | + <?php if ($itemData['type'] === 'create') : ?> |
|
158 | 158 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
159 | - <?php elseif($itemData['type'] === 'update') : ?> |
|
159 | + <?php elseif ($itemData['type'] === 'update') : ?> |
|
160 | 160 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p> |
161 | - <?php elseif($itemData['type'] === 'skip') : ?> |
|
161 | + <?php elseif ($itemData['type'] === 'skip') : ?> |
|
162 | 162 | <!-- SKIP --> |
163 | 163 | <?php endif; ?> |
164 | 164 | <?php else : ?> |
@@ -173,13 +173,13 @@ discard block |
||
173 | 173 | <h3><?=$_lang['chunks']?>:</h3> |
174 | 174 | <?php foreach ($installDataLevel['chunks'] as $itemName => $itemData) : ?> |
175 | 175 | <?php if (empty($itemData['error'])) : ?> |
176 | - <?php if($itemData['type'] === 'create') : ?> |
|
176 | + <?php if ($itemData['type'] === 'create') : ?> |
|
177 | 177 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
178 | - <?php elseif($itemData['type'] === 'overwrite') : ?> |
|
178 | + <?php elseif ($itemData['type'] === 'overwrite') : ?> |
|
179 | 179 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
180 | - <?php elseif($itemData['type'] === 'update') : ?> |
|
180 | + <?php elseif ($itemData['type'] === 'update') : ?> |
|
181 | 181 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p> |
182 | - <?php elseif($itemData['type'] === 'skip') : ?> |
|
182 | + <?php elseif ($itemData['type'] === 'skip') : ?> |
|
183 | 183 | <!-- SKIP --> |
184 | 184 | <?php endif; ?> |
185 | 185 | <?php else : ?> |
@@ -201,11 +201,11 @@ discard block |
||
201 | 201 | <h3><?=$_lang['modules']?>:</h3> |
202 | 202 | <?php foreach ($installDataLevel['modules'] as $itemName => $itemData) : ?> |
203 | 203 | <?php if (empty($itemData['error'])) : ?> |
204 | - <?php if($itemData['type'] === 'create') : ?> |
|
204 | + <?php if ($itemData['type'] === 'create') : ?> |
|
205 | 205 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
206 | - <?php elseif($itemData['type'] === 'update') : ?> |
|
206 | + <?php elseif ($itemData['type'] === 'update') : ?> |
|
207 | 207 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p> |
208 | - <?php elseif($itemData['type'] === 'skip') : ?> |
|
208 | + <?php elseif ($itemData['type'] === 'skip') : ?> |
|
209 | 209 | <!-- SKIP --> |
210 | 210 | <?php endif; ?> |
211 | 211 | <?php else : ?> |
@@ -227,11 +227,11 @@ discard block |
||
227 | 227 | <h3><?=$_lang['plugins']?>:</h3> |
228 | 228 | <?php foreach ($installDataLevel['plugins'] as $itemName => $itemData) : ?> |
229 | 229 | <?php if (empty($itemData['error'])) : ?> |
230 | - <?php if($itemData['type'] === 'create') : ?> |
|
230 | + <?php if ($itemData['type'] === 'create') : ?> |
|
231 | 231 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
232 | - <?php elseif($itemData['type'] === 'update') : ?> |
|
232 | + <?php elseif ($itemData['type'] === 'update') : ?> |
|
233 | 233 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p> |
234 | - <?php elseif($itemData['type'] === 'skip') : ?> |
|
234 | + <?php elseif ($itemData['type'] === 'skip') : ?> |
|
235 | 235 | <!-- SKIP --> |
236 | 236 | <?php endif; ?> |
237 | 237 | <?php else : ?> |
@@ -253,13 +253,13 @@ discard block |
||
253 | 253 | <h3><?=$_lang['snippets']?>:</h3> |
254 | 254 | <?php foreach ($installDataLevel['snippets'] as $itemName => $itemData) : ?> |
255 | 255 | <?php if (empty($itemData['error'])) : ?> |
256 | - <?php if($itemData['type'] === 'create') : ?> |
|
256 | + <?php if ($itemData['type'] === 'create') : ?> |
|
257 | 257 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
258 | - <?php elseif($itemData['type'] === 'overwrite') : ?> |
|
258 | + <?php elseif ($itemData['type'] === 'overwrite') : ?> |
|
259 | 259 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['installed']?></span></p> |
260 | - <?php elseif($itemData['type'] === 'update') : ?> |
|
260 | + <?php elseif ($itemData['type'] === 'update') : ?> |
|
261 | 261 | <p> ✓ <?=$itemName?>: <span class="ok"><?=$_lang['upgraded']?></span></p> |
262 | - <?php elseif($itemData['type'] === 'skip') : ?> |
|
262 | + <?php elseif ($itemData['type'] === 'skip') : ?> |
|
263 | 263 | <!-- SKIP --> |
264 | 264 | <?php endif; ?> |
265 | 265 | <?php else : ?> |
@@ -286,7 +286,7 @@ discard block |
||
286 | 286 | <p><?=$_lang['setup_couldnt_install']?></p> |
287 | 287 | <p><?=$_lang['installation_error_occured']?></p> |
288 | 288 | <br /><br /> |
289 | - <?php foreach($installDataLevel['demo']['error'] as $error): ?> |
|
289 | + <?php foreach ($installDataLevel['demo']['error'] as $error): ?> |
|
290 | 290 | <em><?=$error['content']?></em> |
291 | 291 | <?=$_lang['during_execution_of_sql']?> |
292 | 292 | <span class="mono"><?=htmlspecialchars($error['sql'])?></span> |
@@ -300,9 +300,9 @@ discard block |
||
300 | 300 | <?php if ($installLevel >= 6): ?> |
301 | 301 | <?php foreach ($installDependencyLevel as $itemName => $itemData) : ?> |
302 | 302 | <?php if (empty($itemData['error'])) : ?> |
303 | - <?php if($itemData['type'] === 'create') : ?> |
|
303 | + <?php if ($itemData['type'] === 'create') : ?> |
|
304 | 304 | <p> ✓ <?=$itemName?>Module: <span class="ok"><?=$_lang['depedency_create']?></span></p> |
305 | - <?php elseif($itemData['type'] === 'update') : ?> |
|
305 | + <?php elseif ($itemData['type'] === 'update') : ?> |
|
306 | 306 | <p> ✓ <?=$itemName?>Module: <span class="ok"><?=$_lang['depedency_update']?></span></p> |
307 | 307 | <?php endif; ?> |
308 | 308 | |
@@ -370,10 +370,10 @@ discard block |
||
370 | 370 | var chk = document.install.rminstaller; |
371 | 371 | if (chk && chk.checked) { |
372 | 372 | // remove install folder and files |
373 | - window.location.href = "../<?=MGR_DIR;?>/processors/remove_installer.processor.php?rminstall=1"; |
|
373 | + window.location.href = "../<?=MGR_DIR; ?>/processors/remove_installer.processor.php?rminstall=1"; |
|
374 | 374 | } |
375 | 375 | else { |
376 | - window.location.href = "../<?=MGR_DIR;?>/"; |
|
376 | + window.location.href = "../<?=MGR_DIR; ?>/"; |
|
377 | 377 | } |
378 | 378 | } |
379 | 379 | /* ]]> */ |
@@ -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 | if (!$modx->hasPermission('save_template')) { |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | $updateMsg = ''; |
16 | 16 | |
17 | 17 | if (isset($_POST['listSubmitted'])) { |
18 | - $updateMsg .= '<span class="text-success" id="updated">' . $_lang['sort_updated'] . '</span>'; |
|
18 | + $updateMsg .= '<span class="text-success" id="updated">'.$_lang['sort_updated'].'</span>'; |
|
19 | 19 | foreach ($_POST as $listName => $listValue) { |
20 | 20 | if ($listName == 'listSubmitted' || $listName == 'reset') { |
21 | 21 | continue; |
@@ -40,11 +40,11 @@ discard block |
||
40 | 40 | $sortableList = '<div class="clearfix"><ul id="sortlist" class="sortableList">'; |
41 | 41 | while ($row = $modx->getDatabase()->getRow($rs)) { |
42 | 42 | $caption = $row['caption'] != '' ? $row['caption'] : $row['name']; |
43 | - $sortableList .= '<li id="item_' . $row['id'] . '"><i class="fa fa-list-alt"></i> ' . $caption . ' <small class="protectedNode" style="float:right">[*' . $row['name'] . '*]</small></li>'; |
|
43 | + $sortableList .= '<li id="item_'.$row['id'].'"><i class="fa fa-list-alt"></i> '.$caption.' <small class="protectedNode" style="float:right">[*'.$row['name'].'*]</small></li>'; |
|
44 | 44 | } |
45 | 45 | $sortableList .= '</ul></div>'; |
46 | 46 | } else { |
47 | - $updateMsg = '<p class="text-danger">' . $_lang['tmplvars_novars'] . '</p>'; |
|
47 | + $updateMsg = '<p class="text-danger">'.$_lang['tmplvars_novars'].'</p>'; |
|
48 | 48 | } |
49 | 49 | ?> |
50 | 50 |
@@ -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('web_access_permissions')) { |
|
5 | +if (!$modx->hasPermission('web_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->getDatabase()->insert(array('name'=>$modx->getDatabase()->escape($newgroup)), $tbl_webgroup_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->getDatabase()->insert(array('name'=>$modx->getDatabase()->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->getDatabase()->delete($tbl_webgroup_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->getDatabase()->delete($tbl_documentgroup_names, "id='{$group}'"); |
@@ -75,33 +75,33 @@ 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 user group id specified for rename."); |
84 | 84 | } |
85 | 85 | $modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_webgroup_names, "id='{$groupid}'"); |
86 | 86 | break; |
87 | 87 | case "rename_document_group" : |
88 | 88 | $newgroupname = $_REQUEST['newgroupname']; |
89 | - if(empty($newgroupname)) { |
|
89 | + if (empty($newgroupname)) { |
|
90 | 90 | $modx->webAlertAndQuit("No group name specified."); |
91 | 91 | } |
92 | - $groupid = (int)$_REQUEST['groupid']; |
|
93 | - if(empty($groupid)) { |
|
92 | + $groupid = (int) $_REQUEST['groupid']; |
|
93 | + if (empty($groupid)) { |
|
94 | 94 | $modx->webAlertAndQuit("No document group id specified for rename."); |
95 | 95 | } |
96 | 96 | $modx->getDatabase()->update(array('name' => $modx->getDatabase()->escape($newgroupname)), $tbl_documentgroup_names, "id='{$groupid}'"); |
97 | 97 | break; |
98 | 98 | case "add_document_group_to_user_group" : |
99 | 99 | $updategroupaccess = true; |
100 | - $usergroup = (int)$_REQUEST['usergroup']; |
|
101 | - $docgroup = (int)$_REQUEST['docgroup']; |
|
100 | + $usergroup = (int) $_REQUEST['usergroup']; |
|
101 | + $docgroup = (int) $_REQUEST['docgroup']; |
|
102 | 102 | $rs = $modx->getDatabase()->select('COUNT(*)', $tbl_webgroup_access, "webgroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
103 | 103 | $limit = $modx->getDatabase()->getValue($rs); |
104 | - if($limit<=0) { |
|
104 | + if ($limit <= 0) { |
|
105 | 105 | $modx->getDatabase()->insert(array('webgroup'=>$usergroup, 'documentgroup'=>$docgroup), $tbl_webgroup_access); |
106 | 106 | } else { |
107 | 107 | //alert user that coupling already exists? |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | break; |
110 | 110 | case "remove_document_group_from_user_group" : |
111 | 111 | $updategroupaccess = true; |
112 | - $coupling = (int)$_REQUEST['coupling']; |
|
112 | + $coupling = (int) $_REQUEST['coupling']; |
|
113 | 113 | $modx->getDatabase()->delete($tbl_webgroup_access, "id='{$coupling}'"); |
114 | 114 | break; |
115 | 115 | default : |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | } |
118 | 118 | |
119 | 119 | // secure web documents - flag as private |
120 | -if($updategroupaccess==true){ |
|
120 | +if ($updategroupaccess == true) { |
|
121 | 121 | include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
122 | 122 | secureWebDocument(); |
123 | 123 |
@@ -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 | exit(); |
4 | 4 | } |
5 | 5 | |
6 | -if(!$modx->hasPermission('delete_plugin')) { |
|
6 | +if (!$modx->hasPermission('delete_plugin')) { |
|
7 | 7 | $e->setError(3); |
8 | 8 | $e->dumpError(); |
9 | 9 | } |
@@ -14,18 +14,18 @@ discard block |
||
14 | 14 | // Get unique list of latest added plugins by highest sql-id |
15 | 15 | $rs = $modx->getDatabase()->query("SELECT t1.id FROM {$tbl_site_plugins} t1 LEFT JOIN {$tbl_site_plugins} t2 ON (t1.name = t2.name AND t1.id < t2.id) WHERE t2.id IS NULL;"); |
16 | 16 | $latestIds = array(); |
17 | -while($row = $modx->getDatabase()->getRow($rs)) { |
|
17 | +while ($row = $modx->getDatabase()->getRow($rs)) { |
|
18 | 18 | $latestIds[] = $row['id']; |
19 | 19 | } |
20 | 20 | |
21 | 21 | // Get list of plugins with disabled and enabled versions |
22 | 22 | $rs = $modx->getDatabase()->query("SELECT id FROM {$tbl_site_plugins} t1 WHERE disabled = 1 AND name IN (SELECT name FROM {$tbl_site_plugins} t2 WHERE t1.name = t2.name AND t1.id != t2.id)"); |
23 | 23 | |
24 | -while($row = $modx->getDatabase()->getRow($rs)) { |
|
24 | +while ($row = $modx->getDatabase()->getRow($rs)) { |
|
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)) continue; // Keep latest version of disabled plugins |
|
29 | 29 | |
30 | 30 | // invoke OnBeforePluginFormDelete event |
31 | 31 | $modx->invokeEvent('OnBeforePluginFormDelete', array('id'=> $id)); |
@@ -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_module')) { |
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->getDatabase()->escape(trim($_POST['name'])); |
11 | 11 | $description = $modx->getDatabase()->escape($_POST['description']); |
12 | 12 | $resourcefile = $modx->getDatabase()->escape($_POST['resourcefile']); |
@@ -25,11 +25,11 @@ discard block |
||
25 | 25 | |
26 | 26 | //Kyle Jaebker - added category support |
27 | 27 | if (empty($_POST['newcategory']) && $_POST['categoryid'] > 0) { |
28 | - $categoryid = (int)$_POST['categoryid']; |
|
28 | + $categoryid = (int) $_POST['categoryid']; |
|
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']); |
@@ -45,15 +45,15 @@ discard block |
||
45 | 45 | $name = isset($parsed['name']) ? $parsed['name'] : $name; |
46 | 46 | $properties = isset($parsed['properties']) ? $parsed['properties'] : $properties; |
47 | 47 | $guid = isset($parsed['guid']) ? $parsed['guid'] : $guid; |
48 | - $enable_sharedparams = isset($parsed['shareparams']) ? (int)$parsed['shareparams'] : $enable_sharedparams; |
|
48 | + $enable_sharedparams = isset($parsed['shareparams']) ? (int) $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,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->getDatabase()->insert(array('name' => $modx->getDatabase()->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->getDatabase()->insert(array('name' => $modx->getDatabase()->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->getDatabase()->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->getDatabase()->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->getDatabase()->select('COUNT(*)', $tbl_membergroup_access, "membergroup='{$usergroup}' AND documentgroup='{$docgroup}'"); |
105 | 105 | $limit = $modx->getDatabase()->getValue($rs); |
106 | - if($limit<=0) { |
|
106 | + if ($limit <= 0) { |
|
107 | 107 | $modx->getDatabase()->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->getDatabase()->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,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 | if (!$modx->hasPermission('edit_module')) { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | } |
65 | 65 | |
66 | -include_once MODX_MANAGER_PATH . "includes/header.inc.php"; |
|
66 | +include_once MODX_MANAGER_PATH."includes/header.inc.php"; |
|
67 | 67 | ?> |
68 | 68 | <script language="JavaScript" type="text/javascript"> |
69 | 69 | function saveSelection() |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | </script> |
139 | 139 | |
140 | 140 | <h1> |
141 | - <?= $title . " - " . $_lang['element_selector_title'] ?><i class="fa fa-question-circle help"></i> |
|
141 | + <?= $title." - ".$_lang['element_selector_title'] ?><i class="fa fa-question-circle help"></i> |
|
142 | 142 | </h1> |
143 | 143 | |
144 | 144 | <div id="actions"> |
@@ -183,8 +183,8 @@ discard block |
||
183 | 183 | $grd->columnHeaderClass = "tableHeader"; |
184 | 184 | $grd->itemClass = "tableItem"; |
185 | 185 | $grd->altItemClass = "tableAltItem"; |
186 | - $grd->columns = $_lang["name"] . " ," . $_lang["description"]; |
|
187 | - $grd->colTypes = "template:<input type='" . ($sm == 'm' ? 'checkbox' : 'radio') . "' name='id[]' value='[+id+]' onclick='setCheckbox(this);'> [+value+]"; |
|
186 | + $grd->columns = $_lang["name"]." ,".$_lang["description"]; |
|
187 | + $grd->colTypes = "template:<input type='".($sm == 'm' ? 'checkbox' : 'radio')."' name='id[]' value='[+id+]' onclick='setCheckbox(this);'> [+value+]"; |
|
188 | 188 | $grd->colWidths = "45%"; |
189 | 189 | $grd->fields = "name,description"; |
190 | 190 | if ($_REQUEST['listmode'] == '1') { |