@@ -1,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE != "true") { |
|
2 | +if (IN_MANAGER_MODE != "true") { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | -if(isset($_REQUEST['id'])) { |
|
6 | +if (isset($_REQUEST['id'])) { |
|
7 | 7 | $id = (int) $_REQUEST['id']; |
8 | 8 | } else { |
9 | 9 | $id = 0; |
10 | 10 | } |
11 | 11 | |
12 | -if(isset($_GET['opened'])) { |
|
12 | +if (isset($_GET['opened'])) { |
|
13 | 13 | $_SESSION['openedArray'] = $_GET['opened']; |
14 | 14 | } |
15 | 15 | |
@@ -22,16 +22,16 @@ discard block |
||
22 | 22 | $tbl_site_templates = $modx->getFullTableName('site_templates'); |
23 | 23 | |
24 | 24 | // Get access permissions |
25 | -if($_SESSION['mgrDocgroups']) { |
|
25 | +if ($_SESSION['mgrDocgroups']) { |
|
26 | 26 | $docgrp = implode(",", $_SESSION['mgrDocgroups']); |
27 | 27 | } |
28 | -$access = "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0" . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
28 | +$access = "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0".(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
29 | 29 | |
30 | 30 | // |
31 | -if($_SESSION['tree_show_only_folders']) { |
|
32 | - $parent = $id ? ($modx->db->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0; |
|
33 | - $isfolder = $modx->db->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1"); |
|
34 | - if(!$isfolder && $parent != 0) { |
|
31 | +if ($_SESSION['tree_show_only_folders']) { |
|
32 | + $parent = $id ? ($modx->db->getValue("SELECT parent FROM ".$tbl_site_content." WHERE id=$id LIMIT 1")) : 0; |
|
33 | + $isfolder = $modx->db->getValue("SELECT isfolder FROM ".$tbl_site_content." WHERE id=$id LIMIT 1"); |
|
34 | + if (!$isfolder && $parent != 0) { |
|
35 | 35 | $id = $_REQUEST['id'] = $parent; |
36 | 36 | } |
37 | 37 | } |
@@ -40,7 +40,7 @@ discard block |
||
40 | 40 | $rs = $modx->db->select('DISTINCT sc.*', "{$tbl_site_content} AS sc |
41 | 41 | LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.id ='{$id}' AND ({$access})"); |
42 | 42 | $content = $modx->db->getRow($rs); |
43 | -if(!$content) { |
|
43 | +if (!$content) { |
|
44 | 44 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
45 | 45 | } |
46 | 46 | |
@@ -84,11 +84,11 @@ discard block |
||
84 | 84 | ); |
85 | 85 | $filter_sort = ''; |
86 | 86 | $filter_dir = ''; |
87 | -if($numRecords > 0) { |
|
88 | - $filter_sort = '<select size="1" name="sort" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&dir=' . $dir . '&sort=\'+this.options[this.selectedIndex].value">' . '<option value="createdon"' . (($sort == 'createdon') ? ' selected' : '') . '>' . $_lang['createdon'] . '</option>' . '<option value="pub_date"' . (($sort == 'pub_date') ? ' selected' : '') . '>' . $_lang["page_data_publishdate"] . '</option>' . '<option value="pagetitle"' . (($sort == 'pagetitle') ? ' selected' : '') . '>' . $_lang['pagetitle'] . '</option>' . '<option value="menuindex"' . (($sort == 'menuindex') ? ' selected' : '') . '>' . $_lang['resource_opt_menu_index'] . '</option>' . //******** resource_opt_is_published - // |
|
89 | - '<option value="published"' . (($sort == 'published') ? ' selected' : '') . '>' . $_lang['resource_opt_is_published'] . '</option>' . //********// |
|
87 | +if ($numRecords > 0) { |
|
88 | + $filter_sort = '<select size="1" name="sort" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id='.$id.'&dir='.$dir.'&sort=\'+this.options[this.selectedIndex].value">'.'<option value="createdon"'.(($sort == 'createdon') ? ' selected' : '').'>'.$_lang['createdon'].'</option>'.'<option value="pub_date"'.(($sort == 'pub_date') ? ' selected' : '').'>'.$_lang["page_data_publishdate"].'</option>'.'<option value="pagetitle"'.(($sort == 'pagetitle') ? ' selected' : '').'>'.$_lang['pagetitle'].'</option>'.'<option value="menuindex"'.(($sort == 'menuindex') ? ' selected' : '').'>'.$_lang['resource_opt_menu_index'].'</option>'.//******** resource_opt_is_published - // |
|
89 | + '<option value="published"'.(($sort == 'published') ? ' selected' : '').'>'.$_lang['resource_opt_is_published'].'</option>'.//********// |
|
90 | 90 | '</select>'; |
91 | - $filter_dir = '<select size="1" name="dir" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&sort=' . $sort . '&dir=\'+this.options[this.selectedIndex].value">' . '<option value="DESC"' . (($dir == 'DESC') ? ' selected' : '') . '>' . $_lang['sort_desc'] . '</option>' . '<option value="ASC"' . (($dir == 'ASC') ? ' selected' : '') . '>' . $_lang['sort_asc'] . '</option>' . '</select>'; |
|
91 | + $filter_dir = '<select size="1" name="dir" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id='.$id.'&sort='.$sort.'&dir=\'+this.options[this.selectedIndex].value">'.'<option value="DESC"'.(($dir == 'DESC') ? ' selected' : '').'>'.$_lang['sort_desc'].'</option>'.'<option value="ASC"'.(($dir == 'ASC') ? ' selected' : '').'>'.$_lang['sort_asc'].'</option>'.'</select>'; |
|
92 | 92 | $resource = $modx->db->makeArray($rs); |
93 | 93 | |
94 | 94 | // CSS style for table |
@@ -132,10 +132,10 @@ discard block |
||
132 | 132 | ); |
133 | 133 | $modx->table->setColumnWidths($tbWidth); |
134 | 134 | |
135 | - $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; |
|
136 | - $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; |
|
137 | - $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; |
|
138 | - $add_path = $sd . $sb . $pg; |
|
135 | + $sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC'; |
|
136 | + $sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon'; |
|
137 | + $pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : ''; |
|
138 | + $add_path = $sd.$sb.$pg; |
|
139 | 139 | |
140 | 140 | $icons = array( |
141 | 141 | 'text/html' => $_style['tree_page_html'], |
@@ -153,9 +153,9 @@ discard block |
||
153 | 153 | ); |
154 | 154 | |
155 | 155 | $listDocs = array(); |
156 | - foreach($resource as $k => $children) { |
|
156 | + foreach ($resource as $k => $children) { |
|
157 | 157 | |
158 | - switch($children['id']) { |
|
158 | + switch ($children['id']) { |
|
159 | 159 | case $modx->config['site_start'] : |
160 | 160 | $icon = $_style['tree_page_home']; |
161 | 161 | break; |
@@ -169,10 +169,10 @@ discard block |
||
169 | 169 | $icon = $_style['tree_page_info']; |
170 | 170 | break; |
171 | 171 | default: |
172 | - if($children['isfolder']) { |
|
172 | + if ($children['isfolder']) { |
|
173 | 173 | $icon = $_style['tree_folder_new']; |
174 | 174 | } else { |
175 | - if(isset($icons[$children['contentType']])) { |
|
175 | + if (isset($icons[$children['contentType']])) { |
|
176 | 176 | $icon = $icons[$children['contentType']]; |
177 | 177 | } else { |
178 | 178 | $icon = $_style['tree_page']; |
@@ -187,32 +187,32 @@ discard block |
||
187 | 187 | $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish')); |
188 | 188 | //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary'); |
189 | 189 | //$class .= ($children['isfolder'] ? ' font-weight-bold' : ''); |
190 | - if($modx->hasPermission('edit_document')) { |
|
191 | - $title = '<span class="doc-item' . $private . '">' . $icon . '<a href="index.php?a=27&id=' . $children['id'] . $add_path . '">' . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></a></span>'; |
|
190 | + if ($modx->hasPermission('edit_document')) { |
|
191 | + $title = '<span class="doc-item'.$private.'">'.$icon.'<a href="index.php?a=27&id='.$children['id'].$add_path.'">'.'<span class="'.$class.'">'.$children['pagetitle'].'</span></a></span>'; |
|
192 | 192 | } else { |
193 | - $title = '<span class="doc-item' . $private . '">' . $icon . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></span>'; |
|
193 | + $title = '<span class="doc-item'.$private.'">'.$icon.'<span class="'.$class.'">'.$children['pagetitle'].'</span></span>'; |
|
194 | 194 | } |
195 | 195 | |
196 | - $icon_pub_unpub = (!$children['published']) ? '<a href="index.php?a=61&id=' . $children['id'] . $add_path . '" title="' . $_lang["publish_resource"] . '"><i class="' . $_style["icons_publish_document"] . '"></i></a>' : '<a href="index.php?a=62&id=' . $children['id'] . $add_path . '" title="' . $_lang["unpublish_resource"] . '"><i class="' . $_style["icons_unpublish_resource"] . '" ></i></a>'; |
|
196 | + $icon_pub_unpub = (!$children['published']) ? '<a href="index.php?a=61&id='.$children['id'].$add_path.'" title="'.$_lang["publish_resource"].'"><i class="'.$_style["icons_publish_document"].'"></i></a>' : '<a href="index.php?a=62&id='.$children['id'].$add_path.'" title="'.$_lang["unpublish_resource"].'"><i class="'.$_style["icons_unpublish_resource"].'" ></i></a>'; |
|
197 | 197 | |
198 | - $icon_del_undel = (!$children['deleted']) ? '<a onclick="return confirm(\'' . $_lang["confirm_delete_resource"] . '\')" href="index.php?a=6&id=' . $children['id'] . $add_path . '" title="' . $_lang['delete_resource'] . '"><i class="' . $_style["icons_delete_resource"] . '"></i></a>' : '<a onclick="return confirm(\'' . $_lang["confirm_undelete"] . '\')" href="index.php?a=63&id=' . $children['id'] . $add_path . '" title="' . $_lang['undelete_resource'] . '"><i class="' . $_style["icons_undelete_resource"] . '"></i></a>'; |
|
198 | + $icon_del_undel = (!$children['deleted']) ? '<a onclick="return confirm(\''.$_lang["confirm_delete_resource"].'\')" href="index.php?a=6&id='.$children['id'].$add_path.'" title="'.$_lang['delete_resource'].'"><i class="'.$_style["icons_delete_resource"].'"></i></a>' : '<a onclick="return confirm(\''.$_lang["confirm_undelete"].'\')" href="index.php?a=63&id='.$children['id'].$add_path.'" title="'.$_lang['undelete_resource'].'"><i class="'.$_style["icons_undelete_resource"].'"></i></a>'; |
|
199 | 199 | |
200 | 200 | $listDocs[] = array( |
201 | - 'docid' => '<div class="text-right">' . $children['id'] . '</div>', |
|
201 | + 'docid' => '<div class="text-right">'.$children['id'].'</div>', |
|
202 | 202 | 'title' => $title, |
203 | - 'createdon' => '<div class="text-right">' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '</div>', |
|
204 | - 'pub_date' => '<div class="text-right">' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '</div>', |
|
205 | - 'status' => '<div class="text-nowrap">' . ($children['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publishedDoc">' . $_lang['page_data_published'] . '</span>') . '</div>', |
|
206 | - 'edit' => '<div class="actions text-center text-nowrap">' . ($modx->hasPermission('edit_document') ? '<a href="index.php?a=27&id=' . $children['id'] . $add_path . '" title="' . $_lang['edit'] . '"><i class="' . $_style["icons_edit_resource"] . '"></i></a><a href="index.php?a=51&id=' . $children['id'] . $add_path . '" title="' . $_lang['move'] . '"><i |
|
207 | - class="' . $_style["icons_move_document"] . '"></i></a>' . $icon_pub_unpub : '') . ($modx->hasPermission('delete_document') ? $icon_del_undel : '') . '</div>' |
|
203 | + 'createdon' => '<div class="text-right">'.($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')).'</div>', |
|
204 | + 'pub_date' => '<div class="text-right">'.($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '').'</div>', |
|
205 | + 'status' => '<div class="text-nowrap">'.($children['published'] == 0 ? '<span class="unpublishedDoc">'.$_lang['page_data_unpublished'].'</span>' : '<span class="publishedDoc">'.$_lang['page_data_published'].'</span>').'</div>', |
|
206 | + 'edit' => '<div class="actions text-center text-nowrap">'.($modx->hasPermission('edit_document') ? '<a href="index.php?a=27&id='.$children['id'].$add_path.'" title="'.$_lang['edit'].'"><i class="'.$_style["icons_edit_resource"].'"></i></a><a href="index.php?a=51&id='.$children['id'].$add_path.'" title="'.$_lang['move'].'"><i |
|
207 | + class="' . $_style["icons_move_document"].'"></i></a>'.$icon_pub_unpub : '').($modx->hasPermission('delete_document') ? $icon_del_undel : '').'</div>' |
|
208 | 208 | ); |
209 | 209 | } |
210 | 210 | |
211 | - $modx->table->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); |
|
212 | - $children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); |
|
211 | + $modx->table->createPagingNavigation($numRecords, 'a=3&id='.$content['id'].'&dir='.$dir.'&sort='.$sort); |
|
212 | + $children_output = $modx->table->create($listDocs, $listTableHeader, 'index.php?a=3&id='.$content['id']); |
|
213 | 213 | } else { |
214 | 214 | // No Child documents |
215 | - $children_output = '<div class="container"><p>' . $_lang['resources_in_container_no'] . '</p></div>'; |
|
215 | + $children_output = '<div class="container"><p>'.$_lang['resources_in_container_no'].'</p></div>'; |
|
216 | 216 | } |
217 | 217 | ?> |
218 | 218 | <script type="text/javascript"> |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | }, |
239 | 239 | cancel: function() { |
240 | 240 | documentDirty = false; |
241 | - document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id=' . $id . $add_path) ?>'; |
|
241 | + document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id='.$id.$add_path) ?>'; |
|
242 | 242 | }, |
243 | 243 | move: function() { |
244 | 244 | document.location.href = "index.php?id=<?= $_REQUEST['id'] ?>&a=51"; |
@@ -249,7 +249,7 @@ discard block |
||
249 | 249 | } |
250 | 250 | }, |
251 | 251 | view: function() { |
252 | - window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'] . 'index.php?id=' . $id ?>', 'previeWin'); |
|
252 | + window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'].'index.php?id='.$id ?>', 'previeWin'); |
|
253 | 253 | } |
254 | 254 | }; |
255 | 255 | |
@@ -257,7 +257,7 @@ discard block |
||
257 | 257 | <script type="text/javascript" src="media/script/tablesort.js"></script> |
258 | 258 | |
259 | 259 | <h1> |
260 | - <i class="fa fa-info"></i><?= iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . ' <small>(' . $_REQUEST['id'] . ')</small>' ?> |
|
260 | + <i class="fa fa-info"></i><?= iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']).(iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '').' <small>('.$_REQUEST['id'].')</small>' ?> |
|
261 | 261 | </h1> |
262 | 262 | |
263 | 263 | <?= $_style['actionbuttons']['static']['document'] ?> |
@@ -284,16 +284,16 @@ discard block |
||
284 | 284 | <tr> |
285 | 285 | <td width="200" valign="top"><?= $_lang['long_title'] ?>:</td> |
286 | 286 | <td> |
287 | - <small><?= $content['longtitle'] != '' ? $content['longtitle'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></small> |
|
287 | + <small><?= $content['longtitle'] != '' ? $content['longtitle'] : "(<i>".$_lang['not_set']."</i>)" ?></small> |
|
288 | 288 | </td> |
289 | 289 | </tr> |
290 | 290 | <tr> |
291 | 291 | <td valign="top"><?= $_lang['resource_description'] ?>:</td> |
292 | - <td><?= $content['description'] != '' ? $content['description'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></td> |
|
292 | + <td><?= $content['description'] != '' ? $content['description'] : "(<i>".$_lang['not_set']."</i>)" ?></td> |
|
293 | 293 | </tr> |
294 | 294 | <tr> |
295 | 295 | <td valign="top"><?= $_lang['resource_summary'] ?>:</td> |
296 | - <td><?= $content['introtext'] != '' ? $content['introtext'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></td> |
|
296 | + <td><?= $content['introtext'] != '' ? $content['introtext'] : "(<i>".$_lang['not_set']."</i>)" ?></td> |
|
297 | 297 | </tr> |
298 | 298 | <tr> |
299 | 299 | <td valign="top"><?= $_lang['type'] ?>:</td> |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | </tr> |
302 | 302 | <tr> |
303 | 303 | <td valign="top"><?= $_lang['resource_alias'] ?>:</td> |
304 | - <td><?= $content['alias'] != '' ? $content['alias'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></td> |
|
304 | + <td><?= $content['alias'] != '' ? $content['alias'] : "(<i>".$_lang['not_set']."</i>)" ?></td> |
|
305 | 305 | </tr> |
306 | 306 | <tr> |
307 | 307 | <td colspan="2"> </td> |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | <td><?= $modx->toDateFormat($content['createdon'] + $server_offset_time) ?> (<b><?= $createdbyname ?></b>) |
315 | 315 | </td> |
316 | 316 | </tr> |
317 | - <?php if($editedbyname != '') { ?> |
|
317 | + <?php if ($editedbyname != '') { ?> |
|
318 | 318 | <tr> |
319 | 319 | <td><?= $_lang['page_data_edited'] ?>:</td> |
320 | 320 | <td><?= $modx->toDateFormat($content['editedon'] + $server_offset_time) ?> (<b><?= $editedbyname ?></b>) |
@@ -329,15 +329,15 @@ discard block |
||
329 | 329 | </tr> |
330 | 330 | <tr> |
331 | 331 | <td><?= $_lang['page_data_status'] ?>:</td> |
332 | - <td><?= $content['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publisheddoc">' . $_lang['page_data_published'] . '</span>' ?></td> |
|
332 | + <td><?= $content['published'] == 0 ? '<span class="unpublishedDoc">'.$_lang['page_data_unpublished'].'</span>' : '<span class="publisheddoc">'.$_lang['page_data_published'].'</span>' ?></td> |
|
333 | 333 | </tr> |
334 | 334 | <tr> |
335 | 335 | <td><?= $_lang['page_data_publishdate'] ?>:</td> |
336 | - <td><?= $content['pub_date'] == 0 ? "(<i>" . $_lang['not_set'] . "</i>)" : $modx->toDateFormat($content['pub_date']) ?></td> |
|
336 | + <td><?= $content['pub_date'] == 0 ? "(<i>".$_lang['not_set']."</i>)" : $modx->toDateFormat($content['pub_date']) ?></td> |
|
337 | 337 | </tr> |
338 | 338 | <tr> |
339 | 339 | <td><?= $_lang['page_data_unpublishdate'] ?>:</td> |
340 | - <td><?= $content['unpub_date'] == 0 ? "(<i>" . $_lang['not_set'] . "</i>)" : $modx->toDateFormat($content['unpub_date']) ?></td> |
|
340 | + <td><?= $content['unpub_date'] == 0 ? "(<i>".$_lang['not_set']."</i>)" : $modx->toDateFormat($content['unpub_date']) ?></td> |
|
341 | 341 | </tr> |
342 | 342 | <tr> |
343 | 343 | <td><?= $_lang['page_data_cacheable'] ?>:</td> |
@@ -357,11 +357,11 @@ discard block |
||
357 | 357 | </tr> |
358 | 358 | <tr> |
359 | 359 | <td><?= $_lang['page_data_web_access'] ?>:</td> |
360 | - <td><?= $content['privateweb'] == 0 ? $_lang['public'] : '<b style="color: #821517">' . $_lang['private'] . '</b> ' . $_style["icons_secured"] ?></td> |
|
360 | + <td><?= $content['privateweb'] == 0 ? $_lang['public'] : '<b style="color: #821517">'.$_lang['private'].'</b> '.$_style["icons_secured"] ?></td> |
|
361 | 361 | </tr> |
362 | 362 | <tr> |
363 | 363 | <td><?= $_lang['page_data_mgr_access'] ?>:</td> |
364 | - <td><?= $content['privatemgr'] == 0 ? $_lang['public'] : '<b style="color: #821517">' . $_lang['private'] . '</b> ' . $_style["icons_secured"] ?></td> |
|
364 | + <td><?= $content['privatemgr'] == 0 ? $_lang['public'] : '<b style="color: #821517">'.$_lang['private'].'</b> '.$_style["icons_secured"] ?></td> |
|
365 | 365 | </tr> |
366 | 366 | <tr> |
367 | 367 | <td colspan="2"> </td> |
@@ -391,13 +391,13 @@ discard block |
||
391 | 391 | <script type="text/javascript">docSettings.addTabPage(document.getElementById("tabChildren"));</script> |
392 | 392 | <div class="container container-body"> |
393 | 393 | <div class="form-group clearfix"> |
394 | - <?php if($numRecords > 0) : ?> |
|
394 | + <?php if ($numRecords > 0) : ?> |
|
395 | 395 | <div class="float-xs-left"> |
396 | - <span class="publishedDoc"><?= $numRecords . ' ' . $_lang['resources_in_container'] ?> (<strong><?= $content['pagetitle'] ?></strong>)</span> |
|
396 | + <span class="publishedDoc"><?= $numRecords.' '.$_lang['resources_in_container'] ?> (<strong><?= $content['pagetitle'] ?></strong>)</span> |
|
397 | 397 | </div> |
398 | 398 | <?php endif; ?> |
399 | 399 | <div class="float-xs-right"> |
400 | - <?= $filter_sort . ' ' . $filter_dir ?> |
|
400 | + <?= $filter_sort.' '.$filter_dir ?> |
|
401 | 401 | </div> |
402 | 402 | |
403 | 403 | </div> |
@@ -407,23 +407,23 @@ discard block |
||
407 | 407 | </div> |
408 | 408 | </div><!-- end tab-page --> |
409 | 409 | |
410 | - <?php if($modx->config['cache_type'] != 2) { ?> |
|
410 | + <?php if ($modx->config['cache_type'] != 2) { ?> |
|
411 | 411 | <!-- Page Source --> |
412 | 412 | <div class="tab-page" id="tabSource"> |
413 | 413 | <h2 class="tab"><?= $_lang['page_data_source'] ?></h2> |
414 | 414 | <script type="text/javascript">docSettings.addTabPage(document.getElementById("tabSource"));</script> |
415 | 415 | <?php |
416 | 416 | $buffer = ""; |
417 | - $filename = $modx->config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php"; |
|
417 | + $filename = $modx->config['base_path']."assets/cache/docid_".$id.".pageCache.php"; |
|
418 | 418 | $handle = @fopen($filename, "r"); |
419 | - if(!$handle) { |
|
420 | - $buffer = '<div class="container container-body">' . $_lang['page_data_notcached'] . '</div>'; |
|
419 | + if (!$handle) { |
|
420 | + $buffer = '<div class="container container-body">'.$_lang['page_data_notcached'].'</div>'; |
|
421 | 421 | } else { |
422 | - while(!feof($handle)) { |
|
422 | + while (!feof($handle)) { |
|
423 | 423 | $buffer .= fgets($handle, 4096); |
424 | 424 | } |
425 | 425 | fclose($handle); |
426 | - $buffer = '<div class="navbar navbar-editor">' . $_lang['page_data_cached'] . '</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">' . $modx->htmlspecialchars($buffer) . "</textarea></div>\n"; |
|
426 | + $buffer = '<div class="navbar navbar-editor">'.$_lang['page_data_cached'].'</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">'.$modx->htmlspecialchars($buffer)."</textarea></div>\n"; |
|
427 | 427 | } |
428 | 428 | echo $buffer; |
429 | 429 | ?> |
@@ -433,12 +433,12 @@ discard block |
||
433 | 433 | </div><!-- end documentPane --> |
434 | 434 | |
435 | 435 | <?php |
436 | -if(isset($_GET['tab']) && is_numeric($_GET['tab'])) { |
|
437 | - echo '<script type="text/javascript"> docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
436 | +if (isset($_GET['tab']) && is_numeric($_GET['tab'])) { |
|
437 | + echo '<script type="text/javascript"> docSettings.setSelectedIndex( '.$_GET['tab'].' );</script>'; |
|
438 | 438 | } |
439 | 439 | ?> |
440 | 440 | |
441 | -<?php if($show_preview == 1) { ?> |
|
441 | +<?php if ($show_preview == 1) { ?> |
|
442 | 442 | <div class="sectionHeader"><?= $_lang['preview'] ?></div> |
443 | 443 | <div class="sectionBody" id="lyr2"> |
444 | 444 | <iframe src="<?= MODX_SITE_URL ?>index.php?id=<?= $id ?>&z=manprev" frameborder="0" border="0" id="previewIframe"></iframe> |
@@ -9,10 +9,10 @@ discard block |
||
9 | 9 | $dbase = trim($dbase, '`'); |
10 | 10 | |
11 | 11 | if (!isset($modx->config['snapshot_path'])) { |
12 | - if (is_dir(MODX_BASE_PATH . 'temp/backup/')) { |
|
13 | - $modx->config['snapshot_path'] = MODX_BASE_PATH . 'temp/backup/'; |
|
12 | + if (is_dir(MODX_BASE_PATH.'temp/backup/')) { |
|
13 | + $modx->config['snapshot_path'] = MODX_BASE_PATH.'temp/backup/'; |
|
14 | 14 | } else { |
15 | - $modx->config['snapshot_path'] = MODX_BASE_PATH . 'assets/backup/'; |
|
15 | + $modx->config['snapshot_path'] = MODX_BASE_PATH.'assets/backup/'; |
|
16 | 16 | } |
17 | 17 | } |
18 | 18 | |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | if ($mode == 'restore1') { |
24 | 24 | if (isset($_POST['textarea']) && !empty($_POST['textarea'])) { |
25 | 25 | $source = trim($_POST['textarea']); |
26 | - $_SESSION['textarea'] = $source . "\n"; |
|
26 | + $_SESSION['textarea'] = $source."\n"; |
|
27 | 27 | } else { |
28 | 28 | $source = file_get_contents($_FILES['sqlfile']['tmp_name']); |
29 | 29 | } |
@@ -31,7 +31,7 @@ discard block |
||
31 | 31 | header('Location: index.php?r=9&a=93'); |
32 | 32 | exit; |
33 | 33 | } elseif ($mode == 'restore2') { |
34 | - $path = $modx->config['snapshot_path'] . $_POST['filename']; |
|
34 | + $path = $modx->config['snapshot_path'].$_POST['filename']; |
|
35 | 35 | if (file_exists($path)) { |
36 | 36 | $source = file_get_contents($path); |
37 | 37 | import_sql($source); |
@@ -77,7 +77,7 @@ discard block |
||
77 | 77 | if (!is_writable(rtrim($modx->config['snapshot_path'], '/'))) { |
78 | 78 | $modx->webAlertAndQuit(parsePlaceholder($_lang["bkmgr_alert_mkdir"], array('snapshot_path' => $modx->config['snapshot_path']))); |
79 | 79 | } |
80 | - $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%'"; |
|
80 | + $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '".$modx->db->escape($modx->db->config['table_prefix'])."%'"; |
|
81 | 81 | $rs = $modx->db->query($sql); |
82 | 82 | $tables = $modx->db->getColumn('Name', $rs); |
83 | 83 | //$today = $modx->toDateFormat(time()); |
@@ -113,18 +113,18 @@ discard block |
||
113 | 113 | $modx->webAlertAndQuit('Unable to Backup Database'); |
114 | 114 | } |
115 | 115 | } else { |
116 | - include_once MODX_MANAGER_PATH . "includes/header.inc.php"; // start normal header |
|
116 | + include_once MODX_MANAGER_PATH."includes/header.inc.php"; // start normal header |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | if (isset($_SESSION['result_msg']) && $_SESSION['result_msg'] != '') { |
120 | 120 | switch ($_SESSION['result_msg']) { |
121 | 121 | case 'import_ok': |
122 | - $ph['result_msg_import'] = '<div class="alert alert-success">' . $_lang["bkmgr_import_ok"] . '</div>'; |
|
123 | - $ph['result_msg_snapshot'] = '<div class="alert alert-success">' . $_lang["bkmgr_import_ok"] . '</div>'; |
|
122 | + $ph['result_msg_import'] = '<div class="alert alert-success">'.$_lang["bkmgr_import_ok"].'</div>'; |
|
123 | + $ph['result_msg_snapshot'] = '<div class="alert alert-success">'.$_lang["bkmgr_import_ok"].'</div>'; |
|
124 | 124 | break; |
125 | 125 | case 'snapshot_ok': |
126 | 126 | $ph['result_msg_import'] = ''; |
127 | - $ph['result_msg_snapshot'] = '<div class="alert alert-success">' . $_lang["bkmgr_snapshot_ok"] . '</div>'; |
|
127 | + $ph['result_msg_snapshot'] = '<div class="alert alert-success">'.$_lang["bkmgr_snapshot_ok"].'</div>'; |
|
128 | 128 | break; |
129 | 129 | } |
130 | 130 | $_SESSION['result_msg'] = ''; |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | f.style.display = 'none'; |
184 | 184 | } |
185 | 185 | } |
186 | - <?= (isset($_REQUEST['r']) ? " doRefresh(" . $_REQUEST['r'] . ");" : "") ?> |
|
186 | + <?= (isset($_REQUEST['r']) ? " doRefresh(".$_REQUEST['r'].");" : "") ?> |
|
187 | 187 | |
188 | 188 | </script> |
189 | 189 | |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | </thead> |
228 | 228 | <tbody> |
229 | 229 | <?php |
230 | - $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '" . $modx->db->escape($modx->db->config['table_prefix']) . "%'"; |
|
230 | + $sql = "SHOW TABLE STATUS FROM `{$dbase}` LIKE '".$modx->db->escape($modx->db->config['table_prefix'])."%'"; |
|
231 | 231 | $rs = $modx->db->query($sql); |
232 | 232 | $i = 0; |
233 | 233 | while ($db_status = $modx->db->getRow($rs)) { |
@@ -237,29 +237,29 @@ discard block |
||
237 | 237 | $table_string = ''; |
238 | 238 | } |
239 | 239 | |
240 | - echo '<tr>' . "\n" . '<td><label class="form-check form-check-label"><input type="checkbox" name="chk[]" class="form-check-input" value="' . $db_status['Name'] . '"' . (strstr($table_string, $db_status['Name']) === false ? '' : ' checked="checked"') . ' /><b class="text-primary">' . $db_status['Name'] . '</b></label></td>' . "\n"; |
|
241 | - echo '<td class="text-xs-center">' . (!empty($db_status['Comment']) ? '<i class="' . $_style['actions_help'] . '" data-tooltip="' . $db_status['Comment'] . '"></i>' : '') . '</td>' . "\n"; |
|
242 | - echo '<td class="text-xs-right">' . $db_status['Rows'] . '</td>' . "\n"; |
|
243 | - echo '<td class="text-xs-right">' . $db_status['Collation'] . '</td>' . "\n"; |
|
240 | + echo '<tr>'."\n".'<td><label class="form-check form-check-label"><input type="checkbox" name="chk[]" class="form-check-input" value="'.$db_status['Name'].'"'.(strstr($table_string, $db_status['Name']) === false ? '' : ' checked="checked"').' /><b class="text-primary">'.$db_status['Name'].'</b></label></td>'."\n"; |
|
241 | + echo '<td class="text-xs-center">'.(!empty($db_status['Comment']) ? '<i class="'.$_style['actions_help'].'" data-tooltip="'.$db_status['Comment'].'"></i>' : '').'</td>'."\n"; |
|
242 | + echo '<td class="text-xs-right">'.$db_status['Rows'].'</td>'."\n"; |
|
243 | + echo '<td class="text-xs-right">'.$db_status['Collation'].'</td>'."\n"; |
|
244 | 244 | |
245 | 245 | // Enable record deletion for certain tables (TRUNCATE TABLE) if they're not already empty |
246 | 246 | $truncateable = array( |
247 | - $modx->db->config['table_prefix'] . 'event_log', |
|
248 | - $modx->db->config['table_prefix'] . 'manager_log', |
|
247 | + $modx->db->config['table_prefix'].'event_log', |
|
248 | + $modx->db->config['table_prefix'].'manager_log', |
|
249 | 249 | ); |
250 | 250 | if ($modx->hasPermission('settings') && in_array($db_status['Name'], $truncateable) && $db_status['Rows'] > 0) { |
251 | - echo '<td class="text-xs-right"><a class="text-danger" href="index.php?a=54&mode=' . $action . '&u=' . $db_status['Name'] . '" title="' . $_lang['truncate_table'] . '">' . $modx->nicesize($db_status['Data_length'] + $db_status['Data_free']) . '</a>' . '</td>' . "\n"; |
|
251 | + echo '<td class="text-xs-right"><a class="text-danger" href="index.php?a=54&mode='.$action.'&u='.$db_status['Name'].'" title="'.$_lang['truncate_table'].'">'.$modx->nicesize($db_status['Data_length'] + $db_status['Data_free']).'</a>'.'</td>'."\n"; |
|
252 | 252 | } else { |
253 | - echo '<td class="text-xs-right">' . $modx->nicesize($db_status['Data_length'] + $db_status['Data_free']) . '</td>' . "\n"; |
|
253 | + echo '<td class="text-xs-right">'.$modx->nicesize($db_status['Data_length'] + $db_status['Data_free']).'</td>'."\n"; |
|
254 | 254 | } |
255 | 255 | |
256 | 256 | if ($modx->hasPermission('settings')) { |
257 | - echo '<td class="text-xs-right">' . ($db_status['Data_free'] > 0 ? '<a class="text-danger" href="index.php?a=54&mode=' . $action . '&t=' . $db_status['Name'] . '" title="' . $_lang['optimize_table'] . '">' . $modx->nicesize($db_status['Data_free']) . '</a>' : '-') . '</td>' . "\n"; |
|
257 | + echo '<td class="text-xs-right">'.($db_status['Data_free'] > 0 ? '<a class="text-danger" href="index.php?a=54&mode='.$action.'&t='.$db_status['Name'].'" title="'.$_lang['optimize_table'].'">'.$modx->nicesize($db_status['Data_free']).'</a>' : '-').'</td>'."\n"; |
|
258 | 258 | } else { |
259 | - echo '<td class="text-xs-right">' . ($db_status['Data_free'] > 0 ? $modx->nicesize($db_status['Data_free']) : '-') . '</td>' . "\n"; |
|
259 | + echo '<td class="text-xs-right">'.($db_status['Data_free'] > 0 ? $modx->nicesize($db_status['Data_free']) : '-').'</td>'."\n"; |
|
260 | 260 | } |
261 | 261 | |
262 | - echo '<td class="text-xs-right">' . $modx->nicesize($db_status['Data_length'] - $db_status['Data_free']) . '</td>' . "\n" . '<td class="text-xs-right">' . $modx->nicesize($db_status['Index_length']) . '</td>' . "\n" . '<td class="text-xs-right">' . $modx->nicesize($db_status['Index_length'] + $db_status['Data_length'] + $db_status['Data_free']) . '</td>' . "\n" . "</tr>"; |
|
262 | + echo '<td class="text-xs-right">'.$modx->nicesize($db_status['Data_length'] - $db_status['Data_free']).'</td>'."\n".'<td class="text-xs-right">'.$modx->nicesize($db_status['Index_length']).'</td>'."\n".'<td class="text-xs-right">'.$modx->nicesize($db_status['Index_length'] + $db_status['Data_length'] + $db_status['Data_free']).'</td>'."\n"."</tr>"; |
|
263 | 263 | |
264 | 264 | $total = $total + $db_status['Index_length'] + $db_status['Data_length']; |
265 | 265 | $totaloverhead = $totaloverhead + $db_status['Data_free']; |
@@ -270,9 +270,9 @@ discard block |
||
270 | 270 | <tr> |
271 | 271 | <td class="text-xs-right"><?= $_lang['database_table_totals'] ?></td> |
272 | 272 | <td colspan="4"> </td> |
273 | - <td class="text-xs-right"><?= $totaloverhead > 0 ? '<b class="text-danger">' . $modx->nicesize($totaloverhead) . '</b><br />(' . number_format($totaloverhead) . ' B)' : '-' ?></td> |
|
273 | + <td class="text-xs-right"><?= $totaloverhead > 0 ? '<b class="text-danger">'.$modx->nicesize($totaloverhead).'</b><br />('.number_format($totaloverhead).' B)' : '-' ?></td> |
|
274 | 274 | <td colspan="2"> </td> |
275 | - <td class="text-xs-right"><?= "<b>" . $modx->nicesize($total) . "</b><br />(" . number_format($total) . " B)" ?></td> |
|
275 | + <td class="text-xs-right"><?= "<b>".$modx->nicesize($total)."</b><br />(".number_format($total)." B)" ?></td> |
|
276 | 276 | </tr> |
277 | 277 | </tfoot> |
278 | 278 | </table> |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | foreach ($last_result['0'] as $k => $v) { |
324 | 324 | $title[] = $k; |
325 | 325 | } |
326 | - $result = '<thead><tr><th>' . implode('</th><th>', $title) . '</th></tr></thead>'; |
|
326 | + $result = '<thead><tr><th>'.implode('</th><th>', $title).'</th></tr></thead>'; |
|
327 | 327 | $result .= '<tbody>'; |
328 | 328 | foreach ($last_result as $row) { |
329 | 329 | $result_value = array(); |
@@ -331,11 +331,11 @@ discard block |
||
331 | 331 | foreach ($row as $k => $v) { |
332 | 332 | $result_value[] = $v; |
333 | 333 | } |
334 | - $result .= '<tr><td>' . implode('</td><td>', $result_value) . '</td></tr>'; |
|
334 | + $result .= '<tr><td>'.implode('</td><td>', $result_value).'</td></tr>'; |
|
335 | 335 | } |
336 | 336 | } |
337 | 337 | $result .= '</tbody>'; |
338 | - $result = '<table class="table data">' . $result . '</table>'; |
|
338 | + $result = '<table class="table data">'.$result.'</table>'; |
|
339 | 339 | } |
340 | 340 | } |
341 | 341 | |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | while ($count < 11) { |
438 | 438 | $line = fgets($file); |
439 | 439 | foreach ($detailFields as $label) { |
440 | - $fileLabel = '# ' . $label; |
|
440 | + $fileLabel = '# '.$label; |
|
441 | 441 | if (strpos($line, $fileLabel) !== false) { |
442 | 442 | $details[$label] = htmlentities(trim(str_replace(array( |
443 | 443 | $fileLabel, |
@@ -450,10 +450,10 @@ discard block |
||
450 | 450 | }; |
451 | 451 | fclose($file); |
452 | 452 | |
453 | - $tooltip = "Generation Time: " . $details["Generation Time"] . "\n"; |
|
454 | - $tooltip .= "Server version: " . $details["Server version"] . "\n"; |
|
455 | - $tooltip .= "PHP Version: " . $details["PHP Version"] . "\n"; |
|
456 | - $tooltip .= "Host: " . $details["Host"] . "\n"; |
|
453 | + $tooltip = "Generation Time: ".$details["Generation Time"]."\n"; |
|
454 | + $tooltip .= "Server version: ".$details["Server version"]."\n"; |
|
455 | + $tooltip .= "PHP Version: ".$details["PHP Version"]."\n"; |
|
456 | + $tooltip .= "Host: ".$details["Host"]."\n"; |
|
457 | 457 | ?> |
458 | 458 | <tr> |
459 | 459 | <td><?= $filename ?></td> |
@@ -485,7 +485,7 @@ discard block |
||
485 | 485 | <?php |
486 | 486 | |
487 | 487 | if (is_numeric($_GET['tab'])) { |
488 | - echo '<script type="text/javascript">tpDBM.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
488 | + echo '<script type="text/javascript">tpDBM.setSelectedIndex( '.$_GET['tab'].' );</script>'; |
|
489 | 489 | } |
490 | 490 | |
491 | 491 | include_once "footer.inc.php"; // send footer |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | |
539 | 539 | // Set line feed |
540 | 540 | $lf = "\n"; |
541 | - $tempfile_path = $modx->config['base_path'] . 'assets/backup/temp.php'; |
|
541 | + $tempfile_path = $modx->config['base_path'].'assets/backup/temp.php'; |
|
542 | 542 | |
543 | 543 | $result = $modx->db->query('SHOW TABLES'); |
544 | 544 | $tables = $this->result2Array(0, $result); |
@@ -551,15 +551,15 @@ discard block |
||
551 | 551 | |
552 | 552 | // Set header |
553 | 553 | $output = "#{$lf}"; |
554 | - $output .= "# " . addslashes($modx->config['site_name']) . " Database Dump{$lf}"; |
|
554 | + $output .= "# ".addslashes($modx->config['site_name'])." Database Dump{$lf}"; |
|
555 | 555 | $output .= "# MODX Version:{$version['version']}{$lf}"; |
556 | 556 | $output .= "# {$lf}"; |
557 | 557 | $output .= "# Host: {$this->database_server}{$lf}"; |
558 | - $output .= "# Generation Time: " . $modx->toDateFormat(time()) . $lf; |
|
559 | - $output .= "# Server version: " . $modx->db->getVersion() . $lf; |
|
560 | - $output .= "# PHP Version: " . phpversion() . $lf; |
|
558 | + $output .= "# Generation Time: ".$modx->toDateFormat(time()).$lf; |
|
559 | + $output .= "# Server version: ".$modx->db->getVersion().$lf; |
|
560 | + $output .= "# PHP Version: ".phpversion().$lf; |
|
561 | 561 | $output .= "# Database: `{$this->dbname}`{$lf}"; |
562 | - $output .= "# Description: " . trim($_REQUEST['backup_title']) . "{$lf}"; |
|
562 | + $output .= "# Description: ".trim($_REQUEST['backup_title'])."{$lf}"; |
|
563 | 563 | $output .= "#"; |
564 | 564 | file_put_contents($tempfile_path, $output, FILE_APPEND | LOCK_EX); |
565 | 565 | $output = ''; |
@@ -585,7 +585,7 @@ discard block |
||
585 | 585 | case $modx->db->config['table_prefix'].'manager_log': |
586 | 586 | continue 2; |
587 | 587 | }*/ |
588 | - if (!preg_match('@^' . $modx->db->config['table_prefix'] . '@', $tblval)) { |
|
588 | + if (!preg_match('@^'.$modx->db->config['table_prefix'].'@', $tblval)) { |
|
589 | 589 | continue; |
590 | 590 | } |
591 | 591 | } |
@@ -619,9 +619,9 @@ discard block |
||
619 | 619 | ), '\\n', $value); |
620 | 620 | $value = "'{$value}'"; |
621 | 621 | } |
622 | - $insertdump .= $value . ','; |
|
622 | + $insertdump .= $value.','; |
|
623 | 623 | } |
624 | - $output .= rtrim($insertdump, ',') . ");\n"; |
|
624 | + $output .= rtrim($insertdump, ',').");\n"; |
|
625 | 625 | if (1048576 < strlen($output)) { |
626 | 626 | file_put_contents($tempfile_path, $output, FILE_APPEND | LOCK_EX); |
627 | 627 | $output = ''; |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE != "true") { |
|
2 | +if (IN_MANAGER_MODE != "true") { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | -switch($modx->manager->action) { |
|
6 | +switch ($modx->manager->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; |
@@ -21,17 +21,17 @@ discard block |
||
21 | 21 | $user = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0; |
22 | 22 | |
23 | 23 | // check to see the snippet editor isn't locked |
24 | -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
25 | -if($username = $modx->db->getValue($rs)) { |
|
24 | +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
25 | +if ($username = $modx->db->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->manager->action == '12') { |
|
30 | +if ($modx->manager->action == '12') { |
|
31 | 31 | // get user attribute |
32 | 32 | $rs = $modx->db->select('*', $modx->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
33 | 33 | $userdata = $modx->db->getRow($rs); |
34 | - if(!$userdata) { |
|
34 | + if (!$userdata) { |
|
35 | 35 | $modx->webAlertAndQuit("No user returned!"); |
36 | 36 | } |
37 | 37 | |
@@ -39,10 +39,10 @@ discard block |
||
39 | 39 | // get user settings |
40 | 40 | $rs = $modx->db->select('*', $modx->getFullTableName('user_settings'), "user = '{$user}'"); |
41 | 41 | $usersettings = array(); |
42 | - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
42 | + while ($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
43 | 43 | // manually extract so that user display settings are not overwritten |
44 | - foreach($usersettings as $k => $v) { |
|
45 | - if($k != 'manager_language' && $k != 'manager_theme') { |
|
44 | + foreach ($usersettings as $k => $v) { |
|
45 | + if ($k != 'manager_language' && $k != 'manager_theme') { |
|
46 | 46 | ${$k} = $v; |
47 | 47 | } |
48 | 48 | } |
@@ -50,7 +50,7 @@ discard block |
||
50 | 50 | // get user name |
51 | 51 | $rs = $modx->db->select('*', $modx->getFullTableName('manager_users'), "id = '{$user}'"); |
52 | 52 | $usernamedata = $modx->db->getRow($rs); |
53 | - if(!$usernamedata) { |
|
53 | + if (!$usernamedata) { |
|
54 | 54 | $modx->webAlertAndQuit("No user returned while getting username!"); |
55 | 55 | } |
56 | 56 | $_SESSION['itemname'] = $usernamedata['username']; |
@@ -62,14 +62,14 @@ discard block |
||
62 | 62 | } |
63 | 63 | |
64 | 64 | // avoid doubling htmlspecialchars (already encoded in DB) |
65 | -foreach($userdata as $key => $val) { |
|
65 | +foreach ($userdata as $key => $val) { |
|
66 | 66 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
67 | 67 | }; |
68 | 68 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
69 | 69 | |
70 | 70 | // restore saved form |
71 | 71 | $formRestored = false; |
72 | -if($modx->manager->hasFormValues()) { |
|
72 | +if ($modx->manager->hasFormValues()) { |
|
73 | 73 | $modx->manager->loadFormValues(); |
74 | 74 | // restore post values |
75 | 75 | $userdata = array_merge($userdata, $_POST); |
@@ -84,13 +84,13 @@ discard block |
||
84 | 84 | // include the country list language file |
85 | 85 | $_country_lang = array(); |
86 | 86 | include_once "lang/country/english_country.inc.php"; |
87 | -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
88 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
87 | +if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) { |
|
88 | + include_once "lang/country/".$manager_language."_country.inc.php"; |
|
89 | 89 | } |
90 | 90 | asort($_country_lang); |
91 | 91 | |
92 | 92 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
93 | -if($which_browser == 'default') { |
|
93 | +if ($which_browser == 'default') { |
|
94 | 94 | $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
95 | 95 | } |
96 | 96 | ?> |
@@ -182,7 +182,7 @@ discard block |
||
182 | 182 | document.userform.save.click(); |
183 | 183 | }, |
184 | 184 | delete: function() { |
185 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
185 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
186 | 186 | alert("<?php echo $_lang['alert_delete_self']; ?>"); |
187 | 187 | <?php } else { ?> |
188 | 188 | if(confirm("<?php echo $_lang['confirm_delete_user']; ?>") === true) { |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
206 | 206 | "id" => $user |
207 | 207 | )); |
208 | - if(is_array($evtOut)) { |
|
208 | + if (is_array($evtOut)) { |
|
209 | 209 | echo implode("", $evtOut); |
210 | 210 | } |
211 | 211 | ?> |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | <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" ?>" /> |
215 | 215 | |
216 | 216 | <h1> |
217 | - <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['user_title']) ?> |
|
217 | + <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['user_title']) ?> |
|
218 | 218 | </h1> |
219 | 219 | |
220 | 220 | <?php echo $_style['actionbuttons']['dynamic']['user'] ?> |
@@ -232,13 +232,13 @@ discard block |
||
232 | 232 | <table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser"> |
233 | 233 | <tr> |
234 | 234 | <td colspan="3"><span id="blocked" class="warning"> |
235 | - <?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
235 | + <?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
236 | 236 | <?php echo $_lang['user_is_blocked']; ?> |
237 | 237 | <?php } ?> |
238 | 238 | </span> |
239 | 239 | <br /></td> |
240 | 240 | </tr> |
241 | - <?php if(!empty($userdata['id'])) { ?> |
|
241 | + <?php if (!empty($userdata['id'])) { ?> |
|
242 | 242 | <tr id="showname" style="display: <?php echo ($modx->manager->action == '12' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> "> |
243 | 243 | <td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i> <b><?php echo $modx->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> |
244 | 244 | <input type="hidden" name="oldusername" value="<?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" /> |
@@ -251,7 +251,7 @@ discard block |
||
251 | 251 | <td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->htmlspecialchars($usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td> |
252 | 252 | </tr> |
253 | 253 | <tr> |
254 | - <th><?php echo $modx->manager->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th> |
|
254 | + <th><?php echo $modx->manager->action == '11' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th> |
|
255 | 255 | <td> </td> |
256 | 256 | <td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->manager->action == "11" ? " checked disabled" : ""; ?>> |
257 | 257 | <input type="hidden" name="newpassword" value="<?php echo $modx->manager->action == "11" ? 1 : 0; ?>" onChange="documentDirty=true;" /> |
@@ -305,8 +305,8 @@ discard block |
||
305 | 305 | ?> |
306 | 306 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
307 | 307 | <?php |
308 | - while($row = $modx->db->getRow($rs)) { |
|
309 | - if($modx->manager->action == '11') { |
|
308 | + while ($row = $modx->db->getRow($rs)) { |
|
309 | + if ($modx->manager->action == '11') { |
|
310 | 310 | $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
311 | 311 | } else { |
312 | 312 | $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
@@ -360,8 +360,8 @@ discard block |
||
360 | 360 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
361 | 361 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
362 | 362 | <?php |
363 | - foreach($_country_lang as $key => $country) { |
|
364 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
363 | + foreach ($_country_lang as $key => $country) { |
|
364 | + echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>"; |
|
365 | 365 | } |
366 | 366 | ?> |
367 | 367 | </select></td> |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | <td> </td> |
388 | 388 | <td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->htmlspecialchars($userdata['comment']); ?></textarea></td> |
389 | 389 | </tr> |
390 | - <?php if($modx->manager->action == '12') { ?> |
|
390 | + <?php if ($modx->manager->action == '12') { ?> |
|
391 | 391 | <tr> |
392 | 392 | <th><?php echo $_lang['user_logincount']; ?>:</th> |
393 | 393 | <td> </td> |
@@ -424,7 +424,7 @@ discard block |
||
424 | 424 | </tr> |
425 | 425 | <?php } ?> |
426 | 426 | </table> |
427 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
427 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
428 | 428 | <p><?php echo $_lang['user_edit_self_msg']; ?></p> |
429 | 429 | <?php } ?> |
430 | 430 | </div> |
@@ -441,8 +441,8 @@ discard block |
||
441 | 441 | <?php |
442 | 442 | $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
443 | 443 | $dir = dir("includes/lang"); |
444 | - while($file = $dir->read()) { |
|
445 | - if(strpos($file, ".inc.php") > 0) { |
|
444 | + while ($file = $dir->read()) { |
|
445 | + if (strpos($file, ".inc.php") > 0) { |
|
446 | 446 | $endpos = strpos($file, "."); |
447 | 447 | $languagename = substr($file, 0, $endpos); |
448 | 448 | $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
@@ -529,17 +529,17 @@ discard block |
||
529 | 529 | <option value=""></option> |
530 | 530 | <?php |
531 | 531 | $dir = dir("media/style/"); |
532 | - while($file = $dir->read()) { |
|
533 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
532 | + while ($file = $dir->read()) { |
|
533 | + if ($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
534 | 534 | $themename = $file; |
535 | - if($themename === 'common') { |
|
535 | + if ($themename === 'common') { |
|
536 | 536 | continue; |
537 | 537 | } |
538 | - $attr = 'value="' . $themename . '" '; |
|
539 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
538 | + $attr = 'value="'.$themename.'" '; |
|
539 | + if (isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
540 | 540 | $attr .= 'selected="selected" '; |
541 | 541 | } |
542 | - echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
542 | + echo "\t\t<option ".rtrim($attr).'>'.ucwords(str_replace("_", " ", $themename))."</option>\n"; |
|
543 | 543 | } |
544 | 544 | } |
545 | 545 | $dir->close(); |
@@ -556,12 +556,12 @@ discard block |
||
556 | 556 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> |
557 | 557 | <?php |
558 | 558 | $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
559 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
560 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
559 | + echo '<option value="default"'.$selected.'>'.$_lang['option_default']."</option>\n"; |
|
560 | + foreach (glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
561 | 561 | $dir = str_replace('\\', '/', $dir); |
562 | 562 | $browser_name = substr($dir, strrpos($dir, '/') + 1); |
563 | 563 | $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
564 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
564 | + echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n"; |
|
565 | 565 | } |
566 | 566 | ?> |
567 | 567 | </select></td> |
@@ -588,7 +588,7 @@ discard block |
||
588 | 588 | </tr> |
589 | 589 | <tr> |
590 | 590 | <td> </td> |
591 | - <td class='comment'><?php echo $_lang["uploadable_images_message"] . $_lang["user_upload_message"] ?></td> |
|
591 | + <td class='comment'><?php echo $_lang["uploadable_images_message"].$_lang["user_upload_message"] ?></td> |
|
592 | 592 | </tr> |
593 | 593 | <tr> |
594 | 594 | <th><?php echo $_lang["uploadable_media_title"] ?></th> |
@@ -600,7 +600,7 @@ discard block |
||
600 | 600 | </tr> |
601 | 601 | <tr> |
602 | 602 | <td> </td> |
603 | - <td class='comment'><?php echo $_lang["uploadable_media_message"] . $_lang["user_upload_message"] ?></td> |
|
603 | + <td class='comment'><?php echo $_lang["uploadable_media_message"].$_lang["user_upload_message"] ?></td> |
|
604 | 604 | </tr> |
605 | 605 | <tr> |
606 | 606 | <th><?php echo $_lang["uploadable_flash_title"] ?></th> |
@@ -612,7 +612,7 @@ discard block |
||
612 | 612 | </tr> |
613 | 613 | <tr> |
614 | 614 | <td> </td> |
615 | - <td class='comment'><?php echo $_lang["uploadable_flash_message"] . $_lang["user_upload_message"] ?></td> |
|
615 | + <td class='comment'><?php echo $_lang["uploadable_flash_message"].$_lang["user_upload_message"] ?></td> |
|
616 | 616 | </tr> |
617 | 617 | <tr> |
618 | 618 | <th><?php echo $_lang["uploadable_files_title"] ?></th> |
@@ -624,7 +624,7 @@ discard block |
||
624 | 624 | </tr> |
625 | 625 | <tr> |
626 | 626 | <td> </td> |
627 | - <td class='comment'><?php echo $_lang["uploadable_files_message"] . $_lang["user_upload_message"] ?></td> |
|
627 | + <td class='comment'><?php echo $_lang["uploadable_files_message"].$_lang["user_upload_message"] ?></td> |
|
628 | 628 | </tr> |
629 | 629 | <tr class='row2'> |
630 | 630 | <th><?php echo $_lang["upload_maxsize_title"] ?></th> |
@@ -643,11 +643,11 @@ discard block |
||
643 | 643 | $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
644 | 644 | // invoke OnRichTextEditorRegister event |
645 | 645 | $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
646 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
647 | - if(is_array($evtOut)) { |
|
648 | - for($i = 0; $i < count($evtOut); $i++) { |
|
646 | + echo "<option value='none'".($edt == 'none' ? " selected='selected'" : "").">".$_lang["none"]."</option>\n"; |
|
647 | + if (is_array($evtOut)) { |
|
648 | + for ($i = 0; $i < count($evtOut); $i++) { |
|
649 | 649 | $editor = $evtOut[$i]; |
650 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
650 | + echo "<option value='$editor'".($edt == $editor ? " selected='selected'" : "").">$editor</option>\n"; |
|
651 | 651 | } |
652 | 652 | } |
653 | 653 | ?> |
@@ -685,7 +685,7 @@ discard block |
||
685 | 685 | <?php |
686 | 686 | // invoke OnInterfaceSettingsRender event |
687 | 687 | $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
688 | - if(is_array($evtOut)) { |
|
688 | + if (is_array($evtOut)) { |
|
689 | 689 | echo implode("", $evtOut); |
690 | 690 | } |
691 | 691 | ?> |
@@ -712,7 +712,7 @@ discard block |
||
712 | 712 | function BrowseServer() { |
713 | 713 | var w = screen.width * 0.7; |
714 | 714 | var h = screen.height * 0.7; |
715 | - OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h); |
|
715 | + OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h); |
|
716 | 716 | } |
717 | 717 | |
718 | 718 | function SetUrl(url, width, height, alt) { |
@@ -735,17 +735,17 @@ discard block |
||
735 | 735 | </tr> |
736 | 736 | </table> |
737 | 737 | </div> |
738 | - <?php if($use_udperms == 1) { |
|
738 | + <?php if ($use_udperms == 1) { |
|
739 | 739 | |
740 | 740 | $groupsarray = array(); |
741 | 741 | |
742 | - if($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
742 | + if ($modx->manager->action == '12') { // only do this bit if the user is being edited |
|
743 | 743 | $rs = $modx->db->select('user_group', $modx->getFullTableName('member_groups'), "member='{$user}'"); |
744 | 744 | $groupsarray = $modx->db->getColumn('user_group', $rs); |
745 | 745 | } |
746 | 746 | // retain selected doc groups between post |
747 | - if(is_array($_POST['user_groups'])) { |
|
748 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
747 | + if (is_array($_POST['user_groups'])) { |
|
748 | + foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
749 | 749 | } |
750 | 750 | ?> |
751 | 751 | <div class="tab-page" id="tabAccess"> |
@@ -754,8 +754,8 @@ discard block |
||
754 | 754 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
755 | 755 | <?php |
756 | 756 | $rs = $modx->db->select('name, id', $modx->getFullTableName('membergroup_names'), '', 'name'); |
757 | - while($row = $modx->db->getRow($rs)) { |
|
758 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
757 | + while ($row = $modx->db->getRow($rs)) { |
|
758 | + echo "<label><input type='checkbox' name='user_groups[]' value='".$row['id']."'".(in_array($row['id'], $groupsarray) ? " checked='checked'" : "")." />".$row['name']."</label><br />"; |
|
759 | 759 | } |
760 | 760 | } |
761 | 761 | ?> |
@@ -768,7 +768,7 @@ discard block |
||
768 | 768 | $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
769 | 769 | "id" => $user |
770 | 770 | )); |
771 | - if(is_array($evtOut)) { |
|
771 | + if (is_array($evtOut)) { |
|
772 | 772 | echo implode("", $evtOut); |
773 | 773 | } |
774 | 774 | ?> |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | $updateMsg = ''; |
14 | 14 | |
15 | 15 | // check permissions on the document |
16 | -include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; |
|
16 | +include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; |
|
17 | 17 | $udperms = new udperms(); |
18 | 18 | $udperms->user = $modx->getLoginUserID(); |
19 | 19 | $udperms->document = $id; |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | } |
25 | 25 | |
26 | 26 | if (isset($_POST['listSubmitted'])) { |
27 | - $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>'; |
|
27 | + $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>'; |
|
28 | 28 | if (strlen($items) > 0) { |
29 | 29 | $items = explode(';', $items); |
30 | 30 | foreach ($items as $key => $value) { |
@@ -44,15 +44,15 @@ discard block |
||
44 | 44 | $tblsc = $modx->getFullTableName('site_content'); |
45 | 45 | $tbldg = $modx->getFullTableName('document_groups'); |
46 | 46 | |
47 | - $rs = $modx->db->select('pagetitle', $tblsc, 'id=' . $id . ''); |
|
47 | + $rs = $modx->db->select('pagetitle', $tblsc, 'id='.$id.''); |
|
48 | 48 | $pagetitle = $modx->db->getValue($rs); |
49 | 49 | |
50 | 50 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
51 | 51 | $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; |
52 | - $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
53 | - $access = " AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
52 | + $mgrRole = (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
53 | + $access = " AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
54 | 54 | |
55 | - $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc . 'AS sc LEFT JOIN ' . $tbldg . ' dg ON dg.document=sc.id', 'sc.parent=' . $id . $access . ' GROUP BY sc.id', 'menuindex ASC'); |
|
55 | + $rs = $modx->db->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc.'AS sc LEFT JOIN '.$tbldg.' dg ON dg.document=sc.id', 'sc.parent='.$id.$access.' GROUP BY sc.id', 'menuindex ASC'); |
|
56 | 56 | |
57 | 57 | if ($modx->db->getRecordCount($rs)) { |
58 | 58 | $ressourcelist .= '<div class="clearfix"><ul id="sortlist" class="sortableList">'; |
@@ -61,12 +61,12 @@ discard block |
||
61 | 61 | $classes .= ($row['hidemenu']) ? ' notInMenuNode ' : ' inMenuNode'; |
62 | 62 | $classes .= ($row['published']) ? ' publishedNode ' : ' unpublishedNode '; |
63 | 63 | $classes = ($row['deleted']) ? ' deletedNode ' : $classes; |
64 | - $icon = $row['isfolder'] ? '<i class="' . $_style['files_folder'] . '"></i> ' : ' <i class="' . $_style['files_page_html'] . '"></i> '; |
|
65 | - $ressourcelist .= '<li id="item_' . $row['id'] . '" class="' . $classes . '">' . $icon . $row['pagetitle'] . ' <small>(' . $row['id'] . ')</small></li>'; |
|
64 | + $icon = $row['isfolder'] ? '<i class="'.$_style['files_folder'].'"></i> ' : ' <i class="'.$_style['files_page_html'].'"></i> '; |
|
65 | + $ressourcelist .= '<li id="item_'.$row['id'].'" class="'.$classes.'">'.$icon.$row['pagetitle'].' <small>('.$row['id'].')</small></li>'; |
|
66 | 66 | } |
67 | 67 | $ressourcelist .= '</ul></div>'; |
68 | 68 | } else { |
69 | - $updateMsg = '<p class="text-danger">' . $_lang['sort_nochildren'] . '</p>'; |
|
69 | + $updateMsg = '<p class="text-danger">'.$_lang['sort_nochildren'].'</p>'; |
|
70 | 70 | } |
71 | 71 | } |
72 | 72 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | </script> |
150 | 150 | |
151 | 151 | <h1> |
152 | - <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $pagetitle . '<small>(' . $id . ')</small>' : $_lang['sort_menuindex']) ?> |
|
152 | + <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $pagetitle.'<small>('.$id.')</small>' : $_lang['sort_menuindex']) ?> |
|
153 | 153 | </h1> |
154 | 154 | |
155 | 155 | <?= $_style['actionbuttons']['dynamic']['save'] ?> |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE != "true") { |
|
2 | +if (IN_MANAGER_MODE != "true") { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | -switch($modx->manager->action) { |
|
6 | +switch ($modx->manager->action) { |
|
7 | 7 | case 88: |
8 | - if(!$modx->hasPermission('edit_web_user')) { |
|
8 | + if (!$modx->hasPermission('edit_web_user')) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | break; |
12 | 12 | case 87: |
13 | - if(!$modx->hasPermission('new_web_user')) { |
|
13 | + if (!$modx->hasPermission('new_web_user')) { |
|
14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | 15 | } |
16 | 16 | break; |
@@ -22,30 +22,30 @@ discard block |
||
22 | 22 | |
23 | 23 | |
24 | 24 | // check to see the snippet editor isn't locked |
25 | -$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
26 | -if($username = $modx->db->getValue($rs)) { |
|
25 | +$rs = $modx->db->select('username', $modx->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
26 | +if ($username = $modx->db->getValue($rs)) { |
|
27 | 27 | $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); |
28 | 28 | } |
29 | 29 | // end check for lock |
30 | 30 | |
31 | -if($modx->manager->action == '88') { |
|
31 | +if ($modx->manager->action == '88') { |
|
32 | 32 | // get user attributes |
33 | 33 | $rs = $modx->db->select('*', $modx->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); |
34 | 34 | $userdata = $modx->db->getRow($rs); |
35 | - if(!$userdata) { |
|
35 | + if (!$userdata) { |
|
36 | 36 | $modx->webAlertAndQuit("No user returned!"); |
37 | 37 | } |
38 | 38 | |
39 | 39 | // get user settings |
40 | 40 | $rs = $modx->db->select('*', $modx->getFullTableName('web_user_settings'), "webuser = '{$user}'"); |
41 | 41 | $usersettings = array(); |
42 | - while($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
42 | + while ($row = $modx->db->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
43 | 43 | extract($usersettings, EXTR_OVERWRITE); |
44 | 44 | |
45 | 45 | // get user name |
46 | 46 | $rs = $modx->db->select('*', $modx->getFullTableName('web_users'), "id = '{$user}'"); |
47 | 47 | $usernamedata = $modx->db->getRow($rs); |
48 | - if(!$usernamedata) { |
|
48 | + if (!$usernamedata) { |
|
49 | 49 | $modx->webAlertAndQuit("No user returned while getting username!"); |
50 | 50 | } |
51 | 51 | $_SESSION['itemname'] = $usernamedata['username']; |
@@ -57,14 +57,14 @@ discard block |
||
57 | 57 | } |
58 | 58 | |
59 | 59 | // avoid doubling htmlspecialchars (already encoded in DB) |
60 | -foreach($userdata as $key => $val) { |
|
60 | +foreach ($userdata as $key => $val) { |
|
61 | 61 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
62 | 62 | }; |
63 | 63 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
64 | 64 | |
65 | 65 | // restore saved form |
66 | 66 | $formRestored = false; |
67 | -if($modx->manager->hasFormValues()) { |
|
67 | +if ($modx->manager->hasFormValues()) { |
|
68 | 68 | $modx->manager->loadFormValues(); |
69 | 69 | // restore post values |
70 | 70 | $userdata = array_merge($userdata, $_POST); |
@@ -78,8 +78,8 @@ discard block |
||
78 | 78 | |
79 | 79 | // include the country list language file |
80 | 80 | $_country_lang = array(); |
81 | -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
82 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
81 | +if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) { |
|
82 | + include_once "lang/country/".$manager_language."_country.inc.php"; |
|
83 | 83 | } else { |
84 | 84 | include_once "lang/country/english_country.inc.php"; |
85 | 85 | } |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | <?php |
192 | 192 | // invoke OnWUsrFormPrerender event |
193 | 193 | $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); |
194 | - if(is_array($evtOut)) { |
|
194 | + if (is_array($evtOut)) { |
|
195 | 195 | echo implode("", $evtOut); |
196 | 196 | } |
197 | 197 | ?> |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | <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" ?>" /> |
201 | 201 | |
202 | 202 | <h1> |
203 | - <i class="fa fa fa-users"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['web_user_title']) ?> |
|
203 | + <i class="fa fa fa-users"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['web_user_title']) ?> |
|
204 | 204 | </h1> |
205 | 205 | |
206 | 206 | <?php echo $_style['actionbuttons']['dynamic']['user'] ?> |
@@ -218,13 +218,13 @@ discard block |
||
218 | 218 | <table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser"> |
219 | 219 | <tr> |
220 | 220 | <td colspan="3"><span id="blocked" class="warning"> |
221 | - <?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
221 | + <?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
222 | 222 | <b><?php echo $_lang['user_is_blocked']; ?></b> |
223 | 223 | <?php } ?> |
224 | 224 | </span> |
225 | 225 | <br /></td> |
226 | 226 | </tr> |
227 | - <?php if(!empty($userdata['id'])) { ?> |
|
227 | + <?php if (!empty($userdata['id'])) { ?> |
|
228 | 228 | <tr id="showname" style="display: <?php echo ($modx->manager->action == '88' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> "> |
229 | 229 | <td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i> <b><?php echo $modx->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> |
230 | 230 | <input type="hidden" name="oldusername" value="<?php echo $modx->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" /> |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | <td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->htmlspecialchars(isset($_POST['newusername']) ? $_POST['newusername'] : $usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td> |
238 | 238 | </tr> |
239 | 239 | <tr> |
240 | - <th><?php echo $modx->manager->action == '87' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th> |
|
240 | + <th><?php echo $modx->manager->action == '87' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th> |
|
241 | 241 | <td> </td> |
242 | 242 | <td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->manager->action == "87" ? " checked disabled" : ""; ?>> |
243 | 243 | <input type="hidden" name="newpassword" value="<?php echo $modx->manager->action == "87" ? 1 : 0; ?>" onChange="documentDirty=true;" /> |
@@ -324,8 +324,8 @@ discard block |
||
324 | 324 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
325 | 325 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
326 | 326 | <?php |
327 | - foreach($_country_lang as $key => $country) { |
|
328 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
327 | + foreach ($_country_lang as $key => $country) { |
|
328 | + echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>"; |
|
329 | 329 | } |
330 | 330 | ?> |
331 | 331 | </select></td> |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | <td> </td> |
352 | 352 | <td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->htmlspecialchars(isset($_POST['comment']) ? $_POST['comment'] : $userdata['comment']); ?></textarea></td> |
353 | 353 | </tr> |
354 | - <?php if($modx->manager->action == '88') { ?> |
|
354 | + <?php if ($modx->manager->action == '88') { ?> |
|
355 | 355 | <tr> |
356 | 356 | <th><?php echo $_lang['user_logincount']; ?>:</th> |
357 | 357 | <td> </td> |
@@ -472,7 +472,7 @@ discard block |
||
472 | 472 | function BrowseServer() { |
473 | 473 | var w = screen.width * 0.7; |
474 | 474 | var h = screen.height * 0.7; |
475 | - OpenServerBrowser("<?php echo MODX_MANAGER_URL;?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h); |
|
475 | + OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h); |
|
476 | 476 | } |
477 | 477 | |
478 | 478 | function SetUrl(url, width, height, alt) { |
@@ -491,22 +491,22 @@ discard block |
||
491 | 491 | <td class='comment'><?php echo $_lang["user_photo_message"] ?></td> |
492 | 492 | </tr> |
493 | 493 | <tr> |
494 | - <td colspan="2" align="center"><img name="iphoto" src="<?php echo isset($_POST['photo']) ? (strpos($_POST['photo'], "http://") === false ? MODX_SITE_URL : "") . $_POST['photo'] : !empty($userdata['photo']) ? (strpos($userdata['photo'], "http://") === false ? MODX_SITE_URL : "") . $userdata['photo'] : $_style["tx"]; ?>" /></td> |
|
494 | + <td colspan="2" align="center"><img name="iphoto" src="<?php echo isset($_POST['photo']) ? (strpos($_POST['photo'], "http://") === false ? MODX_SITE_URL : "").$_POST['photo'] : !empty($userdata['photo']) ? (strpos($userdata['photo'], "http://") === false ? MODX_SITE_URL : "").$userdata['photo'] : $_style["tx"]; ?>" /></td> |
|
495 | 495 | </tr> |
496 | 496 | </table> |
497 | 497 | </div> |
498 | 498 | <?php |
499 | - if($use_udperms == 1) { |
|
499 | + if ($use_udperms == 1) { |
|
500 | 500 | |
501 | 501 | $groupsarray = array(); |
502 | 502 | |
503 | - if($modx->manager->action == '88') { // only do this bit if the user is being edited |
|
503 | + if ($modx->manager->action == '88') { // only do this bit if the user is being edited |
|
504 | 504 | $rs = $modx->db->select('webgroup', $modx->getFullTableName('web_groups'), "webuser='{$user}'"); |
505 | 505 | $groupsarray = $modx->db->getColumn('webgroup', $rs); |
506 | 506 | } |
507 | 507 | // retain selected user groups between post |
508 | - if(is_array($_POST['user_groups'])) { |
|
509 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
508 | + if (is_array($_POST['user_groups'])) { |
|
509 | + foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
510 | 510 | } |
511 | 511 | ?> |
512 | 512 | <div class="tab-page" id="tabPermissions"> |
@@ -515,8 +515,8 @@ discard block |
||
515 | 515 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
516 | 516 | <?php |
517 | 517 | $rs = $modx->db->select('name, id', $modx->getFullTableName('webgroup_names'), '', 'name'); |
518 | - while($row = $modx->db->getRow($rs)) { |
|
519 | - echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />'; |
|
518 | + while ($row = $modx->db->getRow($rs)) { |
|
519 | + echo '<label><input type="checkbox" name="user_groups[]" value="'.$row['id'].'"'.(in_array($row['id'], $groupsarray) ? ' checked="checked"' : '').' />'.$row['name'].'</label><br />'; |
|
520 | 520 | } |
521 | 521 | } |
522 | 522 | ?> |
@@ -526,7 +526,7 @@ discard block |
||
526 | 526 | $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( |
527 | 527 | "id" => $user |
528 | 528 | )); |
529 | - if(is_array($evtOut)) { |
|
529 | + if (is_array($evtOut)) { |
|
530 | 530 | echo implode("", $evtOut); |
531 | 531 | } |
532 | 532 | ?> |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $templatename = ''; |
20 | 20 | |
21 | 21 | if (isset($_POST['listSubmitted'])) { |
22 | - $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>'; |
|
22 | + $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>'; |
|
23 | 23 | foreach ($_POST as $listName => $listValue) { |
24 | 24 | if ($listName == 'listSubmitted' || $listName == 'reset') { |
25 | 25 | continue; |
@@ -47,11 +47,11 @@ discard block |
||
47 | 47 | while ($row = $modx->db->getRow($rs)) { |
48 | 48 | $templatename = $row['templatename']; |
49 | 49 | $caption = $row['caption'] != '' ? $row['caption'] : $row['name']; |
50 | - $sortableList .= '<li id="item_' . $row['id'] . '"><i class="fa fa-list-alt"></i> ' . $caption . ' <small class="protectedNode" style="float:right">[*' . $row['name'] . '*]</small></li>'; |
|
50 | + $sortableList .= '<li id="item_'.$row['id'].'"><i class="fa fa-list-alt"></i> '.$caption.' <small class="protectedNode" style="float:right">[*'.$row['name'].'*]</small></li>'; |
|
51 | 51 | } |
52 | 52 | $sortableList .= '</ul></div>'; |
53 | 53 | } else { |
54 | - $updateMsg = '<p class="text-danger">' . $_lang['tmplvars_novars'] . '</p>'; |
|
54 | + $updateMsg = '<p class="text-danger">'.$_lang['tmplvars_novars'].'</p>'; |
|
55 | 55 | } |
56 | 56 | ?> |
57 | 57 | |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | </script> |
129 | 129 | |
130 | 130 | <h1> |
131 | - <i class="fa fa-sort-numeric-asc"></i><?= ($templatename ? $templatename . '<small>(' . $id . ')</small>' : $_lang['template_tv_edit_title']) ?> |
|
131 | + <i class="fa fa-sort-numeric-asc"></i><?= ($templatename ? $templatename.'<small>('.$id.')</small>' : $_lang['template_tv_edit_title']) ?> |
|
132 | 132 | </h1> |
133 | 133 | |
134 | 134 | <?= $_style['actionbuttons']['dynamic']['save'] ?> |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | <div class="container container-body" id="lyr3"> |
17 | 17 | <b><?= $_lang['messages_read_message'] ?></b> |
18 | 18 | <?php |
19 | - $rs = $modx->db->select('*', $modx->getFullTableName('user_messages'), "id='" . (int)$_REQUEST['id'] . "'"); |
|
19 | + $rs = $modx->db->select('*', $modx->getFullTableName('user_messages'), "id='".(int) $_REQUEST['id']."'"); |
|
20 | 20 | $message = $modx->db->getRow($rs); |
21 | 21 | if (!$message) { |
22 | 22 | echo "Wrong number of messages returned!"; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | <p><b><?= $_lang['messages_inbox'] ?></b></p> |
88 | 88 | <?php |
89 | 89 | // Get number of rows |
90 | - $rs = $modx->db->select('count(id)', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . ""); |
|
90 | + $rs = $modx->db->select('count(id)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID().""); |
|
91 | 91 | $num_rows = $modx->db->getValue($rs); |
92 | 92 | |
93 | 93 | // ============================================================== |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { |
101 | 101 | $int_cur_position = 0; |
102 | 102 | } else { |
103 | - $int_cur_position = (int)$_REQUEST['int_cur_position']; |
|
103 | + $int_cur_position = (int) $_REQUEST['int_cur_position']; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | // Number of result to display on the page, will be in the LIMIT of the sql query also |
@@ -117,21 +117,21 @@ discard block |
||
117 | 117 | $array_row_paging = $p->getPagingRowArray(); |
118 | 118 | |
119 | 119 | // Display the result as you like... |
120 | - $pager .= $_lang['showing'] . " " . $array_paging['lower']; |
|
121 | - $pager .= " " . $_lang['to'] . " " . $array_paging['upper']; |
|
122 | - $pager .= " (" . $array_paging['total'] . " " . $_lang['total'] . ")"; |
|
123 | - $pager .= "<br />" . $array_paging['previous_link'] . "<<" . (isset($array_paging['previous_link']) ? "</a> " : " "); |
|
120 | + $pager .= $_lang['showing']." ".$array_paging['lower']; |
|
121 | + $pager .= " ".$_lang['to']." ".$array_paging['upper']; |
|
122 | + $pager .= " (".$array_paging['total']." ".$_lang['total'].")"; |
|
123 | + $pager .= "<br />".$array_paging['previous_link']."<<".(isset($array_paging['previous_link']) ? "</a> " : " "); |
|
124 | 124 | for ($i = 0; $i < sizeof($array_row_paging); $i++) { |
125 | - $pager .= $array_row_paging[$i] . " "; |
|
125 | + $pager .= $array_row_paging[$i]." "; |
|
126 | 126 | } |
127 | - $pager .= $array_paging['next_link'] . ">>" . (isset($array_paging['next_link']) ? "</a>" : ""); |
|
127 | + $pager .= $array_paging['next_link'].">>".(isset($array_paging['next_link']) ? "</a>" : ""); |
|
128 | 128 | |
129 | 129 | // The above exemple print somethings like: |
130 | 130 | // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> |
131 | 131 | // Of course you can now play with array_row_paging in order to print |
132 | 132 | // only the results you would like... |
133 | 133 | |
134 | - $rs = $modx->db->select('*', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . "", 'postdate DESC', "{$int_cur_position}, {$int_num_result}"); |
|
134 | + $rs = $modx->db->select('*', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()."", 'postdate DESC', "{$int_cur_position}, {$int_num_result}"); |
|
135 | 135 | $limit = $modx->db->getRecordCount($rs); |
136 | 136 | if ($limit < 1) { |
137 | 137 | echo $_lang['messages_no_messages']; |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | <p><b><?= $_lang['messages_compose'] ?></b></p> |
190 | 190 | <?php |
191 | 191 | if (($_REQUEST['m'] == 'rp' || $_REQUEST['m'] == 'f') && isset($_REQUEST['id'])) { |
192 | - $rs = $modx->db->select('*', $modx->getFullTableName('user_messages'), "id='" . $_REQUEST['id'] . "'"); |
|
192 | + $rs = $modx->db->select('*', $modx->getFullTableName('user_messages'), "id='".$_REQUEST['id']."'"); |
|
193 | 193 | $message = $modx->db->getRow($rs); |
194 | 194 | if (!$message) { |
195 | 195 | echo "Wrong number of messages returned!"; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | } |
209 | 209 | $subjecttext = $_REQUEST['m'] == 'rp' ? "Re: " : "Fwd: "; |
210 | 210 | $subjecttext .= $message['subject']; |
211 | - $messagetext = "\n\n\n-----\n" . $_lang['messages_from'] . ": $sendername\n" . $_lang['messages_sent'] . ": " . $modx->toDateFormat($message['postdate'] + $server_offset_time) . "\n" . $_lang['messages_subject'] . ": " . $message['subject'] . "\n\n" . $message['message']; |
|
211 | + $messagetext = "\n\n\n-----\n".$_lang['messages_from'].": $sendername\n".$_lang['messages_sent'].": ".$modx->toDateFormat($message['postdate'] + $server_offset_time)."\n".$_lang['messages_subject'].": ".$message['subject']."\n\n".$message['message']; |
|
212 | 212 | if ($_REQUEST['m'] == 'rp') { |
213 | 213 | $recipientindex = $message['sender']; |
214 | 214 | } |
@@ -295,9 +295,9 @@ discard block |
||
295 | 295 | |
296 | 296 | <?php |
297 | 297 | // count messages again, as any action on the messages page may have altered the message count |
298 | -$rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . " and messageread=0"); |
|
298 | +$rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()." and messageread=0"); |
|
299 | 299 | $_SESSION['nrnewmessages'] = $modx->db->getValue($rs); |
300 | -$rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . ""); |
|
300 | +$rs = $modx->db->select('COUNT(*)', $modx->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID().""); |
|
301 | 301 | $_SESSION['nrtotalmessages'] = $modx->db->getValue($rs); |
302 | 302 | $messagesallowed = $modx->hasPermission('messages'); |
303 | 303 | ?> |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE != "true") { |
|
2 | +if (IN_MANAGER_MODE != "true") { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('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->db->select('*', $tbl_documentgroup_names, '', 'name'); |
20 | -if($modx->db->getRecordCount($rs) < 1) { |
|
20 | +if ($modx->db->getRecordCount($rs) < 1) { |
|
21 | 21 | $docgroupselector = '[no groups to add]'; |
22 | 22 | } else { |
23 | - $docgroupselector = '<select name="docgroup">' . "\n"; |
|
24 | - while($row = $modx->db->getRow($rs)) { |
|
25 | - $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
23 | + $docgroupselector = '<select name="docgroup">'."\n"; |
|
24 | + while ($row = $modx->db->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->db->select('*', $tbl_membergroup_names, '', 'name'); |
31 | -if($modx->db->getRecordCount($rs) < 1) { |
|
31 | +if ($modx->db->getRecordCount($rs) < 1) { |
|
32 | 32 | $usrgroupselector = '[no user groups]'; |
33 | 33 | } else { |
34 | - $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
35 | - while($row = $modx->db->getRow($rs)) { |
|
36 | - $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
34 | + $usrgroupselector = '<select name="usergroup">'."\n"; |
|
35 | + while ($row = $modx->db->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->db->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->db->getRecordCount($rs) < 1) { |
|
99 | + $rs = $modx->db->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->db->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->db->getRow($rs)) { |
|
112 | - if($pid != $row['id']) { |
|
113 | - if($pid != '') { |
|
111 | + while ($row = $modx->db->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->db->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->db->getRecordCount($rs) < 1) { |
|
170 | + $rs = $modx->db->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->db->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->db->getRow($rs)) { |
|
183 | - if($pid != $row['id']) { |
|
184 | - if($pid != '') { |
|
182 | + while ($row = $modx->db->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->db->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->db->getRecordCount($rs) < 1) { |
|
229 | + $rs = $modx->db->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->db->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->db->getRow($rs)) { |
|
255 | - if($row['id'] != $pid) { |
|
256 | - if($pid != '') { |
|
254 | + while ($row = $modx->db->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,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if(IN_MANAGER_MODE != "true") { |
|
2 | +if (IN_MANAGER_MODE != "true") { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('edit_user')) { |
|
5 | +if (!$modx->hasPermission('edit_user')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -10,7 +10,7 @@ discard block |
||
10 | 10 | $modx->manager->initPageViewState(); |
11 | 11 | |
12 | 12 | // get and save search string |
13 | -if($_REQUEST['op'] == 'reset') { |
|
13 | +if ($_REQUEST['op'] == 'reset') { |
|
14 | 14 | $query = ''; |
15 | 15 | $_PAGE['vs']['search'] = ''; |
16 | 16 | } else { |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | |
26 | 26 | |
27 | 27 | // context menu |
28 | -include_once MODX_MANAGER_PATH . "includes/controls/contextmenu.php"; |
|
28 | +include_once MODX_MANAGER_PATH."includes/controls/contextmenu.php"; |
|
29 | 29 | $cm = new ContextMenu("cntxm", 150); |
30 | 30 | $cm->addItem($_lang["edit"], "js:menuAction(1)", $_style["actions_edit"], (!$modx->hasPermission('edit_user') ? 1 : 0)); |
31 | 31 | $cm->addItem($_lang["delete"], "js:menuAction(2)", $_style["actions_delete"], (!$modx->hasPermission('delete_user') ? 1 : 0)); |
@@ -121,16 +121,16 @@ discard block |
||
121 | 121 | <div class="table-responsive"> |
122 | 122 | <?php |
123 | 123 | $where = ""; |
124 | - if(!$modx->hasPermission('save_role')) { |
|
125 | - $where .= (empty($where) ? "" : " AND ") . "mua.role != 1"; |
|
124 | + if (!$modx->hasPermission('save_role')) { |
|
125 | + $where .= (empty($where) ? "" : " AND ")."mua.role != 1"; |
|
126 | 126 | } |
127 | - if(!empty($sqlQuery)) { |
|
128 | - $where .= (empty($where) ? "" : " AND ") . "((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; |
|
127 | + if (!empty($sqlQuery)) { |
|
128 | + $where .= (empty($where) ? "" : " AND ")."((mu.username LIKE '{$sqlQuery}%') OR (mua.fullname LIKE '%{$sqlQuery}%') OR (mua.email LIKE '{$sqlQuery}%'))"; |
|
129 | 129 | } |
130 | - $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users') . " AS mu |
|
131 | - INNER JOIN " . $modx->getFullTableName('user_attributes') . " AS mua ON mua.internalKey=mu.id |
|
132 | - LEFT JOIN " . $modx->getFullTableName('user_roles') . " AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC'); |
|
133 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
130 | + $ds = $modx->db->select("mu.id, mu.username, rname.name AS role, mua.fullname, mua.email, ELT(mua.gender, '{$_lang['user_male']}', '{$_lang['user_female']}', '{$_lang['user_other']}') AS gender, IF(mua.blocked,'{$_lang['yes']}','-') as blocked, mua.thislogin", $modx->getFullTableName('manager_users')." AS mu |
|
131 | + INNER JOIN " . $modx->getFullTableName('user_attributes')." AS mua ON mua.internalKey=mu.id |
|
132 | + LEFT JOIN " . $modx->getFullTableName('user_roles')." AS rname ON mua.role=rname.id", $where, 'mua.blocked ASC, mua.thislogin DESC'); |
|
133 | + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; |
|
134 | 134 | $grd = new DataGrid('', $ds, $modx->config['number_of_results']); // set page size to 0 t show all items |
135 | 135 | $grd->noRecordMsg = $_lang["no_records_found"]; |
136 | 136 | $grd->cssClass = "table data"; |
@@ -151,19 +151,19 @@ discard block |
||
151 | 151 | $grd->colWidths = "1%,,,,,,1%,1%"; |
152 | 152 | $grd->colAligns = "center,,,,,center,center,right' nowrap='nowrap"; |
153 | 153 | $grd->colTypes = implode('||', array( |
154 | - 'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="' . $_lang['click_to_context'] . '"><i class="' . $_style['icons_user'] . '"></i></a>', |
|
155 | - 'template:<a href="index.php?a=12&id=[+id+]" title="' . $_lang['click_to_edit_title'] . '">[+value+]</a>', |
|
154 | + 'template:<a class="gridRowIcon" href="javascript:;" onclick="return showContentMenu([+id+],event);" title="'.$_lang['click_to_context'].'"><i class="'.$_style['icons_user'].'"></i></a>', |
|
155 | + 'template:<a href="index.php?a=12&id=[+id+]" title="'.$_lang['click_to_edit_title'].'">[+value+]</a>', |
|
156 | 156 | 'template:[+fullname+]', |
157 | 157 | 'template:[+role+]', |
158 | 158 | 'template:[+email+]', |
159 | 159 | 'template:[+gender+]', |
160 | 160 | 'template:[+blocked+]', |
161 | - 'date: ' . $modx->toDateFormat('[+thislogin+]', 'formatOnly') . ' %H:%M' |
|
161 | + 'date: '.$modx->toDateFormat('[+thislogin+]', 'formatOnly').' %H:%M' |
|
162 | 162 | )); |
163 | - if($listmode == '1') { |
|
163 | + if ($listmode == '1') { |
|
164 | 164 | $grd->pageSize = 0; |
165 | 165 | } |
166 | - if($_REQUEST['op'] == 'reset') { |
|
166 | + if ($_REQUEST['op'] == 'reset') { |
|
167 | 167 | $grd->pageNumber = 1; |
168 | 168 | } |
169 | 169 | // render grid |