@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
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('access_permissions')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // Get table names (alphabetical) |
@@ -18,24 +18,24 @@ discard block |
||
18 | 18 | // find all document groups, for the select :) |
19 | 19 | $rs = $modx->getDatabase()->select('*', $tbl_documentgroup_names, '', 'name'); |
20 | 20 | if($modx->getDatabase()->getRecordCount($rs) < 1) { |
21 | - $docgroupselector = '[no groups to add]'; |
|
21 | + $docgroupselector = '[no groups to add]'; |
|
22 | 22 | } else { |
23 | - $docgroupselector = '<select name="docgroup">' . "\n"; |
|
24 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
25 | - $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
26 | - } |
|
27 | - $docgroupselector .= "</select>\n"; |
|
23 | + $docgroupselector = '<select name="docgroup">' . "\n"; |
|
24 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
25 | + $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
26 | + } |
|
27 | + $docgroupselector .= "</select>\n"; |
|
28 | 28 | } |
29 | 29 | |
30 | 30 | $rs = $modx->getDatabase()->select('*', $tbl_membergroup_names, '', 'name'); |
31 | 31 | if($modx->getDatabase()->getRecordCount($rs) < 1) { |
32 | - $usrgroupselector = '[no user groups]'; |
|
32 | + $usrgroupselector = '[no user groups]'; |
|
33 | 33 | } else { |
34 | - $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
35 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
36 | - $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
37 | - } |
|
38 | - $usrgroupselector .= "</select>\n"; |
|
34 | + $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
35 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
36 | + $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
37 | + } |
|
38 | + $usrgroupselector .= "</select>\n"; |
|
39 | 39 | } |
40 | 40 | |
41 | 41 | ?> |
@@ -96,24 +96,24 @@ discard block |
||
96 | 96 | </form> |
97 | 97 | </div> |
98 | 98 | <?php |
99 | - $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames |
|
99 | + $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames |
|
100 | 100 | LEFT JOIN ' . $tbl_member_groups . ' AS groups ON groups.user_group = groupnames.id |
101 | 101 | LEFT JOIN ' . $tbl_manager_users . ' AS users ON users.id = groups.member', '', 'groupnames.name, user_name'); |
102 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
103 | - ?> |
|
102 | + if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
103 | + ?> |
|
104 | 104 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
105 | 105 | <?php |
106 | - } else { |
|
107 | - ?> |
|
106 | + } else { |
|
107 | + ?> |
|
108 | 108 | <div class="form-group"> |
109 | 109 | <?php |
110 | - $pid = ''; |
|
111 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
112 | - if($pid != $row['id']) { |
|
113 | - if($pid != '') { |
|
114 | - echo '</div><div class="form-group">'; |
|
115 | - } |
|
116 | - ?> |
|
110 | + $pid = ''; |
|
111 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
112 | + if($pid != $row['id']) { |
|
113 | + if($pid != '') { |
|
114 | + echo '</div><div class="form-group">'; |
|
115 | + } |
|
116 | + ?> |
|
117 | 117 | <form method="post" action="index.php" name="accesspermissions"> |
118 | 118 | <input type="hidden" name="a" value="41" /> |
119 | 119 | <input type="hidden" name="groupid" value="<?= $row['id'] ?>" /> |
@@ -128,21 +128,21 @@ discard block |
||
128 | 128 | </form> |
129 | 129 | <?= $_lang['access_permissions_users_in_group'] ?> |
130 | 130 | <?php |
131 | - } |
|
132 | - if(!$row['user_id']) { |
|
133 | - ?> |
|
131 | + } |
|
132 | + if(!$row['user_id']) { |
|
133 | + ?> |
|
134 | 134 | <i><?= $_lang['access_permissions_no_users_in_group'] ?></i> |
135 | 135 | <?php |
136 | - $pid = $row['id']; |
|
137 | - continue; |
|
138 | - } |
|
139 | - ?> |
|
136 | + $pid = $row['id']; |
|
137 | + continue; |
|
138 | + } |
|
139 | + ?> |
|
140 | 140 | <?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=12&id=<?= $row['user_id'] ?>"><?= $row['user_name'] ?></a> |
141 | 141 | <?php |
142 | - $pid = $row['id']; |
|
143 | - } |
|
144 | - } |
|
145 | - ?> |
|
142 | + $pid = $row['id']; |
|
143 | + } |
|
144 | + } |
|
145 | + ?> |
|
146 | 146 | </div> |
147 | 147 | </div> |
148 | 148 | </div> |
@@ -167,24 +167,24 @@ discard block |
||
167 | 167 | </form> |
168 | 168 | </div> |
169 | 169 | <?php |
170 | - $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames |
|
170 | + $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames |
|
171 | 171 | LEFT JOIN ' . $tbl_document_groups . ' AS dg ON dg.document_group = dgnames.id |
172 | 172 | LEFT JOIN ' . $tbl_site_content . ' AS sc ON sc.id = dg.document', '', 'dgnames.name, sc.id'); |
173 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
174 | - ?> |
|
173 | + if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
174 | + ?> |
|
175 | 175 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
176 | 176 | <?php |
177 | - } else { |
|
178 | - ?> |
|
177 | + } else { |
|
178 | + ?> |
|
179 | 179 | <div class="form-group"> |
180 | 180 | <?php |
181 | - $pid = ''; |
|
182 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
183 | - if($pid != $row['id']) { |
|
184 | - if($pid != '') { |
|
185 | - echo '</div><div class="form-group">'; |
|
186 | - } |
|
187 | - ?> |
|
181 | + $pid = ''; |
|
182 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
183 | + if($pid != $row['id']) { |
|
184 | + if($pid != '') { |
|
185 | + echo '</div><div class="form-group">'; |
|
186 | + } |
|
187 | + ?> |
|
188 | 188 | <form method="post" action="index.php" name="accesspermissions"> |
189 | 189 | <input type="hidden" name="a" value="41" /> |
190 | 190 | <input type="hidden" name="groupid" value="<?= $row['id'] ?>" /> |
@@ -199,21 +199,21 @@ discard block |
||
199 | 199 | </form> |
200 | 200 | <?= $_lang['access_permissions_resources_in_group'] ?> |
201 | 201 | <?php |
202 | - } |
|
203 | - if(!$row['doc_id']) { |
|
204 | - ?> |
|
202 | + } |
|
203 | + if(!$row['doc_id']) { |
|
204 | + ?> |
|
205 | 205 | <i><?= $_lang['access_permissions_no_resources_in_group'] ?></i> |
206 | 206 | <?php |
207 | - $pid = $row['id']; |
|
208 | - continue; |
|
209 | - } |
|
210 | - ?> |
|
207 | + $pid = $row['id']; |
|
208 | + continue; |
|
209 | + } |
|
210 | + ?> |
|
211 | 211 | <?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=3&id=<?= $row['doc_id'] ?>" title="<?= $modx->getPhpCompat()->htmlspecialchars($row['doc_title']) ?>"><?= $row['doc_id'] ?></a> |
212 | 212 | <?php |
213 | - $pid = $row['id']; |
|
214 | - } |
|
215 | - } |
|
216 | - ?> |
|
213 | + $pid = $row['id']; |
|
214 | + } |
|
215 | + } |
|
216 | + ?> |
|
217 | 217 | </div> |
218 | 218 | </div> |
219 | 219 | </div> |
@@ -225,16 +225,16 @@ discard block |
||
225 | 225 | <div class="container container-body"> |
226 | 226 | <p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p> |
227 | 227 | <?php |
228 | - // User/Document Group Links |
|
229 | - $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames |
|
228 | + // User/Document Group Links |
|
229 | + $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames |
|
230 | 230 | LEFT JOIN ' . $tbl_membergroup_access . ' AS groupacc ON groupacc.membergroup = groupnames.id |
231 | 231 | LEFT JOIN ' . $tbl_documentgroup_names . ' AS dgnames ON dgnames.id = groupacc.documentgroup', '', 'name, dg_name'); |
232 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
233 | - ?> |
|
232 | + if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
233 | + ?> |
|
234 | 234 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
235 | 235 | <?php |
236 | - } else { |
|
237 | - ?> |
|
236 | + } else { |
|
237 | + ?> |
|
238 | 238 | <div class="form-group"> |
239 | 239 | <b><?= $_lang["access_permissions_group_link"] ?></b> |
240 | 240 | <form method="post" action="index.php" name="accesspermissions"> |
@@ -250,38 +250,38 @@ discard block |
||
250 | 250 | <hr> |
251 | 251 | <ul> |
252 | 252 | <?php |
253 | - $pid = ''; |
|
254 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
255 | - if($row['id'] != $pid) { |
|
256 | - if($pid != '') { |
|
257 | - echo '</ul></li>'; |
|
258 | - } // close previous one |
|
259 | - ?> |
|
253 | + $pid = ''; |
|
254 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
255 | + if($row['id'] != $pid) { |
|
256 | + if($pid != '') { |
|
257 | + echo '</ul></li>'; |
|
258 | + } // close previous one |
|
259 | + ?> |
|
260 | 260 | <li><b><?= $row['name'] ?></b></li> |
261 | 261 | <?php |
262 | - if(!$row['dg_id']) { |
|
263 | - echo '<i>' . $_lang['no_groups_found'] . '</i></li>'; |
|
264 | - $pid = ''; |
|
265 | - continue; |
|
266 | - } else { |
|
267 | - echo '<ul>'; |
|
268 | - } |
|
269 | - } |
|
270 | - if(!$row['dg_id']) { |
|
271 | - continue; |
|
272 | - } |
|
273 | - ?> |
|
262 | + if(!$row['dg_id']) { |
|
263 | + echo '<i>' . $_lang['no_groups_found'] . '</i></li>'; |
|
264 | + $pid = ''; |
|
265 | + continue; |
|
266 | + } else { |
|
267 | + echo '<ul>'; |
|
268 | + } |
|
269 | + } |
|
270 | + if(!$row['dg_id']) { |
|
271 | + continue; |
|
272 | + } |
|
273 | + ?> |
|
274 | 274 | <li><?= $row['dg_name'] ?> |
275 | 275 | <small><i>(<a class="text-danger" href="index.php?a=41&coupling=<?= $row['link_id'] ?>&operation=remove_document_group_from_user_group"><?= $_lang['remove'] ?></a>)</i></small> |
276 | 276 | </li> |
277 | 277 | <?php |
278 | - $pid = $row['id']; |
|
279 | - } |
|
280 | - ?> |
|
278 | + $pid = $row['id']; |
|
279 | + } |
|
280 | + ?> |
|
281 | 281 | </ul> |
282 | 282 | <?php |
283 | - } |
|
284 | - ?> |
|
283 | + } |
|
284 | + ?> |
|
285 | 285 | </div> |
286 | 286 | </div> |
287 | 287 |
@@ -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 | |
@@ -17,23 +17,23 @@ discard block |
||
17 | 17 | |
18 | 18 | // find all document groups, for the select :) |
19 | 19 | $rs = $modx->getDatabase()->select('*', $tbl_documentgroup_names, '', 'name'); |
20 | -if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
20 | +if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
21 | 21 | $docgroupselector = '[no groups to add]'; |
22 | 22 | } else { |
23 | - $docgroupselector = '<select name="docgroup">' . "\n"; |
|
24 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
25 | - $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
23 | + $docgroupselector = '<select name="docgroup">'."\n"; |
|
24 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
25 | + $docgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n"; |
|
26 | 26 | } |
27 | 27 | $docgroupselector .= "</select>\n"; |
28 | 28 | } |
29 | 29 | |
30 | 30 | $rs = $modx->getDatabase()->select('*', $tbl_membergroup_names, '', 'name'); |
31 | -if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
31 | +if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
32 | 32 | $usrgroupselector = '[no user groups]'; |
33 | 33 | } else { |
34 | - $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
35 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
36 | - $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
34 | + $usrgroupselector = '<select name="usergroup">'."\n"; |
|
35 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
36 | + $usrgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n"; |
|
37 | 37 | } |
38 | 38 | $usrgroupselector .= "</select>\n"; |
39 | 39 | } |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | <div class="alert alert-info"><?= $_lang['access_permissions_introtext'] ?></div> |
70 | 70 | </div> |
71 | 71 | |
72 | -<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">' . $_lang['access_permissions_off'] . '</div>' : '') ?></div> |
|
72 | +<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">'.$_lang['access_permissions_off'].'</div>' : '') ?></div> |
|
73 | 73 | |
74 | 74 | <div class="tab-pane" id="uapPane"> |
75 | 75 | <script type="text/javascript"> |
@@ -96,10 +96,10 @@ discard block |
||
96 | 96 | </form> |
97 | 97 | </div> |
98 | 98 | <?php |
99 | - $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names . ' AS groupnames |
|
100 | - LEFT JOIN ' . $tbl_member_groups . ' AS groups ON groups.user_group = groupnames.id |
|
101 | - LEFT JOIN ' . $tbl_manager_users . ' AS users ON users.id = groups.member', '', 'groupnames.name, user_name'); |
|
102 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
99 | + $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name', $tbl_membergroup_names.' AS groupnames |
|
100 | + LEFT JOIN ' . $tbl_member_groups.' AS groups ON groups.user_group = groupnames.id |
|
101 | + LEFT JOIN ' . $tbl_manager_users.' AS users ON users.id = groups.member', '', 'groupnames.name, user_name'); |
|
102 | + if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
103 | 103 | ?> |
104 | 104 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
105 | 105 | <?php |
@@ -108,9 +108,9 @@ discard block |
||
108 | 108 | <div class="form-group"> |
109 | 109 | <?php |
110 | 110 | $pid = ''; |
111 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
112 | - if($pid != $row['id']) { |
|
113 | - if($pid != '') { |
|
111 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
112 | + if ($pid != $row['id']) { |
|
113 | + if ($pid != '') { |
|
114 | 114 | echo '</div><div class="form-group">'; |
115 | 115 | } |
116 | 116 | ?> |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | <?= $_lang['access_permissions_users_in_group'] ?> |
130 | 130 | <?php |
131 | 131 | } |
132 | - if(!$row['user_id']) { |
|
132 | + if (!$row['user_id']) { |
|
133 | 133 | ?> |
134 | 134 | <i><?= $_lang['access_permissions_no_users_in_group'] ?></i> |
135 | 135 | <?php |
@@ -167,10 +167,10 @@ discard block |
||
167 | 167 | </form> |
168 | 168 | </div> |
169 | 169 | <?php |
170 | - $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names . ' AS dgnames |
|
171 | - LEFT JOIN ' . $tbl_document_groups . ' AS dg ON dg.document_group = dgnames.id |
|
172 | - LEFT JOIN ' . $tbl_site_content . ' AS sc ON sc.id = dg.document', '', 'dgnames.name, sc.id'); |
|
173 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
170 | + $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $tbl_documentgroup_names.' AS dgnames |
|
171 | + LEFT JOIN ' . $tbl_document_groups.' AS dg ON dg.document_group = dgnames.id |
|
172 | + LEFT JOIN ' . $tbl_site_content.' AS sc ON sc.id = dg.document', '', 'dgnames.name, sc.id'); |
|
173 | + if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
174 | 174 | ?> |
175 | 175 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
176 | 176 | <?php |
@@ -179,9 +179,9 @@ discard block |
||
179 | 179 | <div class="form-group"> |
180 | 180 | <?php |
181 | 181 | $pid = ''; |
182 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
183 | - if($pid != $row['id']) { |
|
184 | - if($pid != '') { |
|
182 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
183 | + if ($pid != $row['id']) { |
|
184 | + if ($pid != '') { |
|
185 | 185 | echo '</div><div class="form-group">'; |
186 | 186 | } |
187 | 187 | ?> |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | <?= $_lang['access_permissions_resources_in_group'] ?> |
201 | 201 | <?php |
202 | 202 | } |
203 | - if(!$row['doc_id']) { |
|
203 | + if (!$row['doc_id']) { |
|
204 | 204 | ?> |
205 | 205 | <i><?= $_lang['access_permissions_no_resources_in_group'] ?></i> |
206 | 206 | <?php |
@@ -226,10 +226,10 @@ discard block |
||
226 | 226 | <p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p> |
227 | 227 | <?php |
228 | 228 | // User/Document Group Links |
229 | - $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names . ' AS groupnames |
|
230 | - LEFT JOIN ' . $tbl_membergroup_access . ' AS groupacc ON groupacc.membergroup = groupnames.id |
|
231 | - LEFT JOIN ' . $tbl_documentgroup_names . ' AS dgnames ON dgnames.id = groupacc.documentgroup', '', 'name, dg_name'); |
|
232 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
229 | + $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $tbl_membergroup_names.' AS groupnames |
|
230 | + LEFT JOIN ' . $tbl_membergroup_access.' AS groupacc ON groupacc.membergroup = groupnames.id |
|
231 | + LEFT JOIN ' . $tbl_documentgroup_names.' AS dgnames ON dgnames.id = groupacc.documentgroup', '', 'name, dg_name'); |
|
232 | + if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
233 | 233 | ?> |
234 | 234 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
235 | 235 | <?php |
@@ -251,23 +251,23 @@ discard block |
||
251 | 251 | <ul> |
252 | 252 | <?php |
253 | 253 | $pid = ''; |
254 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
255 | - if($row['id'] != $pid) { |
|
256 | - if($pid != '') { |
|
254 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
255 | + if ($row['id'] != $pid) { |
|
256 | + if ($pid != '') { |
|
257 | 257 | echo '</ul></li>'; |
258 | 258 | } // close previous one |
259 | 259 | ?> |
260 | 260 | <li><b><?= $row['name'] ?></b></li> |
261 | 261 | <?php |
262 | - if(!$row['dg_id']) { |
|
263 | - echo '<i>' . $_lang['no_groups_found'] . '</i></li>'; |
|
262 | + if (!$row['dg_id']) { |
|
263 | + echo '<i>'.$_lang['no_groups_found'].'</i></li>'; |
|
264 | 264 | $pid = ''; |
265 | 265 | continue; |
266 | 266 | } else { |
267 | 267 | echo '<ul>'; |
268 | 268 | } |
269 | 269 | } |
270 | - if(!$row['dg_id']) { |
|
270 | + if (!$row['dg_id']) { |
|
271 | 271 | continue; |
272 | 272 | } |
273 | 273 | ?> |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.'); |
|
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 | 6 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
7 | 7 | |
8 | 8 | if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { |
9 | - // seems to be a new install - send the user to the configuration page |
|
10 | - exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>'); |
|
9 | + // seems to be a new install - send the user to the configuration page |
|
10 | + exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>'); |
|
11 | 11 | } |
12 | 12 | |
13 | 13 | // set placeholders |
@@ -17,93 +17,93 @@ discard block |
||
17 | 17 | |
18 | 18 | // setup message info |
19 | 19 | if($modx->hasPermission('messages')) { |
20 | - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
21 | - $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
|
22 | - $_SESSION['nrnewmessages'] = $nrnewmessages; |
|
23 | - |
|
24 | - $msg = array(); |
|
25 | - $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']); |
|
26 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : ''; |
|
27 | - $msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold"> <a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages); |
|
28 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0'; |
|
29 | - $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
|
30 | - $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages); |
|
31 | - $ph['MessageInfo'] = implode("\n", $msg); |
|
20 | + include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
21 | + $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
|
22 | + $_SESSION['nrnewmessages'] = $nrnewmessages; |
|
23 | + |
|
24 | + $msg = array(); |
|
25 | + $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']); |
|
26 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : ''; |
|
27 | + $msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold"> <a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages); |
|
28 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0'; |
|
29 | + $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
|
30 | + $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages); |
|
31 | + $ph['MessageInfo'] = implode("\n", $msg); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | $iconTpl = $modx->getChunk('manager#welcome\WrapIcon'); |
35 | 35 | // setup icons |
36 | 36 | if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
37 | - $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
|
38 | - $ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75); |
|
37 | + $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
|
38 | + $ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75); |
|
39 | 39 | } |
40 | 40 | if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
41 | - $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
|
42 | - $ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99); |
|
41 | + $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
|
42 | + $ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99); |
|
43 | 43 | } |
44 | 44 | if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
45 | - $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
|
46 | - $ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106); |
|
45 | + $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
|
46 | + $ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106); |
|
47 | 47 | } |
48 | 48 | if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { |
49 | - $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
|
50 | - $ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76); |
|
49 | + $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
|
50 | + $ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76); |
|
51 | 51 | } |
52 | 52 | if($modx->hasPermission('bk_manager')) { |
53 | - $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
|
54 | - $ph['BackupIcon'] = sprintf($iconTpl,$icon, 93); |
|
53 | + $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
|
54 | + $ph['BackupIcon'] = sprintf($iconTpl,$icon, 93); |
|
55 | 55 | } |
56 | 56 | if($modx->hasPermission('help')) { |
57 | - $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
|
58 | - $ph['HelpIcon'] = sprintf($iconTpl,$icon, 9); |
|
57 | + $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
|
58 | + $ph['HelpIcon'] = sprintf($iconTpl,$icon, 9); |
|
59 | 59 | } |
60 | 60 | |
61 | 61 | if($modx->hasPermission('new_document')) { |
62 | - $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
|
63 | - $ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4); |
|
64 | - $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
|
65 | - $ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72); |
|
62 | + $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
|
63 | + $ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4); |
|
64 | + $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
|
65 | + $ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72); |
|
66 | 66 | } |
67 | 67 | if($modx->hasPermission('assets_images')) { |
68 | - $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
|
69 | - $ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72); |
|
68 | + $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
|
69 | + $ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72); |
|
70 | 70 | } |
71 | 71 | if($modx->hasPermission('assets_files')) { |
72 | - $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
|
73 | - $ph['FilesIcon'] = sprintf($iconTpl,$icon, 72); |
|
72 | + $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
|
73 | + $ph['FilesIcon'] = sprintf($iconTpl,$icon, 72); |
|
74 | 74 | } |
75 | 75 | if($modx->hasPermission('change_password')) { |
76 | - $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
|
77 | - $ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28); |
|
76 | + $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
|
77 | + $ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28); |
|
78 | 78 | } |
79 | 79 | $icon = '<i class="[&icons_logout_large&]"></i>[%logout%]'; |
80 | 80 | $ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8); |
81 | 81 | |
82 | 82 | // do some config checks |
83 | 83 | if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
84 | - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
85 | - if($config_check_results != $_lang['configcheck_ok']) { |
|
86 | - $ph['config_check_results'] = $config_check_results; |
|
87 | - $ph['config_display'] = 'block'; |
|
88 | - } else { |
|
89 | - $ph['config_display'] = 'none'; |
|
90 | - } |
|
84 | + include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
85 | + if($config_check_results != $_lang['configcheck_ok']) { |
|
86 | + $ph['config_check_results'] = $config_check_results; |
|
87 | + $ph['config_display'] = 'block'; |
|
88 | + } else { |
|
89 | + $ph['config_display'] = 'none'; |
|
90 | + } |
|
91 | 91 | } else { |
92 | - $ph['config_display'] = 'none'; |
|
92 | + $ph['config_display'] = 'none'; |
|
93 | 93 | } |
94 | 94 | |
95 | 95 | // Check logout-reminder |
96 | 96 | if(isset($_SESSION['show_logout_reminder'])) { |
97 | - switch($_SESSION['show_logout_reminder']['type']) { |
|
98 | - case 'logout_reminder': |
|
99 | - $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
|
100 | - $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); |
|
101 | - break; |
|
102 | - } |
|
103 | - $ph['show_logout_reminder'] = 'block'; |
|
104 | - unset($_SESSION['show_logout_reminder']); |
|
97 | + switch($_SESSION['show_logout_reminder']['type']) { |
|
98 | + case 'logout_reminder': |
|
99 | + $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
|
100 | + $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); |
|
101 | + break; |
|
102 | + } |
|
103 | + $ph['show_logout_reminder'] = 'block'; |
|
104 | + unset($_SESSION['show_logout_reminder']); |
|
105 | 105 | } else { |
106 | - $ph['show_logout_reminder'] = 'none'; |
|
106 | + $ph['show_logout_reminder'] = 'none'; |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | // Check multiple sessions |
@@ -151,11 +151,11 @@ discard block |
||
151 | 151 | $nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>'; |
152 | 152 | |
153 | 153 | $ph['UserInfo'] = $modx->parseText($tpl, array( |
154 | - 'username' => $modx->getLoginUserName(), |
|
155 | - 'role' => $_SESSION['mgrPermissions']['name'], |
|
156 | - 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), |
|
157 | - 'logincount' => $_SESSION['mgrLogincount'] + 1, |
|
158 | - 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) |
|
154 | + 'username' => $modx->getLoginUserName(), |
|
155 | + 'role' => $_SESSION['mgrPermissions']['name'], |
|
156 | + 'lastlogin' => $modx->toDateFormat($_SESSION['mgrLastlogin'] + $server_offset_time), |
|
157 | + 'logincount' => $_SESSION['mgrLogincount'] + 1, |
|
158 | + 'msginfo' => sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages) |
|
159 | 159 | )); |
160 | 160 | |
161 | 161 | $from = array(); |
@@ -164,13 +164,13 @@ discard block |
||
164 | 164 | $rs = $modx->getDatabase()->select('*', $from, '', 'username ASC, au.sid ASC'); |
165 | 165 | |
166 | 166 | if($modx->getDatabase()->getRecordCount($rs) < 1) { |
167 | - $html = '<p>[%no_active_users_found%]</p>'; |
|
167 | + $html = '<p>[%no_active_users_found%]</p>'; |
|
168 | 168 | } else { |
169 | - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
170 | - $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
|
171 | - $ph['now'] = strftime('%H:%M:%S', $now); |
|
172 | - $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
|
173 | - $html = ' |
|
169 | + include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
170 | + $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
|
171 | + $ph['now'] = strftime('%H:%M:%S', $now); |
|
172 | + $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
|
173 | + $html = ' |
|
174 | 174 | <div class="card-body"> |
175 | 175 | [%onlineusers_message%] |
176 | 176 | <b>[+now+]</b>): |
@@ -188,33 +188,33 @@ discard block |
||
188 | 188 | </thead> |
189 | 189 | <tbody>'; |
190 | 190 | |
191 | - $userList = array(); |
|
192 | - $userCount = array(); |
|
193 | - // Create userlist with session-count first before output |
|
194 | - while($activeusers = $modx->getDatabase()->getRow($rs)) { |
|
195 | - $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
|
196 | - |
|
197 | - $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
|
198 | - $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" /> ' : ''; |
|
199 | - $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; |
|
200 | - $currentaction = getAction($activeusers['action'], $activeusers['id']); |
|
201 | - $userList[] = array( |
|
202 | - $idle, |
|
203 | - '', |
|
204 | - $activeusers['username'], |
|
205 | - $webicon, |
|
206 | - abs($activeusers['internalKey']), |
|
207 | - $ip, |
|
208 | - strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), |
|
209 | - $currentaction |
|
210 | - ); |
|
211 | - } |
|
212 | - foreach($userList as $params) { |
|
213 | - $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
|
214 | - $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params); |
|
215 | - } |
|
216 | - |
|
217 | - $html .= ' |
|
191 | + $userList = array(); |
|
192 | + $userCount = array(); |
|
193 | + // Create userlist with session-count first before output |
|
194 | + while($activeusers = $modx->getDatabase()->getRow($rs)) { |
|
195 | + $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
|
196 | + |
|
197 | + $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
|
198 | + $webicon = $activeusers['internalKey'] < 0 ? '<img src="[&tree_globe&]" alt="Web user" /> ' : ''; |
|
199 | + $ip = $activeusers['ip'] === '::1' ? '127.0.0.1' : $activeusers['ip']; |
|
200 | + $currentaction = getAction($activeusers['action'], $activeusers['id']); |
|
201 | + $userList[] = array( |
|
202 | + $idle, |
|
203 | + '', |
|
204 | + $activeusers['username'], |
|
205 | + $webicon, |
|
206 | + abs($activeusers['internalKey']), |
|
207 | + $ip, |
|
208 | + strftime('%H:%M:%S', $activeusers['lasthit'] + $server_offset_time), |
|
209 | + $currentaction |
|
210 | + ); |
|
211 | + } |
|
212 | + foreach($userList as $params) { |
|
213 | + $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
|
214 | + $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params); |
|
215 | + } |
|
216 | + |
|
217 | + $html .= ' |
|
218 | 218 | </tbody> |
219 | 219 | </table> |
220 | 220 | </div> |
@@ -255,17 +255,17 @@ discard block |
||
255 | 255 | // invoke event OnManagerWelcomePrerender |
256 | 256 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); |
257 | 257 | if(is_array($evtOut)) { |
258 | - $output = implode('', $evtOut); |
|
259 | - $ph['OnManagerWelcomePrerender'] = $output; |
|
258 | + $output = implode('', $evtOut); |
|
259 | + $ph['OnManagerWelcomePrerender'] = $output; |
|
260 | 260 | } |
261 | 261 | |
262 | 262 | $widgets['welcome'] = array( |
263 | - 'menuindex' => '10', |
|
264 | - 'id' => 'welcome', |
|
265 | - 'cols' => 'col-lg-6', |
|
266 | - 'icon' => 'fa-home', |
|
267 | - 'title' => '[%welcome_title%]', |
|
268 | - 'body' => ' |
|
263 | + 'menuindex' => '10', |
|
264 | + 'id' => 'welcome', |
|
265 | + 'cols' => 'col-lg-6', |
|
266 | + 'icon' => 'fa-home', |
|
267 | + 'title' => '[%welcome_title%]', |
|
268 | + 'body' => ' |
|
269 | 269 | <div class="wm_buttons card-body"> |
270 | 270 | <!--@IF:[[#hasPermission?key=new_document]]--> |
271 | 271 | <span class="wm_button"> |
@@ -339,25 +339,25 @@ discard block |
||
339 | 339 | </table> |
340 | 340 | </div> |
341 | 341 | ', |
342 | - 'hide'=>'0' |
|
342 | + 'hide'=>'0' |
|
343 | 343 | ); |
344 | 344 | $widgets['onlineinfo'] = array( |
345 | - 'menuindex' => '20', |
|
346 | - 'id' => 'onlineinfo', |
|
347 | - 'cols' => 'col-lg-6', |
|
348 | - 'icon' => 'fa-user', |
|
349 | - 'title' => '[%onlineusers_title%]', |
|
350 | - 'body' => '<div class="userstable">[+OnlineInfo+]</div>', |
|
351 | - 'hide'=>'0' |
|
345 | + 'menuindex' => '20', |
|
346 | + 'id' => 'onlineinfo', |
|
347 | + 'cols' => 'col-lg-6', |
|
348 | + 'icon' => 'fa-user', |
|
349 | + 'title' => '[%onlineusers_title%]', |
|
350 | + 'body' => '<div class="userstable">[+OnlineInfo+]</div>', |
|
351 | + 'hide'=>'0' |
|
352 | 352 | ); |
353 | 353 | $widgets['recentinfo'] = array( |
354 | - 'menuindex' => '30', |
|
355 | - 'id' => 'modxrecent_widget', |
|
356 | - 'cols' => 'col-sm-12', |
|
357 | - 'icon' => 'fa-pencil-square-o', |
|
358 | - 'title' => '[%activity_title%]', |
|
359 | - 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
|
360 | - 'hide'=>'0' |
|
354 | + 'menuindex' => '30', |
|
355 | + 'id' => 'modxrecent_widget', |
|
356 | + 'cols' => 'col-sm-12', |
|
357 | + 'icon' => 'fa-pencil-square-o', |
|
358 | + 'title' => '[%activity_title%]', |
|
359 | + 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
|
360 | + 'hide'=>'0' |
|
361 | 361 | ); |
362 | 362 | if ($modx->config['rss_url_news']) { |
363 | 363 | $widgets['news'] = array( |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | // invoke OnManagerWelcomeHome event |
386 | 386 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); |
387 | 387 | if(is_array($sitewidgets)) { |
388 | - $newwidgets = array(); |
|
388 | + $newwidgets = array(); |
|
389 | 389 | foreach($sitewidgets as $widget){ |
390 | 390 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
391 | 391 | } |
@@ -393,21 +393,21 @@ discard block |
||
393 | 393 | } |
394 | 394 | |
395 | 395 | usort($widgets, function ($a, $b) { |
396 | - return $a['menuindex'] - $b['menuindex']; |
|
396 | + return $a['menuindex'] - $b['menuindex']; |
|
397 | 397 | }); |
398 | 398 | |
399 | 399 | $tpl = $modx->getChunk('manager#welcome\Widget'); |
400 | 400 | $output = ''; |
401 | 401 | foreach($widgets as $widget) { |
402 | - if ($widget['hide'] != '1'){ |
|
403 | - $output .= $modx->parseText($tpl, $widget); |
|
404 | - } |
|
402 | + if ($widget['hide'] != '1'){ |
|
403 | + $output .= $modx->parseText($tpl, $widget); |
|
404 | + } |
|
405 | 405 | } |
406 | 406 | $ph['widgets'] = $output; |
407 | 407 | |
408 | 408 | // load template |
409 | 409 | if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
410 | - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
|
410 | + $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | $target = $modx->config['manager_welcome_tpl']; |
@@ -415,27 +415,27 @@ discard block |
||
415 | 415 | $target = $modx->mergeSettingsContent($target); |
416 | 416 | |
417 | 417 | if(substr($target, 0, 1) === '@') { |
418 | - if(substr($target, 0, 6) === '@CHUNK') { |
|
419 | - $content = $modx->getChunk(trim(substr($target, 7))); |
|
420 | - } elseif(substr($target, 0, 5) === '@FILE') { |
|
421 | - $content = file_get_contents(trim(substr($target, 6))); |
|
422 | - } else { |
|
423 | - $content = ''; |
|
424 | - } |
|
418 | + if(substr($target, 0, 6) === '@CHUNK') { |
|
419 | + $content = $modx->getChunk(trim(substr($target, 7))); |
|
420 | + } elseif(substr($target, 0, 5) === '@FILE') { |
|
421 | + $content = file_get_contents(trim(substr($target, 6))); |
|
422 | + } else { |
|
423 | + $content = ''; |
|
424 | + } |
|
425 | 425 | } else { |
426 | - $chunk = $modx->getChunk($target); |
|
427 | - if($chunk !== false && !empty($chunk)) { |
|
428 | - $content = $chunk; |
|
429 | - } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
430 | - $content = file_get_contents(MODX_BASE_PATH . $target); |
|
431 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
432 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
|
433 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
434 | - { |
|
435 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
436 | - } else { |
|
437 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
438 | - } |
|
426 | + $chunk = $modx->getChunk($target); |
|
427 | + if($chunk !== false && !empty($chunk)) { |
|
428 | + $content = $chunk; |
|
429 | + } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
430 | + $content = file_get_contents(MODX_BASE_PATH . $target); |
|
431 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
432 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
|
433 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
434 | + { |
|
435 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
436 | + } else { |
|
437 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
438 | + } |
|
439 | 439 | } |
440 | 440 | |
441 | 441 | // merge placeholders |
@@ -443,8 +443,8 @@ discard block |
||
443 | 443 | $content = $modx->mergeSettingsContent($content); |
444 | 444 | $content = $modx->parseText($content, $ph); |
445 | 445 | if(strpos($content, '[+') !== false) { |
446 | - $modx->toPlaceholders($ph); |
|
447 | - $content = $modx->mergePlaceholderContent($content); |
|
446 | + $modx->toPlaceholders($ph); |
|
447 | + $content = $modx->mergePlaceholderContent($content); |
|
448 | 448 | } |
449 | 449 | $content = $modx->parseDocumentSource($content); |
450 | 450 | $content = $modx->parseText($content, $_lang, '[%', '%]'); |
@@ -452,7 +452,7 @@ discard block |
||
452 | 452 | $content = $modx->cleanUpMODXTags($content); //cleanup |
453 | 453 | |
454 | 454 | if($js = $modx->getRegisteredClientScripts()) { |
455 | - $content .= $js; |
|
455 | + $content .= $js; |
|
456 | 456 | } |
457 | 457 | |
458 | 458 | echo $content; |
@@ -1,11 +1,11 @@ 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 | 6 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
7 | 7 | |
8 | -if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { |
|
8 | +if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { |
|
9 | 9 | // seems to be a new install - send the user to the configuration page |
10 | 10 | exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>'); |
11 | 11 | } |
@@ -16,16 +16,16 @@ discard block |
||
16 | 16 | $_SESSION['nrnewmessages'] = 0; |
17 | 17 | |
18 | 18 | // setup message info |
19 | -if($modx->hasPermission('messages')) { |
|
20 | - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
19 | +if ($modx->hasPermission('messages')) { |
|
20 | + include_once(MODX_MANAGER_PATH.'includes/messageCount.inc.php'); |
|
21 | 21 | $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
22 | 22 | $_SESSION['nrnewmessages'] = $nrnewmessages; |
23 | 23 | |
24 | 24 | $msg = array(); |
25 | 25 | $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']); |
26 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : ''; |
|
26 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">'.$_SESSION['nrnewmessages'].'</span>)' : ''; |
|
27 | 27 | $msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold"> <a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages); |
28 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0'; |
|
28 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">'.$_SESSION['nrnewmessages'].'</span>' : '0'; |
|
29 | 29 | $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
30 | 30 | $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages); |
31 | 31 | $ph['MessageInfo'] = implode("\n", $msg); |
@@ -33,56 +33,56 @@ discard block |
||
33 | 33 | |
34 | 34 | $iconTpl = $modx->getChunk('manager#welcome\WrapIcon'); |
35 | 35 | // setup icons |
36 | -if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
|
36 | +if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
|
37 | 37 | $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
38 | - $ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75); |
|
38 | + $ph['SecurityIcon'] = sprintf($iconTpl, $icon, 75); |
|
39 | 39 | } |
40 | -if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
|
40 | +if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
|
41 | 41 | $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
42 | - $ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99); |
|
42 | + $ph['WebUserIcon'] = sprintf($iconTpl, $icon, 99); |
|
43 | 43 | } |
44 | -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
|
44 | +if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
|
45 | 45 | $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
46 | - $ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106); |
|
46 | + $ph['ModulesIcon'] = sprintf($iconTpl, $icon, 106); |
|
47 | 47 | } |
48 | -if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { |
|
48 | +if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { |
|
49 | 49 | $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
50 | - $ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76); |
|
50 | + $ph['ResourcesIcon'] = sprintf($iconTpl, $icon, 76); |
|
51 | 51 | } |
52 | -if($modx->hasPermission('bk_manager')) { |
|
52 | +if ($modx->hasPermission('bk_manager')) { |
|
53 | 53 | $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
54 | - $ph['BackupIcon'] = sprintf($iconTpl,$icon, 93); |
|
54 | + $ph['BackupIcon'] = sprintf($iconTpl, $icon, 93); |
|
55 | 55 | } |
56 | -if($modx->hasPermission('help')) { |
|
56 | +if ($modx->hasPermission('help')) { |
|
57 | 57 | $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
58 | - $ph['HelpIcon'] = sprintf($iconTpl,$icon, 9); |
|
58 | + $ph['HelpIcon'] = sprintf($iconTpl, $icon, 9); |
|
59 | 59 | } |
60 | 60 | |
61 | -if($modx->hasPermission('new_document')) { |
|
61 | +if ($modx->hasPermission('new_document')) { |
|
62 | 62 | $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
63 | - $ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4); |
|
63 | + $ph['ResourceIcon'] = sprintf($iconTpl, $icon, 4); |
|
64 | 64 | $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
65 | - $ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72); |
|
65 | + $ph['WeblinkIcon'] = sprintf($iconTpl, $icon, 72); |
|
66 | 66 | } |
67 | -if($modx->hasPermission('assets_images')) { |
|
67 | +if ($modx->hasPermission('assets_images')) { |
|
68 | 68 | $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
69 | - $ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72); |
|
69 | + $ph['ImagesIcon'] = sprintf($iconTpl, $icon, 72); |
|
70 | 70 | } |
71 | -if($modx->hasPermission('assets_files')) { |
|
71 | +if ($modx->hasPermission('assets_files')) { |
|
72 | 72 | $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
73 | - $ph['FilesIcon'] = sprintf($iconTpl,$icon, 72); |
|
73 | + $ph['FilesIcon'] = sprintf($iconTpl, $icon, 72); |
|
74 | 74 | } |
75 | -if($modx->hasPermission('change_password')) { |
|
75 | +if ($modx->hasPermission('change_password')) { |
|
76 | 76 | $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
77 | - $ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28); |
|
77 | + $ph['PasswordIcon'] = sprintf($iconTpl, $icon, 28); |
|
78 | 78 | } |
79 | 79 | $icon = '<i class="[&icons_logout_large&]"></i>[%logout%]'; |
80 | -$ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8); |
|
80 | +$ph['LogoutIcon'] = sprintf($iconTpl, $icon, 8); |
|
81 | 81 | |
82 | 82 | // do some config checks |
83 | -if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
|
84 | - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
85 | - if($config_check_results != $_lang['configcheck_ok']) { |
|
83 | +if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
|
84 | + include_once(MODX_MANAGER_PATH.'includes/config_check.inc.php'); |
|
85 | + if ($config_check_results != $_lang['configcheck_ok']) { |
|
86 | 86 | $ph['config_check_results'] = $config_check_results; |
87 | 87 | $ph['config_display'] = 'block'; |
88 | 88 | } else { |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | // Check logout-reminder |
96 | -if(isset($_SESSION['show_logout_reminder'])) { |
|
97 | - switch($_SESSION['show_logout_reminder']['type']) { |
|
96 | +if (isset($_SESSION['show_logout_reminder'])) { |
|
97 | + switch ($_SESSION['show_logout_reminder']['type']) { |
|
98 | 98 | case 'logout_reminder': |
99 | 99 | $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
100 | 100 | $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | </tr> |
149 | 149 | </table>'; |
150 | 150 | |
151 | -$nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>'; |
|
151 | +$nrnewmessages = '<span class="text-danger">'.$_SESSION['nrnewmessages'].'</span>'; |
|
152 | 152 | |
153 | 153 | $ph['UserInfo'] = $modx->parseText($tpl, array( |
154 | 154 | 'username' => $modx->getLoginUserName(), |
@@ -160,13 +160,13 @@ discard block |
||
160 | 160 | |
161 | 161 | $from = array(); |
162 | 162 | $from[] = $modx->getDatabase()->getFullTableName('active_user_sessions'); |
163 | -$from[] = " us LEFT JOIN " . $modx->getDatabase()->getFullTableName('active_users') . " au ON au.sid=us.sid WHERE au.action <> '8'"; |
|
163 | +$from[] = " us LEFT JOIN ".$modx->getDatabase()->getFullTableName('active_users')." au ON au.sid=us.sid WHERE au.action <> '8'"; |
|
164 | 164 | $rs = $modx->getDatabase()->select('*', $from, '', 'username ASC, au.sid ASC'); |
165 | 165 | |
166 | -if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
166 | +if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
167 | 167 | $html = '<p>[%no_active_users_found%]</p>'; |
168 | 168 | } else { |
169 | - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
169 | + include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php'); |
|
170 | 170 | $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
171 | 171 | $ph['now'] = strftime('%H:%M:%S', $now); |
172 | 172 | $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $userList = array(); |
192 | 192 | $userCount = array(); |
193 | 193 | // Create userlist with session-count first before output |
194 | - while($activeusers = $modx->getDatabase()->getRow($rs)) { |
|
194 | + while ($activeusers = $modx->getDatabase()->getRow($rs)) { |
|
195 | 195 | $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
196 | 196 | |
197 | 197 | $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
@@ -209,9 +209,9 @@ discard block |
||
209 | 209 | $currentaction |
210 | 210 | ); |
211 | 211 | } |
212 | - foreach($userList as $params) { |
|
212 | + foreach ($userList as $params) { |
|
213 | 213 | $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
214 | - $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params); |
|
214 | + $html .= "\n\t\t".vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | $html .= ' |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $ph['OnlineInfo'] = $html; |
224 | 224 | |
225 | 225 | // include rss feeds for important forum topics |
226 | -include_once(MODX_MANAGER_PATH . 'includes/rss.inc.php'); |
|
226 | +include_once(MODX_MANAGER_PATH.'includes/rss.inc.php'); |
|
227 | 227 | $ph['modx_security_notices_content'] = $feedData['modx_security_notices_content']; |
228 | 228 | $ph['modx_news_content'] = $feedData['modx_news_content']; |
229 | 229 | |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | |
255 | 255 | // invoke event OnManagerWelcomePrerender |
256 | 256 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); |
257 | -if(is_array($evtOut)) { |
|
257 | +if (is_array($evtOut)) { |
|
258 | 258 | $output = implode('', $evtOut); |
259 | 259 | $ph['OnManagerWelcomePrerender'] = $output; |
260 | 260 | } |
@@ -384,57 +384,57 @@ discard block |
||
384 | 384 | |
385 | 385 | // invoke OnManagerWelcomeHome event |
386 | 386 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); |
387 | -if(is_array($sitewidgets)) { |
|
387 | +if (is_array($sitewidgets)) { |
|
388 | 388 | $newwidgets = array(); |
389 | - foreach($sitewidgets as $widget){ |
|
389 | + foreach ($sitewidgets as $widget) { |
|
390 | 390 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
391 | 391 | } |
392 | 392 | $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; |
393 | 393 | } |
394 | 394 | |
395 | -usort($widgets, function ($a, $b) { |
|
395 | +usort($widgets, function($a, $b){ |
|
396 | 396 | return $a['menuindex'] - $b['menuindex']; |
397 | 397 | }); |
398 | 398 | |
399 | 399 | $tpl = $modx->getChunk('manager#welcome\Widget'); |
400 | 400 | $output = ''; |
401 | -foreach($widgets as $widget) { |
|
402 | - if ($widget['hide'] != '1'){ |
|
401 | +foreach ($widgets as $widget) { |
|
402 | + if ($widget['hide'] != '1') { |
|
403 | 403 | $output .= $modx->parseText($tpl, $widget); |
404 | 404 | } |
405 | 405 | } |
406 | 406 | $ph['widgets'] = $output; |
407 | 407 | |
408 | 408 | // load template |
409 | -if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
|
410 | - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
|
409 | +if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
|
410 | + $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH.'media/style/common/welcome.tpl'; |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | $target = $modx->config['manager_welcome_tpl']; |
414 | 414 | $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); |
415 | 415 | $target = $modx->mergeSettingsContent($target); |
416 | 416 | |
417 | -if(substr($target, 0, 1) === '@') { |
|
418 | - if(substr($target, 0, 6) === '@CHUNK') { |
|
417 | +if (substr($target, 0, 1) === '@') { |
|
418 | + if (substr($target, 0, 6) === '@CHUNK') { |
|
419 | 419 | $content = $modx->getChunk(trim(substr($target, 7))); |
420 | - } elseif(substr($target, 0, 5) === '@FILE') { |
|
420 | + } elseif (substr($target, 0, 5) === '@FILE') { |
|
421 | 421 | $content = file_get_contents(trim(substr($target, 6))); |
422 | 422 | } else { |
423 | 423 | $content = ''; |
424 | 424 | } |
425 | 425 | } else { |
426 | 426 | $chunk = $modx->getChunk($target); |
427 | - if($chunk !== false && !empty($chunk)) { |
|
427 | + if ($chunk !== false && !empty($chunk)) { |
|
428 | 428 | $content = $chunk; |
429 | - } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
430 | - $content = file_get_contents(MODX_BASE_PATH . $target); |
|
431 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
432 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
|
433 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
429 | + } elseif (is_file(MODX_BASE_PATH.$target)) { |
|
430 | + $content = file_get_contents(MODX_BASE_PATH.$target); |
|
431 | + } elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl')) { |
|
432 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl'); |
|
433 | + } elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html')) // ClipperCMS compatible |
|
434 | 434 | { |
435 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
435 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html'); |
|
436 | 436 | } else { |
437 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
437 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/common/welcome.tpl'); |
|
438 | 438 | } |
439 | 439 | } |
440 | 440 | |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | $content = $modx->mergeConditionalTagsContent($content); |
443 | 443 | $content = $modx->mergeSettingsContent($content); |
444 | 444 | $content = $modx->parseText($content, $ph); |
445 | -if(strpos($content, '[+') !== false) { |
|
445 | +if (strpos($content, '[+') !== false) { |
|
446 | 446 | $modx->toPlaceholders($ph); |
447 | 447 | $content = $modx->mergePlaceholderContent($content); |
448 | 448 | } |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | $content = $modx->parseText($content, $_style, '[&', '&]'); |
452 | 452 | $content = $modx->cleanUpMODXTags($content); //cleanup |
453 | 453 | |
454 | -if($js = $modx->getRegisteredClientScripts()) { |
|
454 | +if ($js = $modx->getRegisteredClientScripts()) { |
|
455 | 455 | $content .= $js; |
456 | 456 | } |
457 | 457 |
@@ -1,11 +1,11 @@ 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 | 6 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
7 | 7 | |
8 | -if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { |
|
8 | +if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { |
|
9 | 9 | // seems to be a new install - send the user to the configuration page |
10 | 10 | exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>'); |
11 | 11 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $_SESSION['nrnewmessages'] = 0; |
17 | 17 | |
18 | 18 | // setup message info |
19 | -if($modx->hasPermission('messages')) { |
|
19 | +if($modx->hasPermission('messages')) { |
|
20 | 20 | include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
21 | 21 | $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
22 | 22 | $_SESSION['nrnewmessages'] = $nrnewmessages; |
@@ -33,46 +33,46 @@ discard block |
||
33 | 33 | |
34 | 34 | $iconTpl = $modx->getChunk('manager#welcome\WrapIcon'); |
35 | 35 | // setup icons |
36 | -if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
|
36 | +if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
|
37 | 37 | $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
38 | 38 | $ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75); |
39 | 39 | } |
40 | -if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
|
40 | +if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
|
41 | 41 | $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
42 | 42 | $ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99); |
43 | 43 | } |
44 | -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
|
44 | +if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
|
45 | 45 | $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
46 | 46 | $ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106); |
47 | 47 | } |
48 | -if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { |
|
48 | +if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { |
|
49 | 49 | $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
50 | 50 | $ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76); |
51 | 51 | } |
52 | -if($modx->hasPermission('bk_manager')) { |
|
52 | +if($modx->hasPermission('bk_manager')) { |
|
53 | 53 | $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
54 | 54 | $ph['BackupIcon'] = sprintf($iconTpl,$icon, 93); |
55 | 55 | } |
56 | -if($modx->hasPermission('help')) { |
|
56 | +if($modx->hasPermission('help')) { |
|
57 | 57 | $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
58 | 58 | $ph['HelpIcon'] = sprintf($iconTpl,$icon, 9); |
59 | 59 | } |
60 | 60 | |
61 | -if($modx->hasPermission('new_document')) { |
|
61 | +if($modx->hasPermission('new_document')) { |
|
62 | 62 | $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
63 | 63 | $ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4); |
64 | 64 | $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
65 | 65 | $ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72); |
66 | 66 | } |
67 | -if($modx->hasPermission('assets_images')) { |
|
67 | +if($modx->hasPermission('assets_images')) { |
|
68 | 68 | $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
69 | 69 | $ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72); |
70 | 70 | } |
71 | -if($modx->hasPermission('assets_files')) { |
|
71 | +if($modx->hasPermission('assets_files')) { |
|
72 | 72 | $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
73 | 73 | $ph['FilesIcon'] = sprintf($iconTpl,$icon, 72); |
74 | 74 | } |
75 | -if($modx->hasPermission('change_password')) { |
|
75 | +if($modx->hasPermission('change_password')) { |
|
76 | 76 | $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
77 | 77 | $ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28); |
78 | 78 | } |
@@ -80,21 +80,21 @@ discard block |
||
80 | 80 | $ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8); |
81 | 81 | |
82 | 82 | // do some config checks |
83 | -if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
|
83 | +if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
|
84 | 84 | include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
85 | - if($config_check_results != $_lang['configcheck_ok']) { |
|
85 | + if($config_check_results != $_lang['configcheck_ok']) { |
|
86 | 86 | $ph['config_check_results'] = $config_check_results; |
87 | 87 | $ph['config_display'] = 'block'; |
88 | - } else { |
|
88 | + } else { |
|
89 | 89 | $ph['config_display'] = 'none'; |
90 | 90 | } |
91 | -} else { |
|
91 | +} else { |
|
92 | 92 | $ph['config_display'] = 'none'; |
93 | 93 | } |
94 | 94 | |
95 | 95 | // Check logout-reminder |
96 | -if(isset($_SESSION['show_logout_reminder'])) { |
|
97 | - switch($_SESSION['show_logout_reminder']['type']) { |
|
96 | +if(isset($_SESSION['show_logout_reminder'])) { |
|
97 | + switch($_SESSION['show_logout_reminder']['type']) { |
|
98 | 98 | case 'logout_reminder': |
99 | 99 | $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
100 | 100 | $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | } |
103 | 103 | $ph['show_logout_reminder'] = 'block'; |
104 | 104 | unset($_SESSION['show_logout_reminder']); |
105 | -} else { |
|
105 | +} else { |
|
106 | 106 | $ph['show_logout_reminder'] = 'none'; |
107 | 107 | } |
108 | 108 | |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | $from[] = " us LEFT JOIN " . $modx->getDatabase()->getFullTableName('active_users') . " au ON au.sid=us.sid WHERE au.action <> '8'"; |
164 | 164 | $rs = $modx->getDatabase()->select('*', $from, '', 'username ASC, au.sid ASC'); |
165 | 165 | |
166 | -if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
166 | +if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
167 | 167 | $html = '<p>[%no_active_users_found%]</p>'; |
168 | -} else { |
|
168 | +} else { |
|
169 | 169 | include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
170 | 170 | $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
171 | 171 | $ph['now'] = strftime('%H:%M:%S', $now); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $userList = array(); |
192 | 192 | $userCount = array(); |
193 | 193 | // Create userlist with session-count first before output |
194 | - while($activeusers = $modx->getDatabase()->getRow($rs)) { |
|
194 | + while($activeusers = $modx->getDatabase()->getRow($rs)) { |
|
195 | 195 | $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
196 | 196 | |
197 | 197 | $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $currentaction |
210 | 210 | ); |
211 | 211 | } |
212 | - foreach($userList as $params) { |
|
212 | + foreach($userList as $params) { |
|
213 | 213 | $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
214 | 214 | $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params); |
215 | 215 | } |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | |
255 | 255 | // invoke event OnManagerWelcomePrerender |
256 | 256 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); |
257 | -if(is_array($evtOut)) { |
|
257 | +if(is_array($evtOut)) { |
|
258 | 258 | $output = implode('', $evtOut); |
259 | 259 | $ph['OnManagerWelcomePrerender'] = $output; |
260 | 260 | } |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
360 | 360 | 'hide'=>'0' |
361 | 361 | ); |
362 | -if ($modx->config['rss_url_news']) { |
|
362 | +if ($modx->config['rss_url_news']) { |
|
363 | 363 | $widgets['news'] = array( |
364 | 364 | 'menuindex' => '40', |
365 | 365 | 'id' => 'news', |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | 'hide'=>'0' |
371 | 371 | ); |
372 | 372 | } |
373 | -if ($modx->config['rss_url_security']) { |
|
373 | +if ($modx->config['rss_url_security']) { |
|
374 | 374 | $widgets['security'] = array( |
375 | 375 | 'menuindex' => '50', |
376 | 376 | 'id' => 'security', |
@@ -384,29 +384,29 @@ discard block |
||
384 | 384 | |
385 | 385 | // invoke OnManagerWelcomeHome event |
386 | 386 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); |
387 | -if(is_array($sitewidgets)) { |
|
387 | +if(is_array($sitewidgets)) { |
|
388 | 388 | $newwidgets = array(); |
389 | - foreach($sitewidgets as $widget){ |
|
389 | + foreach($sitewidgets as $widget) { |
|
390 | 390 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
391 | 391 | } |
392 | 392 | $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; |
393 | 393 | } |
394 | 394 | |
395 | -usort($widgets, function ($a, $b) { |
|
395 | +usort($widgets, function ($a, $b){ |
|
396 | 396 | return $a['menuindex'] - $b['menuindex']; |
397 | 397 | }); |
398 | 398 | |
399 | 399 | $tpl = $modx->getChunk('manager#welcome\Widget'); |
400 | 400 | $output = ''; |
401 | -foreach($widgets as $widget) { |
|
402 | - if ($widget['hide'] != '1'){ |
|
401 | +foreach($widgets as $widget) { |
|
402 | + if ($widget['hide'] != '1') { |
|
403 | 403 | $output .= $modx->parseText($tpl, $widget); |
404 | 404 | } |
405 | 405 | } |
406 | 406 | $ph['widgets'] = $output; |
407 | 407 | |
408 | 408 | // load template |
409 | -if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
|
409 | +if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
|
410 | 410 | $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
411 | 411 | } |
412 | 412 | |
@@ -414,26 +414,28 @@ discard block |
||
414 | 414 | $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); |
415 | 415 | $target = $modx->mergeSettingsContent($target); |
416 | 416 | |
417 | -if(substr($target, 0, 1) === '@') { |
|
418 | - if(substr($target, 0, 6) === '@CHUNK') { |
|
417 | +if(substr($target, 0, 1) === '@') { |
|
418 | + if(substr($target, 0, 6) === '@CHUNK') { |
|
419 | 419 | $content = $modx->getChunk(trim(substr($target, 7))); |
420 | - } elseif(substr($target, 0, 5) === '@FILE') { |
|
420 | + } elseif(substr($target, 0, 5) === '@FILE') { |
|
421 | 421 | $content = file_get_contents(trim(substr($target, 6))); |
422 | - } else { |
|
422 | + } else { |
|
423 | 423 | $content = ''; |
424 | 424 | } |
425 | -} else { |
|
425 | +} else { |
|
426 | 426 | $chunk = $modx->getChunk($target); |
427 | - if($chunk !== false && !empty($chunk)) { |
|
427 | + if($chunk !== false && !empty($chunk)) { |
|
428 | 428 | $content = $chunk; |
429 | - } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
429 | + } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
430 | 430 | $content = file_get_contents(MODX_BASE_PATH . $target); |
431 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
431 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
432 | 432 | $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
433 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
433 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) { |
|
434 | + // ClipperCMS compatible |
|
434 | 435 | { |
435 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
436 | - } else { |
|
436 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
437 | + } |
|
438 | + } else { |
|
437 | 439 | $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
438 | 440 | } |
439 | 441 | } |
@@ -442,7 +444,7 @@ discard block |
||
442 | 444 | $content = $modx->mergeConditionalTagsContent($content); |
443 | 445 | $content = $modx->mergeSettingsContent($content); |
444 | 446 | $content = $modx->parseText($content, $ph); |
445 | -if(strpos($content, '[+') !== false) { |
|
447 | +if(strpos($content, '[+') !== false) { |
|
446 | 448 | $modx->toPlaceholders($ph); |
447 | 449 | $content = $modx->mergePlaceholderContent($content); |
448 | 450 | } |
@@ -451,7 +453,7 @@ discard block |
||
451 | 453 | $content = $modx->parseText($content, $_style, '[&', '&]'); |
452 | 454 | $content = $modx->cleanUpMODXTags($content); //cleanup |
453 | 455 | |
454 | -if($js = $modx->getRegisteredClientScripts()) { |
|
456 | +if($js = $modx->getRegisteredClientScripts()) { |
|
455 | 457 | $content .= $js; |
456 | 458 | } |
457 | 459 |
@@ -118,18 +118,18 @@ |
||
118 | 118 | $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; |
119 | 119 | $articul_result = $modx->getDatabase()->query($articul_query); |
120 | 120 | $articul_id_array = $modx->getDatabase()->makeArray($articul_result); |
121 | - if(count($articul_id_array)>0){ |
|
121 | + if(count($articul_id_array)>0) { |
|
122 | 122 | $articul_id = ''; |
123 | 123 | $i = 1; |
124 | 124 | foreach( $articul_id_array as $articul ) { |
125 | 125 | $articul_id.=$articul['contentid']; |
126 | - if($i !== count($articul_id_array)){ |
|
126 | + if($i !== count($articul_id_array)) { |
|
127 | 127 | $articul_id.=','; |
128 | 128 | } |
129 | 129 | $i++; |
130 | 130 | } |
131 | 131 | $articul_id_query = " OR sc.id IN ({$articul_id})"; |
132 | - }else{ |
|
132 | + } else { |
|
133 | 133 | $articul_id_query = ''; |
134 | 134 | } |
135 | 135 | /*end search by TV*/ |
@@ -113,31 +113,31 @@ |
||
113 | 113 | // Handle Input "Search in main fields" |
114 | 114 | if ($searchfields != '') { |
115 | 115 | |
116 | - /*start search by TV. Added Rising13*/ |
|
117 | - $tbl_site_tmplvar_contentvalues = $modx->getDatabase()->getFullTableName('site_tmplvar_contentvalues'); |
|
118 | - $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; |
|
119 | - $articul_result = $modx->getDatabase()->query($articul_query); |
|
120 | - $articul_id_array = $modx->getDatabase()->makeArray($articul_result); |
|
121 | - if(count($articul_id_array)>0){ |
|
122 | - $articul_id = ''; |
|
123 | - $i = 1; |
|
124 | - foreach( $articul_id_array as $articul ) { |
|
125 | - $articul_id.=$articul['contentid']; |
|
126 | - if($i !== count($articul_id_array)){ |
|
127 | - $articul_id.=','; |
|
128 | - } |
|
129 | - $i++; |
|
130 | - } |
|
131 | - $articul_id_query = " OR sc.id IN ({$articul_id})"; |
|
132 | - }else{ |
|
133 | - $articul_id_query = ''; |
|
134 | - } |
|
135 | - /*end search by TV*/ |
|
116 | + /*start search by TV. Added Rising13*/ |
|
117 | + $tbl_site_tmplvar_contentvalues = $modx->getDatabase()->getFullTableName('site_tmplvar_contentvalues'); |
|
118 | + $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; |
|
119 | + $articul_result = $modx->getDatabase()->query($articul_query); |
|
120 | + $articul_id_array = $modx->getDatabase()->makeArray($articul_result); |
|
121 | + if(count($articul_id_array)>0){ |
|
122 | + $articul_id = ''; |
|
123 | + $i = 1; |
|
124 | + foreach( $articul_id_array as $articul ) { |
|
125 | + $articul_id.=$articul['contentid']; |
|
126 | + if($i !== count($articul_id_array)){ |
|
127 | + $articul_id.=','; |
|
128 | + } |
|
129 | + $i++; |
|
130 | + } |
|
131 | + $articul_id_query = " OR sc.id IN ({$articul_id})"; |
|
132 | + }else{ |
|
133 | + $articul_id_query = ''; |
|
134 | + } |
|
135 | + /*end search by TV*/ |
|
136 | 136 | |
137 | 137 | if (ctype_digit($searchfields)) { |
138 | 138 | $sqladd .= "sc.id='{$searchfields}'"; |
139 | 139 | if (strlen($searchfields) > 3) { |
140 | - $sqladd .= $articul_id_query;//search by TV |
|
140 | + $sqladd .= $articul_id_query;//search by TV |
|
141 | 141 | $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'"; |
142 | 142 | } |
143 | 143 | } |
@@ -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 | exit(); |
4 | 4 | } |
5 | 5 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | <?php |
42 | 42 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('site_templates')); |
43 | 43 | $option[] = '<option value="">No selected</option>'; |
44 | - $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int)$_REQUEST['templateid'] : ''; |
|
44 | + $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int) $_REQUEST['templateid'] : ''; |
|
45 | 45 | $selected = $templateid === 0 ? ' selected="selected"' : ''; |
46 | - $option[] = '<option value="0"' . $selected . '>(blank)</option>'; |
|
46 | + $option[] = '<option value="0"'.$selected.'>(blank)</option>'; |
|
47 | 47 | while ($row = $modx->getDatabase()->getRow($rs)) { |
48 | 48 | $templatename = htmlspecialchars($row['templatename'], ENT_QUOTES, $modx->config['modx_charset']); |
49 | 49 | $selected = $row['id'] == $templateid ? ' selected="selected"' : ''; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $searchfields = htmlentities(trim($_POST['searchfields']), ENT_QUOTES, $modx_manager_charset); |
87 | 87 | $searchlongtitle = $modx->getDatabase()->escape(trim($_REQUEST['searchfields'])); |
88 | 88 | $search_alias = $modx->getDatabase()->escape(trim($_REQUEST['searchfields'])); |
89 | - $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int)$_REQUEST['templateid'] : ''; |
|
89 | + $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int) $_REQUEST['templateid'] : ''; |
|
90 | 90 | $searchcontent = $modx->getDatabase()->escape($_REQUEST['content']); |
91 | 91 | |
92 | 92 | $fields = 'DISTINCT sc.id, contenttype, pagetitle, longtitle, description, introtext, menutitle, deleted, published, isfolder, type'; |
@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | $friendly_url_suffix = $modx->config['friendly_url_suffix']; |
101 | 101 | $base_url = $modx->config['base_url']; |
102 | 102 | $site_url = $modx->config['site_url']; |
103 | - $url = preg_replace('@' . $friendly_url_suffix . '$@', '', $url); |
|
103 | + $url = preg_replace('@'.$friendly_url_suffix.'$@', '', $url); |
|
104 | 104 | if ($url[0] === '/') { |
105 | - $url = preg_replace('@^' . $base_url . '@', '', $url); |
|
105 | + $url = preg_replace('@^'.$base_url.'@', '', $url); |
|
106 | 106 | } |
107 | 107 | if (substr($url, 0, 4) === 'http') { |
108 | - $url = preg_replace('@^' . $site_url . '@', '', $url); |
|
108 | + $url = preg_replace('@^'.$site_url.'@', '', $url); |
|
109 | 109 | } |
110 | 110 | $idFromAlias = $modx->getIdFromAlias($url); |
111 | 111 | } |
@@ -118,18 +118,18 @@ discard block |
||
118 | 118 | $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; |
119 | 119 | $articul_result = $modx->getDatabase()->query($articul_query); |
120 | 120 | $articul_id_array = $modx->getDatabase()->makeArray($articul_result); |
121 | - if(count($articul_id_array)>0){ |
|
121 | + if (count($articul_id_array) > 0) { |
|
122 | 122 | $articul_id = ''; |
123 | 123 | $i = 1; |
124 | - foreach( $articul_id_array as $articul ) { |
|
125 | - $articul_id.=$articul['contentid']; |
|
126 | - if($i !== count($articul_id_array)){ |
|
127 | - $articul_id.=','; |
|
124 | + foreach ($articul_id_array as $articul) { |
|
125 | + $articul_id .= $articul['contentid']; |
|
126 | + if ($i !== count($articul_id_array)) { |
|
127 | + $articul_id .= ','; |
|
128 | 128 | } |
129 | 129 | $i++; |
130 | 130 | } |
131 | 131 | $articul_id_query = " OR sc.id IN ({$articul_id})"; |
132 | - }else{ |
|
132 | + } else { |
|
133 | 133 | $articul_id_query = ''; |
134 | 134 | } |
135 | 135 | /*end search by TV*/ |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | if (ctype_digit($searchfields)) { |
138 | 138 | $sqladd .= "sc.id='{$searchfields}'"; |
139 | 139 | if (strlen($searchfields) > 3) { |
140 | - $sqladd .= $articul_id_query;//search by TV |
|
140 | + $sqladd .= $articul_id_query; //search by TV |
|
141 | 141 | $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'"; |
142 | 142 | } |
143 | 143 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $sqladd .= " OR sc.introtext LIKE '%{$searchlongtitle}%'"; |
158 | 158 | $sqladd .= " OR sc.menutitle LIKE '%{$searchlongtitle}%'"; |
159 | 159 | $sqladd .= " OR sc.alias LIKE '%{$search_alias}%'"; |
160 | - $sqladd .= $articul_id_query;//search by TV |
|
160 | + $sqladd .= $articul_id_query; //search by TV |
|
161 | 161 | $sqladd .= ")"; |
162 | 162 | } |
163 | 163 | } else if ($idFromAlias) { |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
182 | 182 | $mgrRole = (isset ($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0; |
183 | 183 | $docgrp_cond = $docgrp ? " OR dg.document_group IN ({$docgrp})" : ''; |
184 | - $fields .= ', MAX(IF(1=' . $mgrRole . ' OR sc.privatemgr=0' . $docgrp_cond . ',1,0)) AS hasAccess'; |
|
185 | - $sqladd = '(' . $sqladd . ") AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
184 | + $fields .= ', MAX(IF(1='.$mgrRole.' OR sc.privatemgr=0'.$docgrp_cond.',1,0)) AS hasAccess'; |
|
185 | + $sqladd = '('.$sqladd.") AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | if ($sqladd) { |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $where = $sqladd; |
193 | 193 | |
194 | 194 | if ($where) { |
195 | - $rs = $modx->getDatabase()->select($fields, $tbl_site_content . ' AS sc LEFT JOIN ' . $tbldg . ' AS dg ON dg.document=sc.id', $where, 'sc.id'); |
|
195 | + $rs = $modx->getDatabase()->select($fields, $tbl_site_content.' AS sc LEFT JOIN '.$tbldg.' AS dg ON dg.document=sc.id', $where, 'sc.id'); |
|
196 | 196 | $limit = $modx->getDatabase()->getRecordCount($rs); |
197 | 197 | } else { |
198 | 198 | $limit = 0; |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | if ($limit < 1) { |
212 | 212 | echo $_lang['search_empty']; |
213 | 213 | } else { |
214 | - printf('<p>' . $_lang['search_results_returned_msg'] . '</p>', $limit); |
|
214 | + printf('<p>'.$_lang['search_results_returned_msg'].'</p>', $limit); |
|
215 | 215 | ?> |
216 | 216 | <script type="text/javascript" src="media/script/tablesort.js"></script> |
217 | 217 | <table class="grid sortabletable sortable-onload-2 rowstyle-even" id="table-1"> |
@@ -271,14 +271,14 @@ discard block |
||
271 | 271 | if (function_exists('mb_strlen') && function_exists('mb_substr')) { |
272 | 272 | ?> |
273 | 273 | <td<?= $tdClass ?>> |
274 | - <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset) . "..." : $row['pagetitle'] ?></a> |
|
274 | + <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset)."..." : $row['pagetitle'] ?></a> |
|
275 | 275 | </td> |
276 | - <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset) . "..." : $row['description'] ?></td> |
|
276 | + <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset)."..." : $row['description'] ?></td> |
|
277 | 277 | <?php |
278 | 278 | } else { |
279 | 279 | ?> |
280 | - <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle'] ?></td> |
|
281 | - <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35) . '...' : $row['description'] ?></td> |
|
280 | + <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20).'...' : $row['pagetitle'] ?></td> |
|
281 | + <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35).'...' : $row['description'] ?></td> |
|
282 | 282 | <?php |
283 | 283 | } |
284 | 284 | ?> |
@@ -298,115 +298,115 @@ discard block |
||
298 | 298 | if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
299 | 299 | $docscounts = $modx->getDatabase()->getRecordCount($rs); |
300 | 300 | if ($docscounts > 0) { |
301 | - $output .= '<li><b><i class="fa fa-sitemap"></i> ' . $_lang["manage_documents"] . ' (' . $docscounts . ')</b></li>'; |
|
301 | + $output .= '<li><b><i class="fa fa-sitemap"></i> '.$_lang["manage_documents"].' ('.$docscounts.')</b></li>'; |
|
302 | 302 | while ($row = $modx->getDatabase()->getRow($rs)) { |
303 | - $output .= '<li' . addClassForItemList('', !$row['published'], $row['deleted']) . '><a href="index.php?a=27&id=' . $row['id'] . '" id="content_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['pagetitle'] . ' <small>(' . $row['id'] . ')</small>', $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
303 | + $output .= '<li'.addClassForItemList('', !$row['published'], $row['deleted']).'><a href="index.php?a=27&id='.$row['id'].'" id="content_'.$row['id'].'" target="main">'.highlightingCoincidence($row['pagetitle'].' <small>('.$row['id'].')</small>', $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
304 | 304 | } |
305 | 305 | } |
306 | 306 | } |
307 | 307 | |
308 | 308 | //templates |
309 | 309 | if ($modx->hasPermission('edit_template')) { |
310 | - $rs = $modx->getDatabase()->select("id,templatename,locked", $modx->getDatabase()->getFullTableName('site_templates'), "`id` like '%" . $searchfields . "%' |
|
311 | - OR `templatename` like '%" . $searchfields . "%' |
|
312 | - OR `description` like '%" . $searchfields . "%' |
|
313 | - OR `content` like '%" . $searchfields . "%'"); |
|
310 | + $rs = $modx->getDatabase()->select("id,templatename,locked", $modx->getDatabase()->getFullTableName('site_templates'), "`id` like '%".$searchfields."%' |
|
311 | + OR `templatename` like '%" . $searchfields."%' |
|
312 | + OR `description` like '%" . $searchfields."%' |
|
313 | + OR `content` like '%" . $searchfields."%'"); |
|
314 | 314 | $templatecounts = $modx->getDatabase()->getRecordCount($rs); |
315 | 315 | if ($templatecounts > 0) { |
316 | - $output .= '<li><b><i class="fa fa-newspaper-o"></i> ' . $_lang["manage_templates"] . ' (' . $templatecounts . ')</b></li>'; |
|
316 | + $output .= '<li><b><i class="fa fa-newspaper-o"></i> '.$_lang["manage_templates"].' ('.$templatecounts.')</b></li>'; |
|
317 | 317 | while ($row = $modx->getDatabase()->getRow($rs)) { |
318 | - $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=16&id=' . $row['id'] . '" id="templates_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
318 | + $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=16&id='.$row['id'].'" id="templates_'.$row['id'].'" target="main">'.highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
319 | 319 | } |
320 | 320 | } |
321 | 321 | } |
322 | 322 | |
323 | 323 | //tvs |
324 | 324 | if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
325 | - $rs = $modx->getDatabase()->select("id,name,locked", $modx->getDatabase()->getFullTableName('site_tmplvars'), "`id` like '%" . $searchfields . "%' |
|
326 | - OR `name` like '%" . $searchfields . "%' |
|
327 | - OR `description` like '%" . $searchfields . "%' |
|
328 | - OR `type` like '%" . $searchfields . "%' |
|
329 | - OR `elements` like '%" . $searchfields . "%' |
|
330 | - OR `display` like '%" . $searchfields . "%' |
|
331 | - OR `display_params` like '%" . $searchfields . "%' |
|
332 | - OR `default_text` like '%" . $searchfields . "%'"); |
|
325 | + $rs = $modx->getDatabase()->select("id,name,locked", $modx->getDatabase()->getFullTableName('site_tmplvars'), "`id` like '%".$searchfields."%' |
|
326 | + OR `name` like '%" . $searchfields."%' |
|
327 | + OR `description` like '%" . $searchfields."%' |
|
328 | + OR `type` like '%" . $searchfields."%' |
|
329 | + OR `elements` like '%" . $searchfields."%' |
|
330 | + OR `display` like '%" . $searchfields."%' |
|
331 | + OR `display_params` like '%" . $searchfields."%' |
|
332 | + OR `default_text` like '%" . $searchfields."%'"); |
|
333 | 333 | $tvscounts = $modx->getDatabase()->getRecordCount($rs); |
334 | 334 | if ($tvscounts > 0) { |
335 | - $output .= '<li><b><i class="fa fa-list-alt"></i> ' . $_lang["settings_templvars"] . ' (' . $tvscounts . ')</b></li>'; |
|
335 | + $output .= '<li><b><i class="fa fa-list-alt"></i> '.$_lang["settings_templvars"].' ('.$tvscounts.')</b></li>'; |
|
336 | 336 | while ($row = $modx->getDatabase()->getRow($rs)) { |
337 | - $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=301&id=' . $row['id'] . '" id="tmplvars_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
337 | + $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=301&id='.$row['id'].'" id="tmplvars_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
338 | 338 | } |
339 | 339 | } |
340 | 340 | } |
341 | 341 | |
342 | 342 | //Chunks |
343 | 343 | if ($modx->hasPermission('edit_chunk')) { |
344 | - $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_htmlsnippets'), "`id` like '%" . $searchfields . "%' |
|
345 | - OR `name` like '%" . $searchfields . "%' |
|
346 | - OR `description` like '%" . $searchfields . "%' |
|
347 | - OR `snippet` like '%" . $searchfields . "%'"); |
|
344 | + $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_htmlsnippets'), "`id` like '%".$searchfields."%' |
|
345 | + OR `name` like '%" . $searchfields."%' |
|
346 | + OR `description` like '%" . $searchfields."%' |
|
347 | + OR `snippet` like '%" . $searchfields."%'"); |
|
348 | 348 | $chunkscounts = $modx->getDatabase()->getRecordCount($rs); |
349 | 349 | if ($chunkscounts > 0) { |
350 | - $output .= '<li><b><i class="fa fa-th-large"></i> ' . $_lang["manage_htmlsnippets"] . ' (' . $chunkscounts . ')</b></li>'; |
|
350 | + $output .= '<li><b><i class="fa fa-th-large"></i> '.$_lang["manage_htmlsnippets"].' ('.$chunkscounts.')</b></li>'; |
|
351 | 351 | while ($row = $modx->getDatabase()->getRow($rs)) { |
352 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=78&id=' . $row['id'] . '" id="htmlsnippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
352 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=78&id='.$row['id'].'" id="htmlsnippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
353 | 353 | } |
354 | 354 | } |
355 | 355 | } |
356 | 356 | |
357 | 357 | //Snippets |
358 | 358 | if ($modx->hasPermission('edit_snippet')) { |
359 | - $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_snippets'), "`id` like '%" . $searchfields . "%' |
|
360 | - OR `name` like '%" . $searchfields . "%' |
|
361 | - OR `description` like '%" . $searchfields . "%' |
|
362 | - OR `snippet` like '%" . $searchfields . "%' |
|
363 | - OR `properties` like '%" . $searchfields . "%' |
|
364 | - OR `moduleguid` like '%" . $searchfields . "%'"); |
|
359 | + $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_snippets'), "`id` like '%".$searchfields."%' |
|
360 | + OR `name` like '%" . $searchfields."%' |
|
361 | + OR `description` like '%" . $searchfields."%' |
|
362 | + OR `snippet` like '%" . $searchfields."%' |
|
363 | + OR `properties` like '%" . $searchfields."%' |
|
364 | + OR `moduleguid` like '%" . $searchfields."%'"); |
|
365 | 365 | $snippetscounts = $modx->getDatabase()->getRecordCount($rs); |
366 | 366 | if ($snippetscounts > 0) { |
367 | - $output .= '<li><b><i class="fa fa-code"></i> ' . $_lang["manage_snippets"] . ' (' . $snippetscounts . ')</b></li>'; |
|
367 | + $output .= '<li><b><i class="fa fa-code"></i> '.$_lang["manage_snippets"].' ('.$snippetscounts.')</b></li>'; |
|
368 | 368 | while ($row = $modx->getDatabase()->getRow($rs)) { |
369 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=22&id=' . $row['id'] . '" id="snippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
369 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=22&id='.$row['id'].'" id="snippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
370 | 370 | } |
371 | 371 | } |
372 | 372 | } |
373 | 373 | |
374 | 374 | //plugins |
375 | 375 | if ($modx->hasPermission('edit_plugin')) { |
376 | - $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_plugins'), "`id` like '%" . $searchfields . "%' |
|
377 | - OR `name` like '%" . $searchfields . "%' |
|
378 | - OR `description` like '%" . $searchfields . "%' |
|
379 | - OR `plugincode` like '%" . $searchfields . "%' |
|
380 | - OR `properties` like '%" . $searchfields . "%' |
|
381 | - OR `moduleguid` like '%" . $searchfields . "%'"); |
|
376 | + $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_plugins'), "`id` like '%".$searchfields."%' |
|
377 | + OR `name` like '%" . $searchfields."%' |
|
378 | + OR `description` like '%" . $searchfields."%' |
|
379 | + OR `plugincode` like '%" . $searchfields."%' |
|
380 | + OR `properties` like '%" . $searchfields."%' |
|
381 | + OR `moduleguid` like '%" . $searchfields."%'"); |
|
382 | 382 | $pluginscounts = $modx->getDatabase()->getRecordCount($rs); |
383 | 383 | if ($pluginscounts > 0) { |
384 | - $output .= '<li><b><i class="fa fa-plug"></i> ' . $_lang["manage_plugins"] . ' (' . $pluginscounts . ')</b></li>'; |
|
384 | + $output .= '<li><b><i class="fa fa-plug"></i> '.$_lang["manage_plugins"].' ('.$pluginscounts.')</b></li>'; |
|
385 | 385 | while ($row = $modx->getDatabase()->getRow($rs)) { |
386 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=102&id=' . $row['id'] . '" id="plugins_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
386 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=102&id='.$row['id'].'" id="plugins_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
387 | 387 | } |
388 | 388 | } |
389 | 389 | } |
390 | 390 | |
391 | 391 | //modules |
392 | 392 | if ($modx->hasPermission('edit_module')) { |
393 | - $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_modules'), "`id` like '%" . $searchfields . "%' |
|
394 | - OR `name` like '%" . $searchfields . "%' |
|
395 | - OR `description` like '%" . $searchfields . "%' |
|
396 | - OR `modulecode` like '%" . $searchfields . "%' |
|
397 | - OR `properties` like '%" . $searchfields . "%' |
|
398 | - OR `guid` like '%" . $searchfields . "%' |
|
399 | - OR `resourcefile` like '%" . $searchfields . "%'"); |
|
393 | + $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_modules'), "`id` like '%".$searchfields."%' |
|
394 | + OR `name` like '%" . $searchfields."%' |
|
395 | + OR `description` like '%" . $searchfields."%' |
|
396 | + OR `modulecode` like '%" . $searchfields."%' |
|
397 | + OR `properties` like '%" . $searchfields."%' |
|
398 | + OR `guid` like '%" . $searchfields."%' |
|
399 | + OR `resourcefile` like '%" . $searchfields."%'"); |
|
400 | 400 | $modulescounts = $modx->getDatabase()->getRecordCount($rs); |
401 | 401 | if ($modulescounts > 0) { |
402 | - $output .= '<li><b><i class="fa fa-cogs"></i> ' . $_lang["modules"] . ' (' . $modulescounts . ')</b></li>'; |
|
402 | + $output .= '<li><b><i class="fa fa-cogs"></i> '.$_lang["modules"].' ('.$modulescounts.')</b></li>'; |
|
403 | 403 | while ($row = $modx->getDatabase()->getRow($rs)) { |
404 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=108&id=' . $row['id'] . '" id="modules_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
404 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=108&id='.$row['id'].'" id="modules_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
405 | 405 | } |
406 | 406 | } |
407 | 407 | } |
408 | 408 | |
409 | - echo $output ? '<div class="ajaxSearchResults"><ul>' . $output . '</ul></div>' : '1'; |
|
409 | + echo $output ? '<div class="ajaxSearchResults"><ul>'.$output.'</ul></div>' : '1'; |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | ?> |
@@ -4,18 +4,18 @@ |
||
4 | 4 | } |
5 | 5 | |
6 | 6 | switch($modx->getManagerApi()->action) { |
7 | - case 12: |
|
8 | - if(!$modx->hasPermission('edit_user')) { |
|
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | - } |
|
11 | - break; |
|
12 | - case 11: |
|
13 | - if(!$modx->hasPermission('new_user')) { |
|
14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | - } |
|
16 | - break; |
|
17 | - default: |
|
18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + case 12: |
|
8 | + if(!$modx->hasPermission('edit_user')) { |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | + } |
|
11 | + break; |
|
12 | + case 11: |
|
13 | + if(!$modx->hasPermission('new_user')) { |
|
14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | + } |
|
16 | + break; |
|
17 | + default: |
|
18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -1,21 +1,21 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
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 | 6 | switch($modx->getManagerApi()->action) { |
7 | - case 12: |
|
8 | - if(!$modx->hasPermission('edit_user')) { |
|
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | - } |
|
11 | - break; |
|
12 | - case 11: |
|
13 | - if(!$modx->hasPermission('new_user')) { |
|
14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | - } |
|
16 | - break; |
|
17 | - default: |
|
18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + case 12: |
|
8 | + if(!$modx->hasPermission('edit_user')) { |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | + } |
|
11 | + break; |
|
12 | + case 11: |
|
13 | + if(!$modx->hasPermission('new_user')) { |
|
14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | + } |
|
16 | + break; |
|
17 | + default: |
|
18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -23,79 +23,79 @@ discard block |
||
23 | 23 | // check to see the snippet editor isn't locked |
24 | 24 | $rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
25 | 25 | if($username = $modx->getDatabase()->getValue($rs)) { |
26 | - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
|
26 | + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
|
27 | 27 | } |
28 | 28 | // end check for lock |
29 | 29 | |
30 | 30 | if($modx->getManagerApi()->action == '12') { |
31 | - // get user attribute |
|
32 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
|
33 | - $userdata = $modx->getDatabase()->getRow($rs); |
|
34 | - if(!$userdata) { |
|
35 | - $modx->webAlertAndQuit("No user returned!"); |
|
36 | - } |
|
31 | + // get user attribute |
|
32 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
|
33 | + $userdata = $modx->getDatabase()->getRow($rs); |
|
34 | + if(!$userdata) { |
|
35 | + $modx->webAlertAndQuit("No user returned!"); |
|
36 | + } |
|
37 | 37 | |
38 | 38 | if($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) { |
39 | 39 | $modx->webAlertAndQuit('Illegal attempt to create/modify administrator by non-administrator!'); |
40 | 40 | } |
41 | 41 | |
42 | 42 | |
43 | - // get user settings |
|
44 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_settings'), "user = '{$user}'"); |
|
45 | - $usersettings = array(); |
|
46 | - while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
47 | - // manually extract so that user display settings are not overwritten |
|
48 | - foreach($usersettings as $k => $v) { |
|
49 | - if($k != 'manager_language' && $k != 'manager_theme') { |
|
50 | - ${$k} = $v; |
|
51 | - } |
|
52 | - } |
|
43 | + // get user settings |
|
44 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_settings'), "user = '{$user}'"); |
|
45 | + $usersettings = array(); |
|
46 | + while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
47 | + // manually extract so that user display settings are not overwritten |
|
48 | + foreach($usersettings as $k => $v) { |
|
49 | + if($k != 'manager_language' && $k != 'manager_theme') { |
|
50 | + ${$k} = $v; |
|
51 | + } |
|
52 | + } |
|
53 | 53 | |
54 | - // get user name |
|
55 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('manager_users'), "id = '{$user}'"); |
|
56 | - $usernamedata = $modx->getDatabase()->getRow($rs); |
|
57 | - if(!$usernamedata) { |
|
58 | - $modx->webAlertAndQuit("No user returned while getting username!"); |
|
59 | - } |
|
60 | - $_SESSION['itemname'] = $usernamedata['username']; |
|
54 | + // get user name |
|
55 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('manager_users'), "id = '{$user}'"); |
|
56 | + $usernamedata = $modx->getDatabase()->getRow($rs); |
|
57 | + if(!$usernamedata) { |
|
58 | + $modx->webAlertAndQuit("No user returned while getting username!"); |
|
59 | + } |
|
60 | + $_SESSION['itemname'] = $usernamedata['username']; |
|
61 | 61 | } else { |
62 | - $userdata = array(); |
|
63 | - $usersettings = array(); |
|
64 | - $usernamedata = array(); |
|
65 | - $_SESSION['itemname'] = $_lang["new_user"]; |
|
62 | + $userdata = array(); |
|
63 | + $usersettings = array(); |
|
64 | + $usernamedata = array(); |
|
65 | + $_SESSION['itemname'] = $_lang["new_user"]; |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | // avoid doubling htmlspecialchars (already encoded in DB) |
69 | 69 | foreach($userdata as $key => $val) { |
70 | - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
|
70 | + $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
|
71 | 71 | }; |
72 | 72 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
73 | 73 | |
74 | 74 | // restore saved form |
75 | 75 | $formRestored = false; |
76 | 76 | if($modx->getManagerApi()->hasFormValues()) { |
77 | - $modx->getManagerApi()->loadFormValues(); |
|
78 | - // restore post values |
|
79 | - $userdata = array_merge($userdata, $_POST); |
|
80 | - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
81 | - $usernamedata['username'] = $userdata['newusername']; |
|
82 | - $usernamedata['oldusername'] = $_POST['oldusername']; |
|
83 | - $usersettings = array_merge($usersettings, $userdata); |
|
84 | - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
85 | - extract($usersettings, EXTR_OVERWRITE); |
|
77 | + $modx->getManagerApi()->loadFormValues(); |
|
78 | + // restore post values |
|
79 | + $userdata = array_merge($userdata, $_POST); |
|
80 | + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
81 | + $usernamedata['username'] = $userdata['newusername']; |
|
82 | + $usernamedata['oldusername'] = $_POST['oldusername']; |
|
83 | + $usersettings = array_merge($usersettings, $userdata); |
|
84 | + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
85 | + extract($usersettings, EXTR_OVERWRITE); |
|
86 | 86 | } |
87 | 87 | |
88 | 88 | // include the country list language file |
89 | 89 | $_country_lang = array(); |
90 | 90 | include_once "lang/country/english_country.inc.php"; |
91 | 91 | if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
92 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
92 | + include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
93 | 93 | } |
94 | 94 | asort($_country_lang); |
95 | 95 | |
96 | 96 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
97 | 97 | if($which_browser == 'default') { |
98 | - $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
|
98 | + $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
|
99 | 99 | } |
100 | 100 | ?> |
101 | 101 | <script type="text/javascript"> |
@@ -205,14 +205,14 @@ discard block |
||
205 | 205 | <form action="index.php?a=32" method="post" name="userform"> |
206 | 206 | <?php |
207 | 207 | |
208 | - // invoke OnUserFormPrerender event |
|
209 | - $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
|
210 | - "id" => $user |
|
211 | - )); |
|
212 | - if(is_array($evtOut)) { |
|
213 | - echo implode("", $evtOut); |
|
214 | - } |
|
215 | - ?> |
|
208 | + // invoke OnUserFormPrerender event |
|
209 | + $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
|
210 | + "id" => $user |
|
211 | + )); |
|
212 | + if(is_array($evtOut)) { |
|
213 | + echo implode("", $evtOut); |
|
214 | + } |
|
215 | + ?> |
|
216 | 216 | <input type="hidden" name="mode" value="<?php echo $modx->getManagerApi()->action; ?>"> |
217 | 217 | <input type="hidden" name="id" value="<?php echo $user ?>"> |
218 | 218 | <input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" /> |
@@ -305,25 +305,25 @@ discard block |
||
305 | 305 | <td> </td> |
306 | 306 | <td><?php |
307 | 307 | |
308 | - $rs = $modx->getDatabase()->select( |
|
309 | - 'name, id', |
|
308 | + $rs = $modx->getDatabase()->select( |
|
309 | + 'name, id', |
|
310 | 310 | $modx->getDatabase()->getFullTableName('user_roles'), |
311 | 311 | ($modx->hasPermission('save_role')) ? '' : 'id != 1' |
312 | 312 | ); |
313 | - ?> |
|
313 | + ?> |
|
314 | 314 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
315 | 315 | <?php |
316 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
317 | - if($modx->getManagerApi()->action == '11') { |
|
318 | - $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
|
319 | - } else { |
|
320 | - $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
|
321 | - } |
|
322 | - ?> |
|
316 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
317 | + if($modx->getManagerApi()->action == '11') { |
|
318 | + $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
|
319 | + } else { |
|
320 | + $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
|
321 | + } |
|
322 | + ?> |
|
323 | 323 | <option value="<?php echo $row['id']; ?>"<?php echo $selectedtext; ?>><?php echo $row['name']; ?></option> |
324 | 324 | <?php |
325 | - } |
|
326 | - ?> |
|
325 | + } |
|
326 | + ?> |
|
327 | 327 | </select></td> |
328 | 328 | </tr> |
329 | 329 | <tr> |
@@ -368,10 +368,10 @@ discard block |
||
368 | 368 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
369 | 369 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
370 | 370 | <?php |
371 | - foreach($_country_lang as $key => $country) { |
|
372 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
373 | - } |
|
374 | - ?> |
|
371 | + foreach($_country_lang as $key => $country) { |
|
372 | + echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
373 | + } |
|
374 | + ?> |
|
375 | 375 | </select></td> |
376 | 376 | </tr> |
377 | 377 | <tr> |
@@ -447,21 +447,21 @@ discard block |
||
447 | 447 | <td><select name="manager_language" class="inputBox" onChange="documentDirty=true"> |
448 | 448 | <option value=""></option> |
449 | 449 | <?php |
450 | - $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
|
451 | - $dir = dir("includes/lang"); |
|
452 | - while($file = $dir->read()) { |
|
453 | - if(strpos($file, ".inc.php") > 0) { |
|
454 | - $endpos = strpos($file, "."); |
|
455 | - $languagename = substr($file, 0, $endpos); |
|
456 | - $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
|
457 | - ?> |
|
450 | + $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
|
451 | + $dir = dir("includes/lang"); |
|
452 | + while($file = $dir->read()) { |
|
453 | + if(strpos($file, ".inc.php") > 0) { |
|
454 | + $endpos = strpos($file, "."); |
|
455 | + $languagename = substr($file, 0, $endpos); |
|
456 | + $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
|
457 | + ?> |
|
458 | 458 | <option value="<?php echo $languagename; ?>" <?php echo $selectedtext; ?>><?php echo ucwords(str_replace("_", " ", $languagename)); ?></option> |
459 | 459 | <?php |
460 | 460 | |
461 | - } |
|
462 | - } |
|
463 | - $dir->close(); |
|
464 | - ?> |
|
461 | + } |
|
462 | + } |
|
463 | + $dir->close(); |
|
464 | + ?> |
|
465 | 465 | </select></td> |
466 | 466 | </tr> |
467 | 467 | <tr> |
@@ -536,22 +536,22 @@ discard block |
||
536 | 536 | <td><select name="manager_theme" class="inputBox" onChange="documentDirty=true;document.userform.theme_refresher.value = Date.parse(new Date());"> |
537 | 537 | <option value=""></option> |
538 | 538 | <?php |
539 | - $dir = dir("media/style/"); |
|
540 | - while($file = $dir->read()) { |
|
541 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
542 | - $themename = $file; |
|
543 | - if($themename === 'common') { |
|
544 | - continue; |
|
545 | - } |
|
546 | - $attr = 'value="' . $themename . '" '; |
|
547 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
548 | - $attr .= 'selected="selected" '; |
|
549 | - } |
|
550 | - echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
551 | - } |
|
552 | - } |
|
553 | - $dir->close(); |
|
554 | - ?> |
|
539 | + $dir = dir("media/style/"); |
|
540 | + while($file = $dir->read()) { |
|
541 | + if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
542 | + $themename = $file; |
|
543 | + if($themename === 'common') { |
|
544 | + continue; |
|
545 | + } |
|
546 | + $attr = 'value="' . $themename . '" '; |
|
547 | + if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
548 | + $attr .= 'selected="selected" '; |
|
549 | + } |
|
550 | + echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
551 | + } |
|
552 | + } |
|
553 | + $dir->close(); |
|
554 | + ?> |
|
555 | 555 | </select> |
556 | 556 | <input type="hidden" name="theme_refresher" value=""></td> |
557 | 557 | </tr> |
@@ -587,15 +587,15 @@ discard block |
||
587 | 587 | <th><?php echo $_lang["which_browser_title"] ?></th> |
588 | 588 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> |
589 | 589 | <?php |
590 | - $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
591 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
592 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
593 | - $dir = str_replace('\\', '/', $dir); |
|
594 | - $browser_name = substr($dir, strrpos($dir, '/') + 1); |
|
595 | - $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
596 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
597 | - } |
|
598 | - ?> |
|
590 | + $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
591 | + echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
592 | + foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
593 | + $dir = str_replace('\\', '/', $dir); |
|
594 | + $browser_name = substr($dir, strrpos($dir, '/') + 1); |
|
595 | + $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
|
596 | + echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
597 | + } |
|
598 | + ?> |
|
599 | 599 | </select></td> |
600 | 600 | </tr> |
601 | 601 | <tr> |
@@ -672,17 +672,17 @@ discard block |
||
672 | 672 | <option value=""></option> |
673 | 673 | <?php |
674 | 674 | |
675 | - $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
|
676 | - // invoke OnRichTextEditorRegister event |
|
677 | - $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
|
678 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
679 | - if(is_array($evtOut)) { |
|
680 | - for($i = 0; $i < count($evtOut); $i++) { |
|
681 | - $editor = $evtOut[$i]; |
|
682 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
683 | - } |
|
684 | - } |
|
685 | - ?> |
|
675 | + $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
|
676 | + // invoke OnRichTextEditorRegister event |
|
677 | + $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
|
678 | + echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
679 | + if(is_array($evtOut)) { |
|
680 | + for($i = 0; $i < count($evtOut); $i++) { |
|
681 | + $editor = $evtOut[$i]; |
|
682 | + echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
683 | + } |
|
684 | + } |
|
685 | + ?> |
|
686 | 686 | </select></td> |
687 | 687 | </tr> |
688 | 688 | <tr id='editorRow1' style="display: <?php echo $use_editor == 1 ? $displayStyle : 'none'; ?>"> |
@@ -715,12 +715,12 @@ discard block |
||
715 | 715 | </tr> |
716 | 716 | </table> |
717 | 717 | <?php |
718 | - // invoke OnInterfaceSettingsRender event |
|
719 | - $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
|
720 | - if(is_array($evtOut)) { |
|
721 | - echo implode("", $evtOut); |
|
722 | - } |
|
723 | - ?> |
|
718 | + // invoke OnInterfaceSettingsRender event |
|
719 | + $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
|
720 | + if(is_array($evtOut)) { |
|
721 | + echo implode("", $evtOut); |
|
722 | + } |
|
723 | + ?> |
|
724 | 724 | </div> |
725 | 725 | |
726 | 726 | <!-- Photo --> |
@@ -769,39 +769,39 @@ discard block |
||
769 | 769 | </div> |
770 | 770 | <?php if($use_udperms == 1) { |
771 | 771 | |
772 | - $groupsarray = array(); |
|
773 | - |
|
774 | - if($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited |
|
775 | - $rs = $modx->getDatabase()->select('user_group', $modx->getDatabase()->getFullTableName('member_groups'), "member='{$user}'"); |
|
776 | - $groupsarray = $modx->getDatabase()->getColumn('user_group', $rs); |
|
777 | - } |
|
778 | - // retain selected doc groups between post |
|
779 | - if(is_array($_POST['user_groups'])) { |
|
780 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
781 | - } |
|
782 | - ?> |
|
772 | + $groupsarray = array(); |
|
773 | + |
|
774 | + if($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited |
|
775 | + $rs = $modx->getDatabase()->select('user_group', $modx->getDatabase()->getFullTableName('member_groups'), "member='{$user}'"); |
|
776 | + $groupsarray = $modx->getDatabase()->getColumn('user_group', $rs); |
|
777 | + } |
|
778 | + // retain selected doc groups between post |
|
779 | + if(is_array($_POST['user_groups'])) { |
|
780 | + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
781 | + } |
|
782 | + ?> |
|
783 | 783 | <div class="tab-page" id="tabAccess"> |
784 | 784 | <h2 class="tab"><?php echo $_lang["access_permissions"] ?></h2> |
785 | 785 | <script type="text/javascript">tpUser.addTabPage(document.getElementById("tabAccess"));</script> |
786 | 786 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
787 | 787 | <?php |
788 | - $rs = $modx->getDatabase()->select('name, id', $modx->getDatabase()->getFullTableName('membergroup_names'), '', 'name'); |
|
789 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
790 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
791 | - } |
|
792 | - } |
|
793 | - ?> |
|
788 | + $rs = $modx->getDatabase()->select('name, id', $modx->getDatabase()->getFullTableName('membergroup_names'), '', 'name'); |
|
789 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
790 | + echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
791 | + } |
|
792 | + } |
|
793 | + ?> |
|
794 | 794 | </div> |
795 | 795 | </div> |
796 | 796 | </div> |
797 | 797 | <input type="submit" name="save" style="display:none"> |
798 | 798 | <?php |
799 | - // invoke OnUserFormRender event |
|
800 | - $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
|
801 | - "id" => $user |
|
802 | - )); |
|
803 | - if(is_array($evtOut)) { |
|
804 | - echo implode("", $evtOut); |
|
805 | - } |
|
806 | - ?> |
|
799 | + // invoke OnUserFormRender event |
|
800 | + $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
|
801 | + "id" => $user |
|
802 | + )); |
|
803 | + if(is_array($evtOut)) { |
|
804 | + echo implode("", $evtOut); |
|
805 | + } |
|
806 | + ?> |
|
807 | 807 | </form> |
@@ -1,16 +1,16 @@ 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 | -switch($modx->getManagerApi()->action) { |
|
6 | +switch ($modx->getManagerApi()->action) { |
|
7 | 7 | case 12: |
8 | - if(!$modx->hasPermission('edit_user')) { |
|
8 | + if (!$modx->hasPermission('edit_user')) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | break; |
12 | 12 | case 11: |
13 | - if(!$modx->hasPermission('new_user')) { |
|
13 | + if (!$modx->hasPermission('new_user')) { |
|
14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | 15 | } |
16 | 16 | break; |
@@ -18,24 +18,24 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$user = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | // check to see the snippet editor isn't locked |
24 | -$rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
25 | -if($username = $modx->getDatabase()->getValue($rs)) { |
|
24 | +$rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
25 | +if ($username = $modx->getDatabase()->getValue($rs)) { |
|
26 | 26 | $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
27 | 27 | } |
28 | 28 | // end check for lock |
29 | 29 | |
30 | -if($modx->getManagerApi()->action == '12') { |
|
30 | +if ($modx->getManagerApi()->action == '12') { |
|
31 | 31 | // get user attribute |
32 | 32 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
33 | 33 | $userdata = $modx->getDatabase()->getRow($rs); |
34 | - if(!$userdata) { |
|
34 | + if (!$userdata) { |
|
35 | 35 | $modx->webAlertAndQuit("No user returned!"); |
36 | 36 | } |
37 | 37 | |
38 | - if($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) { |
|
38 | + if ($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) { |
|
39 | 39 | $modx->webAlertAndQuit('Illegal attempt to create/modify administrator by non-administrator!'); |
40 | 40 | } |
41 | 41 | |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | // get user settings |
44 | 44 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_settings'), "user = '{$user}'"); |
45 | 45 | $usersettings = array(); |
46 | - while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
46 | + while ($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
47 | 47 | // manually extract so that user display settings are not overwritten |
48 | - foreach($usersettings as $k => $v) { |
|
49 | - if($k != 'manager_language' && $k != 'manager_theme') { |
|
48 | + foreach ($usersettings as $k => $v) { |
|
49 | + if ($k != 'manager_language' && $k != 'manager_theme') { |
|
50 | 50 | ${$k} = $v; |
51 | 51 | } |
52 | 52 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | // get user name |
55 | 55 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('manager_users'), "id = '{$user}'"); |
56 | 56 | $usernamedata = $modx->getDatabase()->getRow($rs); |
57 | - if(!$usernamedata) { |
|
57 | + if (!$usernamedata) { |
|
58 | 58 | $modx->webAlertAndQuit("No user returned while getting username!"); |
59 | 59 | } |
60 | 60 | $_SESSION['itemname'] = $usernamedata['username']; |
@@ -66,14 +66,14 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | // avoid doubling htmlspecialchars (already encoded in DB) |
69 | -foreach($userdata as $key => $val) { |
|
69 | +foreach ($userdata as $key => $val) { |
|
70 | 70 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
71 | 71 | }; |
72 | 72 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
73 | 73 | |
74 | 74 | // restore saved form |
75 | 75 | $formRestored = false; |
76 | -if($modx->getManagerApi()->hasFormValues()) { |
|
76 | +if ($modx->getManagerApi()->hasFormValues()) { |
|
77 | 77 | $modx->getManagerApi()->loadFormValues(); |
78 | 78 | // restore post values |
79 | 79 | $userdata = array_merge($userdata, $_POST); |
@@ -88,13 +88,13 @@ discard block |
||
88 | 88 | // include the country list language file |
89 | 89 | $_country_lang = array(); |
90 | 90 | include_once "lang/country/english_country.inc.php"; |
91 | -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
92 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
91 | +if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) { |
|
92 | + include_once "lang/country/".$manager_language."_country.inc.php"; |
|
93 | 93 | } |
94 | 94 | asort($_country_lang); |
95 | 95 | |
96 | 96 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
97 | -if($which_browser == 'default') { |
|
97 | +if ($which_browser == 'default') { |
|
98 | 98 | $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
99 | 99 | } |
100 | 100 | ?> |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | document.userform.save.click(); |
187 | 187 | }, |
188 | 188 | delete: function() { |
189 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
189 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
190 | 190 | alert("<?php echo $_lang['alert_delete_self']; ?>"); |
191 | 191 | <?php } else { ?> |
192 | 192 | if(confirm("<?php echo $_lang['confirm_delete_user']; ?>") === true) { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
210 | 210 | "id" => $user |
211 | 211 | )); |
212 | - if(is_array($evtOut)) { |
|
212 | + if (is_array($evtOut)) { |
|
213 | 213 | echo implode("", $evtOut); |
214 | 214 | } |
215 | 215 | ?> |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | <input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" /> |
219 | 219 | |
220 | 220 | <h1> |
221 | - <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['user_title']) ?> |
|
221 | + <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['user_title']) ?> |
|
222 | 222 | </h1> |
223 | 223 | |
224 | 224 | <?php echo $_style['actionbuttons']['dynamic']['user'] ?> |
@@ -236,13 +236,13 @@ discard block |
||
236 | 236 | <table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser"> |
237 | 237 | <tr> |
238 | 238 | <td colspan="3"><span id="blocked" class="warning"> |
239 | - <?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
239 | + <?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
240 | 240 | <?php echo $_lang['user_is_blocked']; ?> |
241 | 241 | <?php } ?> |
242 | 242 | </span> |
243 | 243 | <br /></td> |
244 | 244 | </tr> |
245 | - <?php if(!empty($userdata['id'])) { ?> |
|
245 | + <?php if (!empty($userdata['id'])) { ?> |
|
246 | 246 | <tr id="showname" style="display: <?php echo ($modx->getManagerApi()->action == '12' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> "> |
247 | 247 | <td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i> <b><?php echo $modx->getPhpCompat()->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?></b> - <span class="comment"><a href="javascript:;" onClick="changeName();return false;"><?php echo $_lang["change_name"]; ?></a></span> |
248 | 248 | <input type="hidden" name="oldusername" value="<?php echo $modx->getPhpCompat()->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" /> |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | <td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->getPhpCompat()->htmlspecialchars($usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td> |
256 | 256 | </tr> |
257 | 257 | <tr> |
258 | - <th><?php echo $modx->getManagerApi()->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th> |
|
258 | + <th><?php echo $modx->getManagerApi()->action == '11' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th> |
|
259 | 259 | <td> </td> |
260 | 260 | <td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->getManagerApi()->action == "11" ? " checked disabled" : ""; ?>> |
261 | 261 | <input type="hidden" name="newpassword" value="<?php echo $modx->getManagerApi()->action == "11" ? 1 : 0; ?>" onChange="documentDirty=true;" /> |
@@ -313,8 +313,8 @@ discard block |
||
313 | 313 | ?> |
314 | 314 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
315 | 315 | <?php |
316 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
317 | - if($modx->getManagerApi()->action == '11') { |
|
316 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
317 | + if ($modx->getManagerApi()->action == '11') { |
|
318 | 318 | $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
319 | 319 | } else { |
320 | 320 | $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
@@ -368,8 +368,8 @@ discard block |
||
368 | 368 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
369 | 369 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
370 | 370 | <?php |
371 | - foreach($_country_lang as $key => $country) { |
|
372 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
371 | + foreach ($_country_lang as $key => $country) { |
|
372 | + echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>"; |
|
373 | 373 | } |
374 | 374 | ?> |
375 | 375 | </select></td> |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | <td> </td> |
396 | 396 | <td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->getPhpCompat()->htmlspecialchars($userdata['comment']); ?></textarea></td> |
397 | 397 | </tr> |
398 | - <?php if($modx->getManagerApi()->action == '12') { ?> |
|
398 | + <?php if ($modx->getManagerApi()->action == '12') { ?> |
|
399 | 399 | <tr> |
400 | 400 | <th><?php echo $_lang['user_logincount']; ?>:</th> |
401 | 401 | <td> </td> |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | </tr> |
433 | 433 | <?php } ?> |
434 | 434 | </table> |
435 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
435 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
436 | 436 | <p><?php echo $_lang['user_edit_self_msg']; ?></p> |
437 | 437 | <?php } ?> |
438 | 438 | </div> |
@@ -449,8 +449,8 @@ discard block |
||
449 | 449 | <?php |
450 | 450 | $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
451 | 451 | $dir = dir("includes/lang"); |
452 | - while($file = $dir->read()) { |
|
453 | - if(strpos($file, ".inc.php") > 0) { |
|
452 | + while ($file = $dir->read()) { |
|
453 | + if (strpos($file, ".inc.php") > 0) { |
|
454 | 454 | $endpos = strpos($file, "."); |
455 | 455 | $languagename = substr($file, 0, $endpos); |
456 | 456 | $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
@@ -537,17 +537,17 @@ discard block |
||
537 | 537 | <option value=""></option> |
538 | 538 | <?php |
539 | 539 | $dir = dir("media/style/"); |
540 | - while($file = $dir->read()) { |
|
541 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
540 | + while ($file = $dir->read()) { |
|
541 | + if ($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
542 | 542 | $themename = $file; |
543 | - if($themename === 'common') { |
|
543 | + if ($themename === 'common') { |
|
544 | 544 | continue; |
545 | 545 | } |
546 | - $attr = 'value="' . $themename . '" '; |
|
547 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
546 | + $attr = 'value="'.$themename.'" '; |
|
547 | + if (isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
548 | 548 | $attr .= 'selected="selected" '; |
549 | 549 | } |
550 | - echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
550 | + echo "\t\t<option ".rtrim($attr).'>'.ucwords(str_replace("_", " ", $themename))."</option>\n"; |
|
551 | 551 | } |
552 | 552 | } |
553 | 553 | $dir->close(); |
@@ -588,12 +588,12 @@ discard block |
||
588 | 588 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> |
589 | 589 | <?php |
590 | 590 | $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
591 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
592 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
591 | + echo '<option value="default"'.$selected.'>'.$_lang['option_default']."</option>\n"; |
|
592 | + foreach (glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
593 | 593 | $dir = str_replace('\\', '/', $dir); |
594 | 594 | $browser_name = substr($dir, strrpos($dir, '/') + 1); |
595 | 595 | $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
596 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
596 | + echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n"; |
|
597 | 597 | } |
598 | 598 | ?> |
599 | 599 | </select></td> |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | </tr> |
621 | 621 | <tr> |
622 | 622 | <td> </td> |
623 | - <td class='comment'><?php echo $_lang["uploadable_images_message"] . $_lang["user_upload_message"] ?></td> |
|
623 | + <td class='comment'><?php echo $_lang["uploadable_images_message"].$_lang["user_upload_message"] ?></td> |
|
624 | 624 | </tr> |
625 | 625 | <tr> |
626 | 626 | <th><?php echo $_lang["uploadable_media_title"] ?></th> |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | </tr> |
633 | 633 | <tr> |
634 | 634 | <td> </td> |
635 | - <td class='comment'><?php echo $_lang["uploadable_media_message"] . $_lang["user_upload_message"] ?></td> |
|
635 | + <td class='comment'><?php echo $_lang["uploadable_media_message"].$_lang["user_upload_message"] ?></td> |
|
636 | 636 | </tr> |
637 | 637 | <tr> |
638 | 638 | <th><?php echo $_lang["uploadable_flash_title"] ?></th> |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | </tr> |
645 | 645 | <tr> |
646 | 646 | <td> </td> |
647 | - <td class='comment'><?php echo $_lang["uploadable_flash_message"] . $_lang["user_upload_message"] ?></td> |
|
647 | + <td class='comment'><?php echo $_lang["uploadable_flash_message"].$_lang["user_upload_message"] ?></td> |
|
648 | 648 | </tr> |
649 | 649 | <tr> |
650 | 650 | <th><?php echo $_lang["uploadable_files_title"] ?></th> |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | </tr> |
657 | 657 | <tr> |
658 | 658 | <td> </td> |
659 | - <td class='comment'><?php echo $_lang["uploadable_files_message"] . $_lang["user_upload_message"] ?></td> |
|
659 | + <td class='comment'><?php echo $_lang["uploadable_files_message"].$_lang["user_upload_message"] ?></td> |
|
660 | 660 | </tr> |
661 | 661 | <tr class='row2'> |
662 | 662 | <th><?php echo $_lang["upload_maxsize_title"] ?></th> |
@@ -675,11 +675,11 @@ discard block |
||
675 | 675 | $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
676 | 676 | // invoke OnRichTextEditorRegister event |
677 | 677 | $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
678 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
679 | - if(is_array($evtOut)) { |
|
680 | - for($i = 0; $i < count($evtOut); $i++) { |
|
678 | + echo "<option value='none'".($edt == 'none' ? " selected='selected'" : "").">".$_lang["none"]."</option>\n"; |
|
679 | + if (is_array($evtOut)) { |
|
680 | + for ($i = 0; $i < count($evtOut); $i++) { |
|
681 | 681 | $editor = $evtOut[$i]; |
682 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
682 | + echo "<option value='$editor'".($edt == $editor ? " selected='selected'" : "").">$editor</option>\n"; |
|
683 | 683 | } |
684 | 684 | } |
685 | 685 | ?> |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | <?php |
718 | 718 | // invoke OnInterfaceSettingsRender event |
719 | 719 | $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
720 | - if(is_array($evtOut)) { |
|
720 | + if (is_array($evtOut)) { |
|
721 | 721 | echo implode("", $evtOut); |
722 | 722 | } |
723 | 723 | ?> |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | function BrowseServer() { |
745 | 745 | var w = screen.width * 0.7; |
746 | 746 | var h = screen.height * 0.7; |
747 | - OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h); |
|
747 | + OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h); |
|
748 | 748 | } |
749 | 749 | |
750 | 750 | function SetUrl(url, width, height, alt) { |
@@ -767,17 +767,17 @@ discard block |
||
767 | 767 | </tr> |
768 | 768 | </table> |
769 | 769 | </div> |
770 | - <?php if($use_udperms == 1) { |
|
770 | + <?php if ($use_udperms == 1) { |
|
771 | 771 | |
772 | 772 | $groupsarray = array(); |
773 | 773 | |
774 | - if($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited |
|
774 | + if ($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited |
|
775 | 775 | $rs = $modx->getDatabase()->select('user_group', $modx->getDatabase()->getFullTableName('member_groups'), "member='{$user}'"); |
776 | 776 | $groupsarray = $modx->getDatabase()->getColumn('user_group', $rs); |
777 | 777 | } |
778 | 778 | // retain selected doc groups between post |
779 | - if(is_array($_POST['user_groups'])) { |
|
780 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
779 | + if (is_array($_POST['user_groups'])) { |
|
780 | + foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
781 | 781 | } |
782 | 782 | ?> |
783 | 783 | <div class="tab-page" id="tabAccess"> |
@@ -786,8 +786,8 @@ discard block |
||
786 | 786 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
787 | 787 | <?php |
788 | 788 | $rs = $modx->getDatabase()->select('name, id', $modx->getDatabase()->getFullTableName('membergroup_names'), '', 'name'); |
789 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
790 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
789 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
790 | + echo "<label><input type='checkbox' name='user_groups[]' value='".$row['id']."'".(in_array($row['id'], $groupsarray) ? " checked='checked'" : "")." />".$row['name']."</label><br />"; |
|
791 | 791 | } |
792 | 792 | } |
793 | 793 | ?> |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
801 | 801 | "id" => $user |
802 | 802 | )); |
803 | - if(is_array($evtOut)) { |
|
803 | + if (is_array($evtOut)) { |
|
804 | 804 | echo implode("", $evtOut); |
805 | 805 | } |
806 | 806 | ?> |
@@ -43,7 +43,9 @@ discard block |
||
43 | 43 | // get user settings |
44 | 44 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_settings'), "user = '{$user}'"); |
45 | 45 | $usersettings = array(); |
46 | - while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
46 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
47 | + $usersettings[$row['setting_name']] = $row['setting_value']; |
|
48 | + } |
|
47 | 49 | // manually extract so that user display settings are not overwritten |
48 | 50 | foreach($usersettings as $k => $v) { |
49 | 51 | if($k != 'manager_language' && $k != 'manager_theme') { |
@@ -771,13 +773,16 @@ discard block |
||
771 | 773 | |
772 | 774 | $groupsarray = array(); |
773 | 775 | |
774 | - if($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited |
|
776 | + if($modx->getManagerApi()->action == '12') { |
|
777 | +// only do this bit if the user is being edited |
|
775 | 778 | $rs = $modx->getDatabase()->select('user_group', $modx->getDatabase()->getFullTableName('member_groups'), "member='{$user}'"); |
776 | 779 | $groupsarray = $modx->getDatabase()->getColumn('user_group', $rs); |
777 | 780 | } |
778 | 781 | // retain selected doc groups between post |
779 | 782 | if(is_array($_POST['user_groups'])) { |
780 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
783 | + foreach($_POST['user_groups'] as $n => $v) { |
|
784 | + $groupsarray[] = $v; |
|
785 | + } |
|
781 | 786 | } |
782 | 787 | ?> |
783 | 788 | <div class="tab-page" id="tabAccess"> |
@@ -4,18 +4,18 @@ |
||
4 | 4 | } |
5 | 5 | |
6 | 6 | switch ((int)$modx->getManagerApi()->action) { |
7 | - case 35: |
|
8 | - if (!$modx->hasPermission('edit_role')) { |
|
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | - } |
|
11 | - break; |
|
12 | - case 38: |
|
13 | - if (!$modx->hasPermission('new_role')) { |
|
7 | + case 35: |
|
8 | + if (!$modx->hasPermission('edit_role')) { |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | + } |
|
11 | + break; |
|
12 | + case 38: |
|
13 | + if (!$modx->hasPermission('new_role')) { |
|
14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | + } |
|
16 | + break; |
|
17 | + default: |
|
14 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | - } |
|
16 | - break; |
|
17 | - default: |
|
18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -3,7 +3,7 @@ discard block |
||
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 | -switch ((int)$modx->getManagerApi()->action) { |
|
6 | +switch ((int) $modx->getManagerApi()->action) { |
|
7 | 7 | case 35: |
8 | 8 | if (!$modx->hasPermission('edit_role')) { |
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$role = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | $tbl_user_roles = $modx->getDatabase()->getFullTableName('user_roles'); |
24 | 24 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | // Add lock-element JS-Script |
47 | 47 | $lockElementId = $role; |
48 | 48 | $lockElementType = 8; |
49 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
49 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
50 | 50 | ?> |
51 | 51 | <script type="text/javascript"> |
52 | 52 | function changestate(element) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | <input type="hidden" name="id" value="<?= $_GET['id'] ?>"> |
83 | 83 | |
84 | 84 | <h1> |
85 | - <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'] . '<small>(' . $roledata['id'] . ')</small>' : $_lang['role_title']) ?> |
|
85 | + <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'].'<small>('.$roledata['id'].')</small>' : $_lang['role_title']) ?> |
|
86 | 86 | </h1> |
87 | 87 | |
88 | 88 | <?= $_style['actionbuttons']['dynamic']['savedelete'] ?> |
@@ -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('view_eventlog')) { |
|
5 | +if(!$modx->hasPermission('view_eventlog')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | $modx->getManagerApi()->initPageViewState(); |
16 | 16 | |
17 | 17 | // get and save search string |
18 | -if($_REQUEST['op'] == 'reset') { |
|
18 | +if($_REQUEST['op'] == 'reset') { |
|
19 | 19 | $sqlQuery = $query = ''; |
20 | 20 | $_PAGE['vs']['search'] = ''; |
21 | -} else { |
|
21 | +} else { |
|
22 | 22 | $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
23 | - if(!is_numeric($sqlQuery)) { |
|
23 | + if(!is_numeric($sqlQuery)) { |
|
24 | 24 | $sqlQuery = $modx->getDatabase()->escape($query); |
25 | 25 | } |
26 | 26 | $_PAGE['vs']['search'] = $query; |
@@ -143,10 +143,10 @@ discard block |
||
143 | 143 | $grd->colWidths = "1%,,1%,1%,1%"; |
144 | 144 | $grd->colAligns = "center,,,center,center"; |
145 | 145 | $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; |
146 | - if($listmode == '1') { |
|
146 | + if($listmode == '1') { |
|
147 | 147 | $grd->pageSize = 0; |
148 | 148 | } |
149 | - if($_REQUEST['op'] == 'reset') { |
|
149 | + if($_REQUEST['op'] == 'reset') { |
|
150 | 150 | $grd->pageNumber = 1; |
151 | 151 | } |
152 | 152 | // render grid |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
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('view_eventlog')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // Get table Names (alphabetical) |
@@ -16,14 +16,14 @@ discard block |
||
16 | 16 | |
17 | 17 | // get and save search string |
18 | 18 | if($_REQUEST['op'] == 'reset') { |
19 | - $sqlQuery = $query = ''; |
|
20 | - $_PAGE['vs']['search'] = ''; |
|
19 | + $sqlQuery = $query = ''; |
|
20 | + $_PAGE['vs']['search'] = ''; |
|
21 | 21 | } else { |
22 | - $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
|
23 | - if(!is_numeric($sqlQuery)) { |
|
24 | - $sqlQuery = $modx->getDatabase()->escape($query); |
|
25 | - } |
|
26 | - $_PAGE['vs']['search'] = $query; |
|
22 | + $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
|
23 | + if(!is_numeric($sqlQuery)) { |
|
24 | + $sqlQuery = $modx->getDatabase()->escape($query); |
|
25 | + } |
|
26 | + $_PAGE['vs']['search'] = $query; |
|
27 | 27 | } |
28 | 28 | |
29 | 29 | // get & save listmode |
@@ -124,32 +124,32 @@ discard block |
||
124 | 124 | <div class="row"> |
125 | 125 | <div class="table-responsive"> |
126 | 126 | <?php |
127 | - $ds = $modx->getDatabase()->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el |
|
127 | + $ds = $modx->getDatabase()->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el |
|
128 | 128 | LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0 |
129 | 129 | LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC"); |
130 | - $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items |
|
131 | - $grd->pagerClass = ''; |
|
132 | - $grd->pageClass = 'page-item'; |
|
133 | - $grd->selPageClass = 'page-item active'; |
|
134 | - $grd->noRecordMsg = $_lang['no_records_found']; |
|
135 | - $grd->cssClass = "table data nowrap"; |
|
136 | - $grd->columnHeaderClass = "tableHeader"; |
|
137 | - $grd->itemClass = "tableItem"; |
|
138 | - $grd->altItemClass = "tableAltItem"; |
|
139 | - $grd->fields = "type,source,createdon,eventid,username"; |
|
140 | - $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; |
|
141 | - $grd->colWidths = "1%,,1%,1%,1%"; |
|
142 | - $grd->colAligns = "center,,,center,center"; |
|
143 | - $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; |
|
144 | - if($listmode == '1') { |
|
145 | - $grd->pageSize = 0; |
|
146 | - } |
|
147 | - if($_REQUEST['op'] == 'reset') { |
|
148 | - $grd->pageNumber = 1; |
|
149 | - } |
|
150 | - // render grid |
|
151 | - echo $grd->render(); |
|
152 | - ?> |
|
130 | + $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items |
|
131 | + $grd->pagerClass = ''; |
|
132 | + $grd->pageClass = 'page-item'; |
|
133 | + $grd->selPageClass = 'page-item active'; |
|
134 | + $grd->noRecordMsg = $_lang['no_records_found']; |
|
135 | + $grd->cssClass = "table data nowrap"; |
|
136 | + $grd->columnHeaderClass = "tableHeader"; |
|
137 | + $grd->itemClass = "tableItem"; |
|
138 | + $grd->altItemClass = "tableAltItem"; |
|
139 | + $grd->fields = "type,source,createdon,eventid,username"; |
|
140 | + $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; |
|
141 | + $grd->colWidths = "1%,,1%,1%,1%"; |
|
142 | + $grd->colAligns = "center,,,center,center"; |
|
143 | + $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; |
|
144 | + if($listmode == '1') { |
|
145 | + $grd->pageSize = 0; |
|
146 | + } |
|
147 | + if($_REQUEST['op'] == 'reset') { |
|
148 | + $grd->pageNumber = 1; |
|
149 | + } |
|
150 | + // render grid |
|
151 | + echo $grd->render(); |
|
152 | + ?> |
|
153 | 153 | </div> |
154 | 154 | </div> |
155 | 155 | </div> |
@@ -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('view_eventlog')) { |
|
5 | +if (!$modx->hasPermission('view_eventlog')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -15,12 +15,12 @@ discard block |
||
15 | 15 | $modx->getManagerApi()->initPageViewState(); |
16 | 16 | |
17 | 17 | // get and save search string |
18 | -if($_REQUEST['op'] == 'reset') { |
|
18 | +if ($_REQUEST['op'] == 'reset') { |
|
19 | 19 | $sqlQuery = $query = ''; |
20 | 20 | $_PAGE['vs']['search'] = ''; |
21 | 21 | } else { |
22 | 22 | $sqlQuery = $query = isset($_REQUEST['search']) ? $_REQUEST['search'] : $_PAGE['vs']['search']; |
23 | - if(!is_numeric($sqlQuery)) { |
|
23 | + if (!is_numeric($sqlQuery)) { |
|
24 | 24 | $sqlQuery = $modx->getDatabase()->escape($query); |
25 | 25 | } |
26 | 26 | $_PAGE['vs']['search'] = $query; |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | <?php |
127 | 127 | $ds = $modx->getDatabase()->select("el.id, ELT(el.type , 'text-info {$_style['actions_info']}' , 'text-warning {$_style['actions_triangle']}' , 'text-danger {$_style['actions_error']}' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el |
128 | 128 | LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0 |
129 | - LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC"); |
|
129 | + LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "".(is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '')."(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC"); |
|
130 | 130 | $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items |
131 | 131 | $grd->pagerClass = ''; |
132 | 132 | $grd->pageClass = 'page-item'; |
@@ -137,14 +137,14 @@ discard block |
||
137 | 137 | $grd->itemClass = "tableItem"; |
138 | 138 | $grd->altItemClass = "tableAltItem"; |
139 | 139 | $grd->fields = "type,source,createdon,eventid,username"; |
140 | - $grd->columns = $_lang['type'] . " ," . $_lang['source'] . " ," . $_lang['date'] . " ," . $_lang['event_id'] . " ," . $_lang['sysinfo_userid']; |
|
140 | + $grd->columns = $_lang['type']." ,".$_lang['source']." ,".$_lang['date']." ,".$_lang['event_id']." ,".$_lang['sysinfo_userid']; |
|
141 | 141 | $grd->colWidths = "1%,,1%,1%,1%"; |
142 | 142 | $grd->colAligns = "center,,,center,center"; |
143 | - $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang['click_to_context'] . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . $_lang['click_to_view_details'] . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; |
|
144 | - if($listmode == '1') { |
|
143 | + $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".$_lang['click_to_context']."'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='".$_lang['click_to_view_details']."'>[+source+]</a>||date: ".$modx->toDateFormat(null, 'formatOnly').' %I:%M %p'; |
|
144 | + if ($listmode == '1') { |
|
145 | 145 | $grd->pageSize = 0; |
146 | 146 | } |
147 | - if($_REQUEST['op'] == 'reset') { |
|
147 | + if ($_REQUEST['op'] == 'reset') { |
|
148 | 148 | $grd->pageNumber = 1; |
149 | 149 | } |
150 | 150 | // render grid |
@@ -4,18 +4,18 @@ |
||
4 | 4 | } |
5 | 5 | |
6 | 6 | switch ($modx->getManagerApi()->action) { |
7 | - case 78: |
|
8 | - if (!$modx->hasPermission('edit_chunk')) { |
|
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | - } |
|
11 | - break; |
|
12 | - case 77: |
|
13 | - if (!$modx->hasPermission('new_chunk')) { |
|
7 | + case 78: |
|
8 | + if (!$modx->hasPermission('edit_chunk')) { |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | + } |
|
11 | + break; |
|
12 | + case 77: |
|
13 | + if (!$modx->hasPermission('new_chunk')) { |
|
14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | + } |
|
16 | + break; |
|
17 | + default: |
|
14 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | - } |
|
16 | - break; |
|
17 | - default: |
|
18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -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 | |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | // Get table names (alphabetical) |
24 | 24 | $tbl_site_htmlsnippets = $modx->getDatabase()->getFullTableName('site_htmlsnippets'); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $content['name'] = $_REQUEST['itemname']; |
48 | 48 | } else { |
49 | 49 | $_SESSION['itemname'] = $_lang["new_htmlsnippet"]; |
50 | - $content['category'] = (int)$_REQUEST['catid']; |
|
50 | + $content['category'] = (int) $_REQUEST['catid']; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | if ($modx->getManagerApi()->hasFormValues()) { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | // Add lock-element JS-Script |
66 | 66 | $lockElementId = $id; |
67 | 67 | $lockElementType = 3; |
68 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
68 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
69 | 69 | |
70 | 70 | // Print RTE Javascript function |
71 | 71 | ?> |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | <input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>" /> |
137 | 137 | |
138 | 138 | <h1> |
139 | - <i class="fa fa-th-large"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_htmlsnippet']) ?><i class="fa fa-question-circle help"></i> |
|
139 | + <i class="fa fa-th-large"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_htmlsnippet']) ?><i class="fa fa-question-circle help"></i> |
|
140 | 140 | </h1> |
141 | 141 | |
142 | 142 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | <div class="form-control-name clearfix"> |
161 | 161 | <input name="name" type="text" maxlength="100" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
162 | 162 | <?php if ($modx->hasPermission('save_role')): ?> |
163 | - <label class="custom-control" title="<?= $_lang['lock_htmlsnippet'] . "\n" . $_lang['lock_htmlsnippet_msg'] ?>" tooltip> |
|
163 | + <label class="custom-control" title="<?= $_lang['lock_htmlsnippet']."\n".$_lang['lock_htmlsnippet_msg'] ?>" tooltip> |
|
164 | 164 | <input name="locked" type="checkbox" value="on"<?= ($content['locked'] == 1 || $content['locked'] == 'on' ? ' checked="checked"' : '') ?> /> |
165 | 165 | <i class="fa fa-lock"></i> |
166 | 166 | </label> |
@@ -184,9 +184,9 @@ discard block |
||
184 | 184 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
185 | 185 | <option> </option> |
186 | 186 | <?php |
187 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
187 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
188 | 188 | foreach (getCategories() as $n => $v) { |
189 | - echo "\t\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] || (empty($content['category']) && $_POST['categoryid'] == $v['id']) ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n"; |
|
189 | + echo "\t\t\t\t".'<option value="'.$v['id'].'"'.($content['category'] == $v['id'] || (empty($content['category']) && $_POST['categoryid'] == $v['id']) ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($v['category'])."</option>\n"; |
|
190 | 190 | } |
191 | 191 | ?> |
192 | 192 | </select> |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | </div> |
201 | 201 | <?php if ($_SESSION['mgrRole'] == 1): ?> |
202 | 202 | <div class="form-row"> |
203 | - <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>" . $_lang['disabled'] . "</span>" : $_lang['disabled']) ?></label> |
|
203 | + <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>".$_lang['disabled']."</span>" : $_lang['disabled']) ?></label> |
|
204 | 204 | </div> |
205 | 205 | <?php endif; ?> |
206 | 206 | </div> |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $evtOut = $modx->invokeEvent('OnRichTextEditorRegister'); |
217 | 217 | if (is_array($evtOut)) { |
218 | 218 | foreach ($evtOut as $i => $editor) { |
219 | - echo "\t" . '<option value="' . $editor . '"' . ($which_editor == $editor ? ' selected="selected"' : '') . '>' . $editor . "</option>\n"; |
|
219 | + echo "\t".'<option value="'.$editor.'"'.($which_editor == $editor ? ' selected="selected"' : '').'>'.$editor."</option>\n"; |
|
220 | 220 | } |
221 | 221 | } |
222 | 222 | ?> |
@@ -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->getDatabase()->escape(trim($_POST['name'])); |
11 | 11 | $description = $modx->getDatabase()->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); |
@@ -10,9 +10,13 @@ |
||
10 | 10 | $userid = $_REQUEST['user']; |
11 | 11 | $groupid = $_REQUEST['group']; |
12 | 12 | $subject = $modx->getDatabase()->escape($_REQUEST['messagesubject']); |
13 | -if($subject=="") $subject="(no subject)"; |
|
13 | +if($subject=="") { |
|
14 | + $subject="(no subject)"; |
|
15 | +} |
|
14 | 16 | $message = $modx->getDatabase()->escape($_REQUEST['messagebody']); |
15 | -if($message=="") $message="(no message)"; |
|
17 | +if($message=="") { |
|
18 | + $message="(no message)"; |
|
19 | +} |
|
16 | 20 | $postdate = time(); |
17 | 21 | |
18 | 22 | if($sendto=='u') { |
@@ -3,7 +3,7 @@ discard block |
||
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 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | $sendto = $_REQUEST['sendto']; |
@@ -16,55 +16,55 @@ discard block |
||
16 | 16 | $postdate = time(); |
17 | 17 | |
18 | 18 | if($sendto=='u') { |
19 | - if($userid==0) { |
|
20 | - $modx->webAlertAndQuit($_lang["error_no_user_selected"]); |
|
21 | - } |
|
22 | - $modx->getDatabase()->insert( |
|
23 | - array( |
|
24 | - 'recipient' => $userid, |
|
25 | - 'sender' => $modx->getLoginUserID(), |
|
26 | - 'subject' => $subject, |
|
27 | - 'message' => $message, |
|
28 | - 'postdate' => $postdate, |
|
29 | - 'type' => 'Message', |
|
30 | - 'private' => 1, |
|
31 | - ), $modx->getDatabase()->getFullTableName('user_messages')); |
|
19 | + if($userid==0) { |
|
20 | + $modx->webAlertAndQuit($_lang["error_no_user_selected"]); |
|
21 | + } |
|
22 | + $modx->getDatabase()->insert( |
|
23 | + array( |
|
24 | + 'recipient' => $userid, |
|
25 | + 'sender' => $modx->getLoginUserID(), |
|
26 | + 'subject' => $subject, |
|
27 | + 'message' => $message, |
|
28 | + 'postdate' => $postdate, |
|
29 | + 'type' => 'Message', |
|
30 | + 'private' => 1, |
|
31 | + ), $modx->getDatabase()->getFullTableName('user_messages')); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | if($sendto=='g') { |
35 | - if($groupid==0) { |
|
36 | - $modx->webAlertAndQuit($_lang["error_no_group_selected"]); |
|
37 | - } |
|
38 | - $rs = $modx->getDatabase()->select('internalKey', $modx->getDatabase()->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
39 | - while ($row=$modx->getDatabase()->getRow($rs)) { |
|
40 | - $modx->getDatabase()->insert( |
|
41 | - array( |
|
42 | - 'recipient' => $row['internalKey'], |
|
43 | - 'sender' => $modx->getLoginUserID(), |
|
44 | - 'subject' => $subject, |
|
45 | - 'message' => $message, |
|
46 | - 'postdate' => $postdate, |
|
47 | - 'type' => 'Message', |
|
48 | - 'private' => 0, |
|
49 | - ), $modx->getDatabase()->getFullTableName('user_messages')); |
|
50 | - } |
|
35 | + if($groupid==0) { |
|
36 | + $modx->webAlertAndQuit($_lang["error_no_group_selected"]); |
|
37 | + } |
|
38 | + $rs = $modx->getDatabase()->select('internalKey', $modx->getDatabase()->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
39 | + while ($row=$modx->getDatabase()->getRow($rs)) { |
|
40 | + $modx->getDatabase()->insert( |
|
41 | + array( |
|
42 | + 'recipient' => $row['internalKey'], |
|
43 | + 'sender' => $modx->getLoginUserID(), |
|
44 | + 'subject' => $subject, |
|
45 | + 'message' => $message, |
|
46 | + 'postdate' => $postdate, |
|
47 | + 'type' => 'Message', |
|
48 | + 'private' => 0, |
|
49 | + ), $modx->getDatabase()->getFullTableName('user_messages')); |
|
50 | + } |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | 54 | if($sendto=='a') { |
55 | - $rs = $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); |
|
56 | - while ($row=$modx->getDatabase()->getRow($rs)) { |
|
57 | - $modx->getDatabase()->insert( |
|
58 | - array( |
|
59 | - 'recipient' => $row['id'], |
|
60 | - 'sender' => $modx->getLoginUserID(), |
|
61 | - 'subject' => $subject, |
|
62 | - 'message' => $message, |
|
63 | - 'postdate' => $postdate, |
|
64 | - 'type' => 'Message', |
|
65 | - 'private' => 0, |
|
66 | - ), $modx->getDatabase()->getFullTableName('user_messages')); |
|
67 | - } |
|
55 | + $rs = $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); |
|
56 | + while ($row=$modx->getDatabase()->getRow($rs)) { |
|
57 | + $modx->getDatabase()->insert( |
|
58 | + array( |
|
59 | + 'recipient' => $row['id'], |
|
60 | + 'sender' => $modx->getLoginUserID(), |
|
61 | + 'subject' => $subject, |
|
62 | + 'message' => $message, |
|
63 | + 'postdate' => $postdate, |
|
64 | + 'type' => 'Message', |
|
65 | + 'private' => 0, |
|
66 | + ), $modx->getDatabase()->getFullTableName('user_messages')); |
|
67 | + } |
|
68 | 68 | } |
69 | 69 | |
70 | 70 | $header = "Location: index.php?a=10"; |
@@ -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('messages')) { |
|
5 | +if (!$modx->hasPermission('messages')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -10,13 +10,13 @@ discard block |
||
10 | 10 | $userid = $_REQUEST['user']; |
11 | 11 | $groupid = $_REQUEST['group']; |
12 | 12 | $subject = $modx->getDatabase()->escape($_REQUEST['messagesubject']); |
13 | -if($subject=="") $subject="(no subject)"; |
|
13 | +if ($subject == "") $subject = "(no subject)"; |
|
14 | 14 | $message = $modx->getDatabase()->escape($_REQUEST['messagebody']); |
15 | -if($message=="") $message="(no message)"; |
|
15 | +if ($message == "") $message = "(no message)"; |
|
16 | 16 | $postdate = time(); |
17 | 17 | |
18 | -if($sendto=='u') { |
|
19 | - if($userid==0) { |
|
18 | +if ($sendto == 'u') { |
|
19 | + if ($userid == 0) { |
|
20 | 20 | $modx->webAlertAndQuit($_lang["error_no_user_selected"]); |
21 | 21 | } |
22 | 22 | $modx->getDatabase()->insert( |
@@ -31,12 +31,12 @@ discard block |
||
31 | 31 | ), $modx->getDatabase()->getFullTableName('user_messages')); |
32 | 32 | } |
33 | 33 | |
34 | -if($sendto=='g') { |
|
35 | - if($groupid==0) { |
|
34 | +if ($sendto == 'g') { |
|
35 | + if ($groupid == 0) { |
|
36 | 36 | $modx->webAlertAndQuit($_lang["error_no_group_selected"]); |
37 | 37 | } |
38 | 38 | $rs = $modx->getDatabase()->select('internalKey', $modx->getDatabase()->getFullTableName('user_attributes'), "role='{$groupid}' AND internalKey!='".$modx->getLoginUserID()."'"); |
39 | - while ($row=$modx->getDatabase()->getRow($rs)) { |
|
39 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
40 | 40 | $modx->getDatabase()->insert( |
41 | 41 | array( |
42 | 42 | 'recipient' => $row['internalKey'], |
@@ -51,9 +51,9 @@ discard block |
||
51 | 51 | } |
52 | 52 | |
53 | 53 | |
54 | -if($sendto=='a') { |
|
54 | +if ($sendto == 'a') { |
|
55 | 55 | $rs = $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('manager_users'), "id!='".$modx->getLoginUserID()."'"); |
56 | - while ($row=$modx->getDatabase()->getRow($rs)) { |
|
56 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
57 | 57 | $modx->getDatabase()->insert( |
58 | 58 | array( |
59 | 59 | 'recipient' => $row['id'], |