@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if (!$modx->hasPermission('save_template')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
9 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
10 | 10 | $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0; |
11 | 11 | |
12 | 12 | $tbl_site_templates = $modx->getDatabase()->getFullTableName('site_templates'); |
@@ -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->getDatabase()->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'] ?> |
@@ -1,9 +1,9 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('edit_user')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | ?> |
@@ -18,14 +18,14 @@ discard block |
||
18 | 18 | <div class="form-group"><?= $_lang['role_management_msg'] ?> <a class="btn btn-secondary btn-sm" href="index.php?a=38"><i class="<?= $_style["actions_new"] ?> hide4desktop"></i> <?= $_lang['new_role'] ?></a></div> |
19 | 19 | <div class="form-group"> |
20 | 20 | <?php |
21 | - $rs = $modx->getDatabase()->select('name, id, description', $modx->getDatabase()->getFullTableName('user_roles'), '', 'name'); |
|
22 | - $limit = $modx->getDatabase()->getRecordCount($rs); |
|
23 | - if($limit < 1) { |
|
24 | - ?> |
|
21 | + $rs = $modx->getDatabase()->select('name, id, description', $modx->getDatabase()->getFullTableName('user_roles'), '', 'name'); |
|
22 | + $limit = $modx->getDatabase()->getRecordCount($rs); |
|
23 | + if($limit < 1) { |
|
24 | + ?> |
|
25 | 25 | <p><?= $_lang["no_records_found"] ?></p> |
26 | 26 | <?php |
27 | - } else { |
|
28 | - ?> |
|
27 | + } else { |
|
28 | + ?> |
|
29 | 29 | <div class="row"> |
30 | 30 | <div class="table-responsive"> |
31 | 31 | <table class="table data"> |
@@ -37,24 +37,24 @@ discard block |
||
37 | 37 | </thead> |
38 | 38 | <tbody> |
39 | 39 | <?php |
40 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
41 | - if($row['id'] == 1) { |
|
42 | - ?> |
|
40 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
41 | + if($row['id'] == 1) { |
|
42 | + ?> |
|
43 | 43 | <tr class="text-muted disabled"> |
44 | 44 | <td><b><?= $row['name'] ?></b></td> |
45 | 45 | <td><span><?= $_lang['administrator_role_message'] ?></span></td> |
46 | 46 | </tr> |
47 | 47 | <?php |
48 | - } else { |
|
49 | - ?> |
|
48 | + } else { |
|
49 | + ?> |
|
50 | 50 | <tr> |
51 | 51 | <td><a class="text-primary" href="index.php?id=<?= $row['id'] ?>&a=35"><?= $row['name'] ?></a></td> |
52 | 52 | <td><?= $row['description'] ?></td> |
53 | 53 | </tr> |
54 | 54 | <?php |
55 | - } |
|
56 | - } |
|
57 | - ?> |
|
55 | + } |
|
56 | + } |
|
57 | + ?> |
|
58 | 58 | </tbody> |
59 | 59 | </table> |
60 | 60 | </div> |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('edit_user')) { |
|
5 | +if (!$modx->hasPermission('edit_user')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | <?php |
21 | 21 | $rs = $modx->getDatabase()->select('name, id, description', $modx->getDatabase()->getFullTableName('user_roles'), '', 'name'); |
22 | 22 | $limit = $modx->getDatabase()->getRecordCount($rs); |
23 | - if($limit < 1) { |
|
23 | + if ($limit < 1) { |
|
24 | 24 | ?> |
25 | 25 | <p><?= $_lang["no_records_found"] ?></p> |
26 | 26 | <?php |
@@ -37,8 +37,8 @@ discard block |
||
37 | 37 | </thead> |
38 | 38 | <tbody> |
39 | 39 | <?php |
40 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
41 | - if($row['id'] == 1) { |
|
40 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
41 | + if ($row['id'] == 1) { |
|
42 | 42 | ?> |
43 | 43 | <tr class="text-muted disabled"> |
44 | 44 | <td><b><?= $row['name'] ?></b></td> |
@@ -1,12 +1,12 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('edit_template') && $modx->getManagerApi()->action == '301') { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | if(!$modx->hasPermission('new_template') && $modx->getManagerApi()->action == '300') { |
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | 10 | } |
11 | 11 | |
12 | 12 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -20,7 +20,7 @@ discard block |
||
20 | 20 | |
21 | 21 | // check to see the snippet editor isn't locked |
22 | 22 | if($lockedEl = $modx->elementIsLocked(2, $id)) { |
23 | - $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); |
|
23 | + $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); |
|
24 | 24 | } |
25 | 25 | // end check for lock |
26 | 26 | |
@@ -30,25 +30,25 @@ discard block |
||
30 | 30 | global $content; |
31 | 31 | $content = array(); |
32 | 32 | if(isset($_GET['id'])) { |
33 | - $rs = $modx->getDatabase()->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
|
34 | - $content = $modx->getDatabase()->getRow($rs); |
|
35 | - if(!$content) { |
|
36 | - header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); |
|
37 | - } |
|
38 | - |
|
39 | - $_SESSION['itemname'] = $content['caption']; |
|
40 | - if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
41 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
42 | - } |
|
33 | + $rs = $modx->getDatabase()->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
|
34 | + $content = $modx->getDatabase()->getRow($rs); |
|
35 | + if(!$content) { |
|
36 | + header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); |
|
37 | + } |
|
38 | + |
|
39 | + $_SESSION['itemname'] = $content['caption']; |
|
40 | + if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
41 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
42 | + } |
|
43 | 43 | } else if(isset($_REQUEST['itemname'])) { |
44 | - $content['name'] = $_REQUEST['itemname']; |
|
44 | + $content['name'] = $_REQUEST['itemname']; |
|
45 | 45 | } else { |
46 | - $_SESSION['itemname'] = $_lang["new_tmplvars"]; |
|
47 | - $content['category'] = (int)$_REQUEST['catid']; |
|
46 | + $_SESSION['itemname'] = $_lang["new_tmplvars"]; |
|
47 | + $content['category'] = (int)$_REQUEST['catid']; |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | if($modx->getManagerApi()->hasFormValues()) { |
51 | - $modx->getManagerApi()->loadFormValues(); |
|
51 | + $modx->getManagerApi()->loadFormValues(); |
|
52 | 52 | } |
53 | 53 | |
54 | 54 | $content = array_merge($content, $_POST); |
@@ -62,7 +62,7 @@ discard block |
||
62 | 62 | $RTEditors = ''; |
63 | 63 | $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1)); |
64 | 64 | if(is_array($evtOut)) { |
65 | - $RTEditors = implode(',', $evtOut); |
|
65 | + $RTEditors = implode(',', $evtOut); |
|
66 | 66 | } |
67 | 67 | |
68 | 68 | ?> |
@@ -277,12 +277,12 @@ discard block |
||
277 | 277 | |
278 | 278 | <form name="mutate" method="post" action="index.php" enctype="multipart/form-data"> |
279 | 279 | <?php |
280 | - // invoke OnTVFormPrerender event |
|
281 | - $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); |
|
282 | - if(is_array($evtOut)) { |
|
283 | - echo implode("", $evtOut); |
|
284 | - } |
|
285 | - ?> |
|
280 | + // invoke OnTVFormPrerender event |
|
281 | + $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); |
|
282 | + if(is_array($evtOut)) { |
|
283 | + echo implode("", $evtOut); |
|
284 | + } |
|
285 | + ?> |
|
286 | 286 | <input type="hidden" name="id" value="<?= $content['id'] ?>"> |
287 | 287 | <input type="hidden" name="a" value="302"> |
288 | 288 | <input type="hidden" name="or" value="<?= $origin ?>"> |
@@ -343,11 +343,11 @@ discard block |
||
343 | 343 | <select name="categoryid" class="form-control" onChange="documentDirty=true;"> |
344 | 344 | <option> </option> |
345 | 345 | <?php |
346 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
347 | - foreach(getCategories() as $n => $v) { |
|
348 | - echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>"; |
|
349 | - } |
|
350 | - ?> |
|
346 | + include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
347 | + foreach(getCategories() as $n => $v) { |
|
348 | + echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>"; |
|
349 | + } |
|
350 | + ?> |
|
351 | 351 | </select> |
352 | 352 | </div> |
353 | 353 | </div> |
@@ -383,14 +383,14 @@ discard block |
||
383 | 383 | <optgroup label="Custom Type"> |
384 | 384 | <option value="custom_tv" <?= ($content['type'] == 'custom_tv' ? "selected='selected'" : "") ?>>Custom Input</option> |
385 | 385 | <?php |
386 | - $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); |
|
387 | - foreach($custom_tvs as $ctv) { |
|
388 | - if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
389 | - $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); |
|
390 | - echo '<option value="custom_tv:' . $ctv . '" ' . $selected . '>' . $ctv . '</option>'; |
|
391 | - } |
|
392 | - } |
|
393 | - ?> |
|
386 | + $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); |
|
387 | + foreach($custom_tvs as $ctv) { |
|
388 | + if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
389 | + $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); |
|
390 | + echo '<option value="custom_tv:' . $ctv . '" ' . $selected . '>' . $ctv . '</option>'; |
|
391 | + } |
|
392 | + } |
|
393 | + ?> |
|
394 | 394 | </optgroup> |
395 | 395 | </select> |
396 | 396 | </div> |
@@ -455,63 +455,63 @@ discard block |
||
455 | 455 | <a class="btn btn-secondary btn-sm" href="javascript:;" onClick="check_toggle(); return false;"><?= $_lang['check_toggle'] ?></a> |
456 | 456 | </div> |
457 | 457 | <?php |
458 | - $rs = $modx->getDatabase()->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl |
|
458 | + $rs = $modx->getDatabase()->select(sprintf("tpl.id AS id, templatename, tpl.description AS tpldescription, tpl.locked AS tpllocked, tpl.selectable AS selectable, tmplvarid, if(isnull(cat.category),'%s',cat.category) AS category, cat.id AS catid", $_lang['no_category']), sprintf("%s as tpl |
|
459 | 459 | LEFT JOIN %s as stt ON stt.templateid=tpl.id AND stt.tmplvarid='%s' |
460 | 460 | LEFT JOIN %s as cat ON tpl.category=cat.id", $modx->getDatabase()->getFullTableName('site_templates'), $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), $id, $modx->getDatabase()->getFullTableName('categories')), '', "category, templatename"); |
461 | 461 | |
462 | - $tplList = '<ul>'; |
|
463 | - $preCat = ''; |
|
464 | - $insideUl = 0; |
|
465 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
466 | - $row['category'] = stripslashes($row['category']); //pixelchutes |
|
467 | - if($preCat !== $row['category']) { |
|
468 | - $tplList .= $insideUl ? '</ul>' : ''; |
|
469 | - $tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
470 | - $insideUl = 1; |
|
471 | - } |
|
472 | - |
|
473 | - if($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
474 | - $checked = true; |
|
475 | - } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
476 | - $checked = true; |
|
477 | - } elseif($id == 0 && is_array($_POST['template'])) { |
|
478 | - $checked = in_array($row['id'], $_POST['template']); |
|
479 | - } else { |
|
480 | - $checked = $row['tmplvarid']; |
|
481 | - } |
|
482 | - $selectable = !$row['selectable'] ? ' class="disabled"' : ''; |
|
483 | - $checked = $checked ? ' checked="checked"' : ''; |
|
484 | - $tplId = ' <small>(' . $row['id'] . ')</small>'; |
|
485 | - $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; |
|
486 | - |
|
487 | - $tplInfo = array(); |
|
488 | - if($row['tpllocked']) { |
|
489 | - $tplInfo[] = $_lang['locked']; |
|
490 | - } |
|
491 | - if($row['id'] == $modx->config['default_template']) { |
|
492 | - $tplInfo[] = $_lang['defaulttemplate_title']; |
|
493 | - } |
|
494 | - $tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : ''; |
|
495 | - |
|
496 | - $tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); |
|
497 | - $tplList .= '</li>'; |
|
498 | - |
|
499 | - $preCat = $row['category']; |
|
500 | - } |
|
501 | - $tplList .= $insideUl ? '</ul>' : ''; |
|
502 | - $tplList .= '</ul>'; |
|
503 | - echo $tplList; |
|
504 | - |
|
505 | - ?> |
|
462 | + $tplList = '<ul>'; |
|
463 | + $preCat = ''; |
|
464 | + $insideUl = 0; |
|
465 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
466 | + $row['category'] = stripslashes($row['category']); //pixelchutes |
|
467 | + if($preCat !== $row['category']) { |
|
468 | + $tplList .= $insideUl ? '</ul>' : ''; |
|
469 | + $tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
470 | + $insideUl = 1; |
|
471 | + } |
|
472 | + |
|
473 | + if($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
474 | + $checked = true; |
|
475 | + } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
476 | + $checked = true; |
|
477 | + } elseif($id == 0 && is_array($_POST['template'])) { |
|
478 | + $checked = in_array($row['id'], $_POST['template']); |
|
479 | + } else { |
|
480 | + $checked = $row['tmplvarid']; |
|
481 | + } |
|
482 | + $selectable = !$row['selectable'] ? ' class="disabled"' : ''; |
|
483 | + $checked = $checked ? ' checked="checked"' : ''; |
|
484 | + $tplId = ' <small>(' . $row['id'] . ')</small>'; |
|
485 | + $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; |
|
486 | + |
|
487 | + $tplInfo = array(); |
|
488 | + if($row['tpllocked']) { |
|
489 | + $tplInfo[] = $_lang['locked']; |
|
490 | + } |
|
491 | + if($row['id'] == $modx->config['default_template']) { |
|
492 | + $tplInfo[] = $_lang['defaulttemplate_title']; |
|
493 | + } |
|
494 | + $tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : ''; |
|
495 | + |
|
496 | + $tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); |
|
497 | + $tplList .= '</li>'; |
|
498 | + |
|
499 | + $preCat = $row['category']; |
|
500 | + } |
|
501 | + $tplList .= $insideUl ? '</ul>' : ''; |
|
502 | + $tplList .= '</ul>'; |
|
503 | + echo $tplList; |
|
504 | + |
|
505 | + ?> |
|
506 | 506 | |
507 | 507 | <!-- Access Permissions --> |
508 | 508 | <?php |
509 | - if($use_udperms == 1) { |
|
510 | - // fetch permissions for the variable |
|
511 | - $rs = $modx->getDatabase()->select('documentgroup', $modx->getDatabase()->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
|
512 | - $groupsarray = $modx->getDatabase()->getColumn('documentgroup', $rs); |
|
509 | + if($use_udperms == 1) { |
|
510 | + // fetch permissions for the variable |
|
511 | + $rs = $modx->getDatabase()->select('documentgroup', $modx->getDatabase()->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
|
512 | + $groupsarray = $modx->getDatabase()->getColumn('documentgroup', $rs); |
|
513 | 513 | |
514 | - ?> |
|
514 | + ?> |
|
515 | 515 | <?php if($modx->hasPermission('access_permissions')) { ?> |
516 | 516 | <script type="text/javascript"> |
517 | 517 | function makePublic(b) { |
@@ -539,29 +539,29 @@ discard block |
||
539 | 539 | <!--<b><?php /*echo $_lang['access_permissions']; */ ?></b>--> |
540 | 540 | <p><?= $_lang['tmplvar_access_msg'] ?></p> |
541 | 541 | <?php |
542 | - $chk = ''; |
|
543 | - $rs = $modx->getDatabase()->select('name, id', $tbl_documentgroup_names); |
|
544 | - if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
545 | - $groupsarray = $_POST['docgroups']; |
|
546 | - } |
|
547 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
548 | - $checked = in_array($row['id'], $groupsarray); |
|
549 | - if($modx->hasPermission('access_permissions')) { |
|
550 | - if($checked) { |
|
551 | - $notPublic = true; |
|
552 | - } |
|
553 | - $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>"; |
|
554 | - } else { |
|
555 | - if($checked) { |
|
556 | - echo "<input type='hidden' name='docgroups[]' value='" . $row['id'] . "' />"; |
|
557 | - } |
|
558 | - } |
|
559 | - } |
|
560 | - if($modx->hasPermission('access_permissions')) { |
|
561 | - $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks; |
|
562 | - } |
|
563 | - echo '<ul>' . $chks . '</ul>'; |
|
564 | - ?> |
|
542 | + $chk = ''; |
|
543 | + $rs = $modx->getDatabase()->select('name, id', $tbl_documentgroup_names); |
|
544 | + if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
545 | + $groupsarray = $_POST['docgroups']; |
|
546 | + } |
|
547 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
548 | + $checked = in_array($row['id'], $groupsarray); |
|
549 | + if($modx->hasPermission('access_permissions')) { |
|
550 | + if($checked) { |
|
551 | + $notPublic = true; |
|
552 | + } |
|
553 | + $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>"; |
|
554 | + } else { |
|
555 | + if($checked) { |
|
556 | + echo "<input type='hidden' name='docgroups[]' value='" . $row['id'] . "' />"; |
|
557 | + } |
|
558 | + } |
|
559 | + } |
|
560 | + if($modx->hasPermission('access_permissions')) { |
|
561 | + $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks; |
|
562 | + } |
|
563 | + echo '<ul>' . $chks . '</ul>'; |
|
564 | + ?> |
|
565 | 565 | <?php } ?> |
566 | 566 | <?php } ?> |
567 | 567 | |
@@ -571,12 +571,12 @@ discard block |
||
571 | 571 | <input type="submit" name="save" style="display:none"> |
572 | 572 | |
573 | 573 | <?php |
574 | - // invoke OnTVFormRender event |
|
575 | - $evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id)); |
|
576 | - if(is_array($evtOut)) { |
|
577 | - echo implode('', $evtOut); |
|
578 | - } |
|
579 | - ?> |
|
574 | + // invoke OnTVFormRender event |
|
575 | + $evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id)); |
|
576 | + if(is_array($evtOut)) { |
|
577 | + echo implode('', $evtOut); |
|
578 | + } |
|
579 | + ?> |
|
580 | 580 | </div> |
581 | 581 | </form> |
582 | 582 | <script type="text/javascript">setTimeout('showParameters()', 10);</script> |
@@ -1,17 +1,17 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('edit_template') && $modx->getManagerApi()->action == '301') { |
|
5 | +if (!$modx->hasPermission('edit_template') && $modx->getManagerApi()->action == '301') { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | -if(!$modx->hasPermission('new_template') && $modx->getManagerApi()->action == '300') { |
|
8 | +if (!$modx->hasPermission('new_template') && $modx->getManagerApi()->action == '300') { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | |
12 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
13 | -$origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76; |
|
14 | -$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : NULL; |
|
12 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
13 | +$origin = isset($_REQUEST['or']) ? (int) $_REQUEST['or'] : 76; |
|
14 | +$originId = isset($_REQUEST['oid']) ? (int) $_REQUEST['oid'] : NULL; |
|
15 | 15 | |
16 | 16 | $tbl_site_tmplvars = $modx->getDatabase()->getFullTableName('site_tmplvars'); |
17 | 17 | $tbl_site_templates = $modx->getDatabase()->getFullTableName('site_templates'); |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | $tbl_documentgroup_names = $modx->getDatabase()->getFullTableName('documentgroup_names'); |
20 | 20 | |
21 | 21 | // check to see the snippet editor isn't locked |
22 | -if($lockedEl = $modx->elementIsLocked(2, $id)) { |
|
22 | +if ($lockedEl = $modx->elementIsLocked(2, $id)) { |
|
23 | 23 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['tmplvar'])); |
24 | 24 | } |
25 | 25 | // end check for lock |
@@ -29,25 +29,25 @@ discard block |
||
29 | 29 | |
30 | 30 | global $content; |
31 | 31 | $content = array(); |
32 | -if(isset($_GET['id'])) { |
|
32 | +if (isset($_GET['id'])) { |
|
33 | 33 | $rs = $modx->getDatabase()->select('*', $tbl_site_tmplvars, "id='{$id}'"); |
34 | 34 | $content = $modx->getDatabase()->getRow($rs); |
35 | - if(!$content) { |
|
36 | - header("Location: " . MODX_SITE_URL . "index.php?id={$site_start}"); |
|
35 | + if (!$content) { |
|
36 | + header("Location: ".MODX_SITE_URL."index.php?id={$site_start}"); |
|
37 | 37 | } |
38 | 38 | |
39 | 39 | $_SESSION['itemname'] = $content['caption']; |
40 | - if($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
40 | + if ($content['locked'] == 1 && $modx->hasPermission('save_role') != 1) { |
|
41 | 41 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
42 | 42 | } |
43 | -} else if(isset($_REQUEST['itemname'])) { |
|
43 | +} else if (isset($_REQUEST['itemname'])) { |
|
44 | 44 | $content['name'] = $_REQUEST['itemname']; |
45 | 45 | } else { |
46 | 46 | $_SESSION['itemname'] = $_lang["new_tmplvars"]; |
47 | - $content['category'] = (int)$_REQUEST['catid']; |
|
47 | + $content['category'] = (int) $_REQUEST['catid']; |
|
48 | 48 | } |
49 | 49 | |
50 | -if($modx->getManagerApi()->hasFormValues()) { |
|
50 | +if ($modx->getManagerApi()->hasFormValues()) { |
|
51 | 51 | $modx->getManagerApi()->loadFormValues(); |
52 | 52 | } |
53 | 53 | |
@@ -56,12 +56,12 @@ discard block |
||
56 | 56 | // Add lock-element JS-Script |
57 | 57 | $lockElementId = $id; |
58 | 58 | $lockElementType = 2; |
59 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
59 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
60 | 60 | |
61 | 61 | // get available RichText Editors |
62 | 62 | $RTEditors = ''; |
63 | 63 | $evtOut = $modx->invokeEvent('OnRichTextEditorRegister', array('forfrontend' => 1)); |
64 | -if(is_array($evtOut)) { |
|
64 | +if (is_array($evtOut)) { |
|
65 | 65 | $RTEditors = implode(',', $evtOut); |
66 | 66 | } |
67 | 67 | |
@@ -107,7 +107,7 @@ discard block |
||
107 | 107 | }, |
108 | 108 | cancel: function() { |
109 | 109 | documentDirty = false; |
110 | - document.location.href = 'index.php?a=<?= $origin ?><?=(empty($originId) ? '' : '&id=' . $originId) ?>'; |
|
110 | + document.location.href = 'index.php?a=<?= $origin ?><?=(empty($originId) ? '' : '&id='.$originId) ?>'; |
|
111 | 111 | } |
112 | 112 | }; |
113 | 113 | |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | <?php |
280 | 280 | // invoke OnTVFormPrerender event |
281 | 281 | $evtOut = $modx->invokeEvent('OnTVFormPrerender', array('id' => $id)); |
282 | - if(is_array($evtOut)) { |
|
282 | + if (is_array($evtOut)) { |
|
283 | 283 | echo implode("", $evtOut); |
284 | 284 | } |
285 | 285 | ?> |
@@ -291,7 +291,7 @@ discard block |
||
291 | 291 | <input type="hidden" name="params" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['display_params']) ?>"> |
292 | 292 | |
293 | 293 | <h1> |
294 | - <i class="fa fa-list-alt"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_tmplvars']) ?><i class="fa fa-question-circle help"></i> |
|
294 | + <i class="fa fa-list-alt"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_tmplvars']) ?><i class="fa fa-question-circle help"></i> |
|
295 | 295 | </h1> |
296 | 296 | |
297 | 297 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -314,8 +314,8 @@ discard block |
||
314 | 314 | <div class="col-md-9 col-lg-10"> |
315 | 315 | <div class="form-control-name clearfix"> |
316 | 316 | <input name="name" type="text" maxlength="50" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
317 | - <?php if($modx->hasPermission('save_role')): ?> |
|
318 | - <label class="custom-control" title="<?= $_lang['lock_tmplvars'] . "\n" . $_lang['lock_tmplvars_msg'] ?>" tooltip> |
|
317 | + <?php if ($modx->hasPermission('save_role')): ?> |
|
318 | + <label class="custom-control" title="<?= $_lang['lock_tmplvars']."\n".$_lang['lock_tmplvars_msg'] ?>" tooltip> |
|
319 | 319 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
320 | 320 | <i class="fa fa-lock"></i> |
321 | 321 | </label> |
@@ -343,9 +343,9 @@ discard block |
||
343 | 343 | <select name="categoryid" class="form-control" onChange="documentDirty=true;"> |
344 | 344 | <option> </option> |
345 | 345 | <?php |
346 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
347 | - foreach(getCategories() as $n => $v) { |
|
348 | - echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>"; |
|
346 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
347 | + foreach (getCategories() as $n => $v) { |
|
348 | + echo "<option value='".$v['id']."'".($content["category"] == $v["id"] ? " selected='selected'" : "").">".$modx->getPhpCompat()->htmlspecialchars($v["category"])."</option>"; |
|
349 | 349 | } |
350 | 350 | ?> |
351 | 351 | </select> |
@@ -383,11 +383,11 @@ discard block |
||
383 | 383 | <optgroup label="Custom Type"> |
384 | 384 | <option value="custom_tv" <?= ($content['type'] == 'custom_tv' ? "selected='selected'" : "") ?>>Custom Input</option> |
385 | 385 | <?php |
386 | - $custom_tvs = scandir(MODX_BASE_PATH . 'assets/tvs'); |
|
387 | - foreach($custom_tvs as $ctv) { |
|
388 | - if(strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
389 | - $selected = ($content['type'] == 'custom_tv:' . $ctv ? "selected='selected'" : ""); |
|
390 | - echo '<option value="custom_tv:' . $ctv . '" ' . $selected . '>' . $ctv . '</option>'; |
|
386 | + $custom_tvs = scandir(MODX_BASE_PATH.'assets/tvs'); |
|
387 | + foreach ($custom_tvs as $ctv) { |
|
388 | + if (strpos($ctv, '.') !== 0 && $ctv != 'index.html') { |
|
389 | + $selected = ($content['type'] == 'custom_tv:'.$ctv ? "selected='selected'" : ""); |
|
390 | + echo '<option value="custom_tv:'.$ctv.'" '.$selected.'>'.$ctv.'</option>'; |
|
391 | 391 | } |
392 | 392 | } |
393 | 393 | ?> |
@@ -462,36 +462,36 @@ discard block |
||
462 | 462 | $tplList = '<ul>'; |
463 | 463 | $preCat = ''; |
464 | 464 | $insideUl = 0; |
465 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
465 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
466 | 466 | $row['category'] = stripslashes($row['category']); //pixelchutes |
467 | - if($preCat !== $row['category']) { |
|
467 | + if ($preCat !== $row['category']) { |
|
468 | 468 | $tplList .= $insideUl ? '</ul>' : ''; |
469 | - $tplList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
469 | + $tplList .= '<li><strong>'.$row['category'].($row['catid'] != '' ? ' <small>('.$row['catid'].')</small>' : '').'</strong><ul>'; |
|
470 | 470 | $insideUl = 1; |
471 | 471 | } |
472 | 472 | |
473 | - if($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
473 | + if ($modx->getManagerApi()->action == '300' && $modx->config['default_template'] == $row['id']) { |
|
474 | 474 | $checked = true; |
475 | - } elseif(isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
475 | + } elseif (isset($_GET['tpl']) && $_GET['tpl'] == $row['id']) { |
|
476 | 476 | $checked = true; |
477 | - } elseif($id == 0 && is_array($_POST['template'])) { |
|
477 | + } elseif ($id == 0 && is_array($_POST['template'])) { |
|
478 | 478 | $checked = in_array($row['id'], $_POST['template']); |
479 | 479 | } else { |
480 | 480 | $checked = $row['tmplvarid']; |
481 | 481 | } |
482 | 482 | $selectable = !$row['selectable'] ? ' class="disabled"' : ''; |
483 | 483 | $checked = $checked ? ' checked="checked"' : ''; |
484 | - $tplId = ' <small>(' . $row['id'] . ')</small>'; |
|
485 | - $desc = !empty($row['tpldescription']) ? ' - ' . $row['tpldescription'] : ''; |
|
484 | + $tplId = ' <small>('.$row['id'].')</small>'; |
|
485 | + $desc = !empty($row['tpldescription']) ? ' - '.$row['tpldescription'] : ''; |
|
486 | 486 | |
487 | 487 | $tplInfo = array(); |
488 | - if($row['tpllocked']) { |
|
488 | + if ($row['tpllocked']) { |
|
489 | 489 | $tplInfo[] = $_lang['locked']; |
490 | 490 | } |
491 | - if($row['id'] == $modx->config['default_template']) { |
|
491 | + if ($row['id'] == $modx->config['default_template']) { |
|
492 | 492 | $tplInfo[] = $_lang['defaulttemplate_title']; |
493 | 493 | } |
494 | - $tplInfo = !empty($tplInfo) ? ' <em>(' . implode(', ', $tplInfo) . ')</em>' : ''; |
|
494 | + $tplInfo = !empty($tplInfo) ? ' <em>('.implode(', ', $tplInfo).')</em>' : ''; |
|
495 | 495 | |
496 | 496 | $tplList .= sprintf('<li><label%s><input name="template[]" value="%s" type="checkbox" %s onchange="documentDirty=true;"> %s%s%s%s</label></li>', $selectable, $row['id'], $checked, $row['templatename'], $tplId, $desc, $tplInfo); |
497 | 497 | $tplList .= '</li>'; |
@@ -506,13 +506,13 @@ discard block |
||
506 | 506 | |
507 | 507 | <!-- Access Permissions --> |
508 | 508 | <?php |
509 | - if($use_udperms == 1) { |
|
509 | + if ($use_udperms == 1) { |
|
510 | 510 | // fetch permissions for the variable |
511 | 511 | $rs = $modx->getDatabase()->select('documentgroup', $modx->getDatabase()->getFullTableName('site_tmplvar_access'), "tmplvarid='{$id}'"); |
512 | 512 | $groupsarray = $modx->getDatabase()->getColumn('documentgroup', $rs); |
513 | 513 | |
514 | 514 | ?> |
515 | - <?php if($modx->hasPermission('access_permissions')) { ?> |
|
515 | + <?php if ($modx->hasPermission('access_permissions')) { ?> |
|
516 | 516 | <script type="text/javascript"> |
517 | 517 | function makePublic(b) { |
518 | 518 | var notPublic = false; |
@@ -541,26 +541,26 @@ discard block |
||
541 | 541 | <?php |
542 | 542 | $chk = ''; |
543 | 543 | $rs = $modx->getDatabase()->select('name, id', $tbl_documentgroup_names); |
544 | - if(empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
544 | + if (empty($groupsarray) && is_array($_POST['docgroups']) && empty($_POST['id'])) { |
|
545 | 545 | $groupsarray = $_POST['docgroups']; |
546 | 546 | } |
547 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
547 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
548 | 548 | $checked = in_array($row['id'], $groupsarray); |
549 | - if($modx->hasPermission('access_permissions')) { |
|
550 | - if($checked) { |
|
549 | + if ($modx->hasPermission('access_permissions')) { |
|
550 | + if ($checked) { |
|
551 | 551 | $notPublic = true; |
552 | 552 | } |
553 | - $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='" . $row['id'] . "' " . ($checked ? "checked='checked'" : '') . " onclick=\"makePublic(false)\" /> " . $row['name'] . "</label></li>"; |
|
553 | + $chks .= "<li><label><input type='checkbox' name='docgroups[]' value='".$row['id']."' ".($checked ? "checked='checked'" : '')." onclick=\"makePublic(false)\" /> ".$row['name']."</label></li>"; |
|
554 | 554 | } else { |
555 | - if($checked) { |
|
556 | - echo "<input type='hidden' name='docgroups[]' value='" . $row['id'] . "' />"; |
|
555 | + if ($checked) { |
|
556 | + echo "<input type='hidden' name='docgroups[]' value='".$row['id']."' />"; |
|
557 | 557 | } |
558 | 558 | } |
559 | 559 | } |
560 | - if($modx->hasPermission('access_permissions')) { |
|
561 | - $chks = "<li><label><input type='checkbox' name='chkalldocs' " . (!$notPublic ? "checked='checked'" : '') . " onclick=\"makePublic(true)\" /> <span class='warning'>" . $_lang['all_doc_groups'] . "</span></label></li>" . $chks; |
|
560 | + if ($modx->hasPermission('access_permissions')) { |
|
561 | + $chks = "<li><label><input type='checkbox' name='chkalldocs' ".(!$notPublic ? "checked='checked'" : '')." onclick=\"makePublic(true)\" /> <span class='warning'>".$_lang['all_doc_groups']."</span></label></li>".$chks; |
|
562 | 562 | } |
563 | - echo '<ul>' . $chks . '</ul>'; |
|
563 | + echo '<ul>'.$chks.'</ul>'; |
|
564 | 564 | ?> |
565 | 565 | <?php } ?> |
566 | 566 | <?php } ?> |
@@ -573,7 +573,7 @@ discard block |
||
573 | 573 | <?php |
574 | 574 | // invoke OnTVFormRender event |
575 | 575 | $evtOut = $modx->invokeEvent('OnTVFormRender', array('id' => $id)); |
576 | - if(is_array($evtOut)) { |
|
576 | + if (is_array($evtOut)) { |
|
577 | 577 | echo implode('', $evtOut); |
578 | 578 | } |
579 | 579 | ?> |
@@ -11,7 +11,7 @@ |
||
11 | 11 | |
12 | 12 | $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
13 | 13 | $origin = isset($_REQUEST['or']) ? (int)$_REQUEST['or'] : 76; |
14 | -$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : NULL; |
|
14 | +$originId = isset($_REQUEST['oid']) ? (int)$_REQUEST['oid'] : null; |
|
15 | 15 | |
16 | 16 | $tbl_site_tmplvars = $modx->getDatabase()->getFullTableName('site_tmplvars'); |
17 | 17 | $tbl_site_templates = $modx->getDatabase()->getFullTableName('site_templates'); |
@@ -1,21 +1,21 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | |
6 | 6 | switch($modx->getManagerApi()->action) { |
7 | - case 88: |
|
8 | - if(!$modx->hasPermission('edit_web_user')) { |
|
9 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | - } |
|
11 | - break; |
|
12 | - case 87: |
|
13 | - if(!$modx->hasPermission('new_web_user')) { |
|
14 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | - } |
|
16 | - break; |
|
17 | - default: |
|
18 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | + case 88: |
|
8 | + if(!$modx->hasPermission('edit_web_user')) { |
|
9 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
10 | + } |
|
11 | + break; |
|
12 | + case 87: |
|
13 | + if(!$modx->hasPermission('new_web_user')) { |
|
14 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
15 | + } |
|
16 | + break; |
|
17 | + default: |
|
18 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
@@ -24,64 +24,64 @@ discard block |
||
24 | 24 | // check to see the snippet editor isn't locked |
25 | 25 | $rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
26 | 26 | if($username = $modx->getDatabase()->getValue($rs)) { |
27 | - $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); |
|
27 | + $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "web user")); |
|
28 | 28 | } |
29 | 29 | // end check for lock |
30 | 30 | |
31 | 31 | if($modx->getManagerApi()->action == '88') { |
32 | - // get user attributes |
|
33 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); |
|
34 | - $userdata = $modx->getDatabase()->getRow($rs); |
|
35 | - if(!$userdata) { |
|
36 | - $modx->webAlertAndQuit("No user returned!"); |
|
37 | - } |
|
38 | - |
|
39 | - // get user settings |
|
40 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_user_settings'), "webuser = '{$user}'"); |
|
41 | - $usersettings = array(); |
|
42 | - while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
43 | - extract($usersettings, EXTR_OVERWRITE); |
|
44 | - |
|
45 | - // get user name |
|
46 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_users'), "id = '{$user}'"); |
|
47 | - $usernamedata = $modx->getDatabase()->getRow($rs); |
|
48 | - if(!$usernamedata) { |
|
49 | - $modx->webAlertAndQuit("No user returned while getting username!"); |
|
50 | - } |
|
51 | - $_SESSION['itemname'] = $usernamedata['username']; |
|
32 | + // get user attributes |
|
33 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); |
|
34 | + $userdata = $modx->getDatabase()->getRow($rs); |
|
35 | + if(!$userdata) { |
|
36 | + $modx->webAlertAndQuit("No user returned!"); |
|
37 | + } |
|
38 | + |
|
39 | + // get user settings |
|
40 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_user_settings'), "webuser = '{$user}'"); |
|
41 | + $usersettings = array(); |
|
42 | + while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
43 | + extract($usersettings, EXTR_OVERWRITE); |
|
44 | + |
|
45 | + // get user name |
|
46 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_users'), "id = '{$user}'"); |
|
47 | + $usernamedata = $modx->getDatabase()->getRow($rs); |
|
48 | + if(!$usernamedata) { |
|
49 | + $modx->webAlertAndQuit("No user returned while getting username!"); |
|
50 | + } |
|
51 | + $_SESSION['itemname'] = $usernamedata['username']; |
|
52 | 52 | } else { |
53 | - $userdata = array(); |
|
54 | - $usersettings = array(); |
|
55 | - $usernamedata = array(); |
|
56 | - $_SESSION['itemname'] = $_lang["new_web_user"]; |
|
53 | + $userdata = array(); |
|
54 | + $usersettings = array(); |
|
55 | + $usernamedata = array(); |
|
56 | + $_SESSION['itemname'] = $_lang["new_web_user"]; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | // avoid doubling htmlspecialchars (already encoded in DB) |
60 | 60 | foreach($userdata as $key => $val) { |
61 | - $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
|
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 | 67 | if($modx->getManagerApi()->hasFormValues()) { |
68 | - $modx->getManagerApi()->loadFormValues(); |
|
69 | - // restore post values |
|
70 | - $userdata = array_merge($userdata, $_POST); |
|
71 | - $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
72 | - $usernamedata['username'] = $userdata['newusername']; |
|
73 | - $usernamedata['oldusername'] = $_POST['oldusername']; |
|
74 | - $usersettings = array_merge($usersettings, $userdata); |
|
75 | - $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
76 | - extract($usersettings, EXTR_OVERWRITE); |
|
68 | + $modx->getManagerApi()->loadFormValues(); |
|
69 | + // restore post values |
|
70 | + $userdata = array_merge($userdata, $_POST); |
|
71 | + $userdata['dob'] = $modx->toTimeStamp($userdata['dob']); |
|
72 | + $usernamedata['username'] = $userdata['newusername']; |
|
73 | + $usernamedata['oldusername'] = $_POST['oldusername']; |
|
74 | + $usersettings = array_merge($usersettings, $userdata); |
|
75 | + $usersettings['allowed_days'] = is_array($_POST['allowed_days']) ? implode(",", $_POST['allowed_days']) : ""; |
|
76 | + extract($usersettings, EXTR_OVERWRITE); |
|
77 | 77 | } |
78 | 78 | |
79 | 79 | // include the country list language file |
80 | 80 | $_country_lang = array(); |
81 | 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"; |
|
82 | + include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
83 | 83 | } else { |
84 | - include_once "lang/country/english_country.inc.php"; |
|
84 | + include_once "lang/country/english_country.inc.php"; |
|
85 | 85 | } |
86 | 86 | asort($_country_lang); |
87 | 87 | |
@@ -189,12 +189,12 @@ discard block |
||
189 | 189 | |
190 | 190 | <form action="index.php?a=89" method="post" name="userform"> |
191 | 191 | <?php |
192 | - // invoke OnWUsrFormPrerender event |
|
193 | - $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); |
|
194 | - if(is_array($evtOut)) { |
|
195 | - echo implode("", $evtOut); |
|
196 | - } |
|
197 | - ?> |
|
192 | + // invoke OnWUsrFormPrerender event |
|
193 | + $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); |
|
194 | + if(is_array($evtOut)) { |
|
195 | + echo implode("", $evtOut); |
|
196 | + } |
|
197 | + ?> |
|
198 | 198 | <input type="hidden" name="mode" value="<?php echo $modx->getManagerApi()->action; ?>" /> |
199 | 199 | <input type="hidden" name="id" value="<?php echo $user ?>" /> |
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" ?>" /> |
@@ -324,10 +324,10 @@ 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>"; |
|
329 | - } |
|
330 | - ?> |
|
327 | + foreach($_country_lang as $key => $country) { |
|
328 | + echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
329 | + } |
|
330 | + ?> |
|
331 | 331 | </select></td> |
332 | 332 | </tr> |
333 | 333 | <tr> |
@@ -387,8 +387,8 @@ discard block |
||
387 | 387 | <i onClick="document.userform.blockedafter.value=''; return true;" class="clearDate <?php echo $_style["actions_calendar_delete"] ?>" data-tooltip="<?php echo $_lang['remove_date']; ?>"></i></td> |
388 | 388 | </tr> |
389 | 389 | <?php |
390 | - } |
|
391 | - ?> |
|
390 | + } |
|
391 | + ?> |
|
392 | 392 | </table> |
393 | 393 | </div> |
394 | 394 | |
@@ -496,40 +496,40 @@ discard block |
||
496 | 496 | </table> |
497 | 497 | </div> |
498 | 498 | <?php |
499 | - if($use_udperms == 1) { |
|
500 | - |
|
501 | - $groupsarray = array(); |
|
502 | - |
|
503 | - if($modx->getManagerApi()->action == '88') { // only do this bit if the user is being edited |
|
504 | - $rs = $modx->getDatabase()->select('webgroup', $modx->getDatabase()->getFullTableName('web_groups'), "webuser='{$user}'"); |
|
505 | - $groupsarray = $modx->getDatabase()->getColumn('webgroup', $rs); |
|
506 | - } |
|
507 | - // retain selected user groups between post |
|
508 | - if(is_array($_POST['user_groups'])) { |
|
509 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
510 | - } |
|
511 | - ?> |
|
499 | + if($use_udperms == 1) { |
|
500 | + |
|
501 | + $groupsarray = array(); |
|
502 | + |
|
503 | + if($modx->getManagerApi()->action == '88') { // only do this bit if the user is being edited |
|
504 | + $rs = $modx->getDatabase()->select('webgroup', $modx->getDatabase()->getFullTableName('web_groups'), "webuser='{$user}'"); |
|
505 | + $groupsarray = $modx->getDatabase()->getColumn('webgroup', $rs); |
|
506 | + } |
|
507 | + // retain selected user groups between post |
|
508 | + if(is_array($_POST['user_groups'])) { |
|
509 | + foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
510 | + } |
|
511 | + ?> |
|
512 | 512 | <div class="tab-page" id="tabPermissions"> |
513 | 513 | <h2 class="tab"><?php echo $_lang['web_access_permissions'] ?></h2> |
514 | 514 | <script type="text/javascript">tpUser.addTabPage(document.getElementById("tabPermissions"));</script> |
515 | 515 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
516 | 516 | <?php |
517 | - $rs = $modx->getDatabase()->select('name, id', $modx->getDatabase()->getFullTableName('webgroup_names'), '', 'name'); |
|
518 | - while($row = $modx->getDatabase()->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 | - } |
|
521 | - } |
|
522 | - ?> |
|
517 | + $rs = $modx->getDatabase()->select('name, id', $modx->getDatabase()->getFullTableName('webgroup_names'), '', 'name'); |
|
518 | + while($row = $modx->getDatabase()->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 | + } |
|
521 | + } |
|
522 | + ?> |
|
523 | 523 | </div> |
524 | 524 | <?php |
525 | - // invoke OnWUsrFormRender event |
|
526 | - $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( |
|
527 | - "id" => $user |
|
528 | - )); |
|
529 | - if(is_array($evtOut)) { |
|
530 | - echo implode("", $evtOut); |
|
531 | - } |
|
532 | - ?> |
|
525 | + // invoke OnWUsrFormRender event |
|
526 | + $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( |
|
527 | + "id" => $user |
|
528 | + )); |
|
529 | + if(is_array($evtOut)) { |
|
530 | + echo implode("", $evtOut); |
|
531 | + } |
|
532 | + ?> |
|
533 | 533 | </div> |
534 | 534 | </div> |
535 | 535 | <input type="submit" name="save" style="display:none"> |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | -switch($modx->getManagerApi()->action) { |
|
6 | +switch ($modx->getManagerApi()->action) { |
|
7 | 7 | case 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; |
@@ -18,34 +18,34 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$user = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | |
24 | 24 | // check to see the snippet editor isn't locked |
25 | -$rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
26 | -if($username = $modx->getDatabase()->getValue($rs)) { |
|
25 | +$rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
26 | +if ($username = $modx->getDatabase()->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->getManagerApi()->action == '88') { |
|
31 | +if ($modx->getManagerApi()->action == '88') { |
|
32 | 32 | // get user attributes |
33 | 33 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); |
34 | 34 | $userdata = $modx->getDatabase()->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->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_user_settings'), "webuser = '{$user}'"); |
41 | 41 | $usersettings = array(); |
42 | - while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
42 | + while ($row = $modx->getDatabase()->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->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_users'), "id = '{$user}'"); |
47 | 47 | $usernamedata = $modx->getDatabase()->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->getManagerApi()->hasFormValues()) { |
|
67 | +if ($modx->getManagerApi()->hasFormValues()) { |
|
68 | 68 | $modx->getManagerApi()->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->getManagerApi()->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->getPhpCompat()->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?></b> - <span class="comment"><a href="javascript:;" onClick="changeName();return false;"><?php echo $_lang["change_name"]; ?></a></span> |
230 | 230 | <input type="hidden" name="oldusername" value="<?php echo $modx->getPhpCompat()->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->getPhpCompat()->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->getManagerApi()->action == '87' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th> |
|
240 | + <th><?php echo $modx->getManagerApi()->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->getManagerApi()->action == "87" ? " checked disabled" : ""; ?>> |
243 | 243 | <input type="hidden" name="newpassword" value="<?php echo $modx->getManagerApi()->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->getPhpCompat()->htmlspecialchars(isset($_POST['comment']) ? $_POST['comment'] : $userdata['comment']); ?></textarea></td> |
353 | 353 | </tr> |
354 | - <?php if($modx->getManagerApi()->action == '88') { ?> |
|
354 | + <?php if ($modx->getManagerApi()->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->getManagerApi()->action == '88') { // only do this bit if the user is being edited |
|
503 | + if ($modx->getManagerApi()->action == '88') { // only do this bit if the user is being edited |
|
504 | 504 | $rs = $modx->getDatabase()->select('webgroup', $modx->getDatabase()->getFullTableName('web_groups'), "webuser='{$user}'"); |
505 | 505 | $groupsarray = $modx->getDatabase()->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->getDatabase()->select('name, id', $modx->getDatabase()->getFullTableName('webgroup_names'), '', 'name'); |
518 | - while($row = $modx->getDatabase()->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->getDatabase()->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 | ?> |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | -switch($modx->getManagerApi()->action) { |
|
6 | +switch($modx->getManagerApi()->action) { |
|
7 | 7 | case 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; |
@@ -23,33 +23,35 @@ discard block |
||
23 | 23 | |
24 | 24 | // check to see the snippet editor isn't locked |
25 | 25 | $rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=88 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
26 | -if($username = $modx->getDatabase()->getValue($rs)) { |
|
26 | +if($username = $modx->getDatabase()->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->getManagerApi()->action == '88') { |
|
31 | +if($modx->getManagerApi()->action == '88') { |
|
32 | 32 | // get user attributes |
33 | 33 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_user_attributes'), "internalKey = '{$user}'"); |
34 | 34 | $userdata = $modx->getDatabase()->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->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_user_settings'), "webuser = '{$user}'"); |
41 | 41 | $usersettings = array(); |
42 | - while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
42 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
43 | + $usersettings[$row['setting_name']] = $row['setting_value']; |
|
44 | + } |
|
43 | 45 | extract($usersettings, EXTR_OVERWRITE); |
44 | 46 | |
45 | 47 | // get user name |
46 | 48 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('web_users'), "id = '{$user}'"); |
47 | 49 | $usernamedata = $modx->getDatabase()->getRow($rs); |
48 | - if(!$usernamedata) { |
|
50 | + if(!$usernamedata) { |
|
49 | 51 | $modx->webAlertAndQuit("No user returned while getting username!"); |
50 | 52 | } |
51 | 53 | $_SESSION['itemname'] = $usernamedata['username']; |
52 | -} else { |
|
54 | +} else { |
|
53 | 55 | $userdata = array(); |
54 | 56 | $usersettings = array(); |
55 | 57 | $usernamedata = array(); |
@@ -57,14 +59,14 @@ discard block |
||
57 | 59 | } |
58 | 60 | |
59 | 61 | // avoid doubling htmlspecialchars (already encoded in DB) |
60 | -foreach($userdata as $key => $val) { |
|
62 | +foreach($userdata as $key => $val) { |
|
61 | 63 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
62 | 64 | }; |
63 | 65 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
64 | 66 | |
65 | 67 | // restore saved form |
66 | 68 | $formRestored = false; |
67 | -if($modx->getManagerApi()->hasFormValues()) { |
|
69 | +if($modx->getManagerApi()->hasFormValues()) { |
|
68 | 70 | $modx->getManagerApi()->loadFormValues(); |
69 | 71 | // restore post values |
70 | 72 | $userdata = array_merge($userdata, $_POST); |
@@ -78,9 +80,9 @@ discard block |
||
78 | 80 | |
79 | 81 | // include the country list language file |
80 | 82 | $_country_lang = array(); |
81 | -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
83 | +if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
82 | 84 | include_once "lang/country/" . $manager_language . "_country.inc.php"; |
83 | -} else { |
|
85 | +} else { |
|
84 | 86 | include_once "lang/country/english_country.inc.php"; |
85 | 87 | } |
86 | 88 | asort($_country_lang); |
@@ -191,7 +193,7 @@ discard block |
||
191 | 193 | <?php |
192 | 194 | // invoke OnWUsrFormPrerender event |
193 | 195 | $evtOut = $modx->invokeEvent("OnWUsrFormPrerender", array("id" => $user)); |
194 | - if(is_array($evtOut)) { |
|
196 | + if(is_array($evtOut)) { |
|
195 | 197 | echo implode("", $evtOut); |
196 | 198 | } |
197 | 199 | ?> |
@@ -324,7 +326,7 @@ discard block |
||
324 | 326 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
325 | 327 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
326 | 328 | <?php |
327 | - foreach($_country_lang as $key => $country) { |
|
329 | + foreach($_country_lang as $key => $country) { |
|
328 | 330 | echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
329 | 331 | } |
330 | 332 | ?> |
@@ -496,17 +498,20 @@ discard block |
||
496 | 498 | </table> |
497 | 499 | </div> |
498 | 500 | <?php |
499 | - if($use_udperms == 1) { |
|
501 | + if($use_udperms == 1) { |
|
500 | 502 | |
501 | 503 | $groupsarray = array(); |
502 | 504 | |
503 | - if($modx->getManagerApi()->action == '88') { // only do this bit if the user is being edited |
|
505 | + if($modx->getManagerApi()->action == '88') { |
|
506 | +// only do this bit if the user is being edited |
|
504 | 507 | $rs = $modx->getDatabase()->select('webgroup', $modx->getDatabase()->getFullTableName('web_groups'), "webuser='{$user}'"); |
505 | 508 | $groupsarray = $modx->getDatabase()->getColumn('webgroup', $rs); |
506 | 509 | } |
507 | 510 | // retain selected user groups between post |
508 | - if(is_array($_POST['user_groups'])) { |
|
509 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
511 | + if(is_array($_POST['user_groups'])) { |
|
512 | + foreach($_POST['user_groups'] as $n => $v) { |
|
513 | + $groupsarray[] = $v; |
|
514 | + } |
|
510 | 515 | } |
511 | 516 | ?> |
512 | 517 | <div class="tab-page" id="tabPermissions"> |
@@ -515,7 +520,7 @@ discard block |
||
515 | 520 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
516 | 521 | <?php |
517 | 522 | $rs = $modx->getDatabase()->select('name, id', $modx->getDatabase()->getFullTableName('webgroup_names'), '', 'name'); |
518 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
523 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
519 | 524 | echo '<label><input type="checkbox" name="user_groups[]" value="' . $row['id'] . '"' . (in_array($row['id'], $groupsarray) ? ' checked="checked"' : '') . ' />' . $row['name'] . '</label><br />'; |
520 | 525 | } |
521 | 526 | } |
@@ -526,7 +531,7 @@ discard block |
||
526 | 531 | $evtOut = $modx->invokeEvent("OnWUsrFormRender", array( |
527 | 532 | "id" => $user |
528 | 533 | )); |
529 | - if(is_array($evtOut)) { |
|
534 | + if(is_array($evtOut)) { |
|
530 | 535 | echo implode("", $evtOut); |
531 | 536 | } |
532 | 537 | ?> |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.'); |
4 | 4 | } |
5 | 5 | |
6 | 6 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
7 | 7 | |
8 | -if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { |
|
8 | +if ($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { |
|
9 | 9 | // seems to be a new install - send the user to the configuration page |
10 | 10 | exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>'); |
11 | 11 | } |
@@ -16,16 +16,16 @@ discard block |
||
16 | 16 | $_SESSION['nrnewmessages'] = 0; |
17 | 17 | |
18 | 18 | // setup message info |
19 | -if($modx->hasPermission('messages')) { |
|
20 | - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
19 | +if ($modx->hasPermission('messages')) { |
|
20 | + include_once(MODX_MANAGER_PATH.'includes/messageCount.inc.php'); |
|
21 | 21 | $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
22 | 22 | $_SESSION['nrnewmessages'] = $nrnewmessages; |
23 | 23 | |
24 | 24 | $msg = array(); |
25 | 25 | $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']); |
26 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : ''; |
|
26 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">'.$_SESSION['nrnewmessages'].'</span>)' : ''; |
|
27 | 27 | $msg[] = sprintf('<span style="color:#909090;font-size:15px;font-weight:bold"> <a class="wm_messages_inbox_link" href="index.php?a=10" target="main">[%%inbox%%]</a>%s</span><br />', $nrnewmessages); |
28 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0'; |
|
28 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">'.$_SESSION['nrnewmessages'].'</span>' : '0'; |
|
29 | 29 | $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
30 | 30 | $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages); |
31 | 31 | $ph['MessageInfo'] = implode("\n", $msg); |
@@ -33,56 +33,56 @@ discard block |
||
33 | 33 | |
34 | 34 | $iconTpl = $modx->getChunk('manager#welcome\WrapIcon'); |
35 | 35 | // setup icons |
36 | -if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
|
36 | +if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
|
37 | 37 | $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
38 | - $ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75); |
|
38 | + $ph['SecurityIcon'] = sprintf($iconTpl, $icon, 75); |
|
39 | 39 | } |
40 | -if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
|
40 | +if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
|
41 | 41 | $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
42 | - $ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99); |
|
42 | + $ph['WebUserIcon'] = sprintf($iconTpl, $icon, 99); |
|
43 | 43 | } |
44 | -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
|
44 | +if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
|
45 | 45 | $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
46 | - $ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106); |
|
46 | + $ph['ModulesIcon'] = sprintf($iconTpl, $icon, 106); |
|
47 | 47 | } |
48 | -if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { |
|
48 | +if ($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { |
|
49 | 49 | $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
50 | - $ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76); |
|
50 | + $ph['ResourcesIcon'] = sprintf($iconTpl, $icon, 76); |
|
51 | 51 | } |
52 | -if($modx->hasPermission('bk_manager')) { |
|
52 | +if ($modx->hasPermission('bk_manager')) { |
|
53 | 53 | $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
54 | - $ph['BackupIcon'] = sprintf($iconTpl,$icon, 93); |
|
54 | + $ph['BackupIcon'] = sprintf($iconTpl, $icon, 93); |
|
55 | 55 | } |
56 | -if($modx->hasPermission('help')) { |
|
56 | +if ($modx->hasPermission('help')) { |
|
57 | 57 | $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
58 | - $ph['HelpIcon'] = sprintf($iconTpl,$icon, 9); |
|
58 | + $ph['HelpIcon'] = sprintf($iconTpl, $icon, 9); |
|
59 | 59 | } |
60 | 60 | |
61 | -if($modx->hasPermission('new_document')) { |
|
61 | +if ($modx->hasPermission('new_document')) { |
|
62 | 62 | $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
63 | - $ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4); |
|
63 | + $ph['ResourceIcon'] = sprintf($iconTpl, $icon, 4); |
|
64 | 64 | $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
65 | - $ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72); |
|
65 | + $ph['WeblinkIcon'] = sprintf($iconTpl, $icon, 72); |
|
66 | 66 | } |
67 | -if($modx->hasPermission('assets_images')) { |
|
67 | +if ($modx->hasPermission('assets_images')) { |
|
68 | 68 | $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
69 | - $ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72); |
|
69 | + $ph['ImagesIcon'] = sprintf($iconTpl, $icon, 72); |
|
70 | 70 | } |
71 | -if($modx->hasPermission('assets_files')) { |
|
71 | +if ($modx->hasPermission('assets_files')) { |
|
72 | 72 | $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
73 | - $ph['FilesIcon'] = sprintf($iconTpl,$icon, 72); |
|
73 | + $ph['FilesIcon'] = sprintf($iconTpl, $icon, 72); |
|
74 | 74 | } |
75 | -if($modx->hasPermission('change_password')) { |
|
75 | +if ($modx->hasPermission('change_password')) { |
|
76 | 76 | $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
77 | - $ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28); |
|
77 | + $ph['PasswordIcon'] = sprintf($iconTpl, $icon, 28); |
|
78 | 78 | } |
79 | 79 | $icon = '<i class="[&icons_logout_large&]"></i>[%logout%]'; |
80 | -$ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8); |
|
80 | +$ph['LogoutIcon'] = sprintf($iconTpl, $icon, 8); |
|
81 | 81 | |
82 | 82 | // do some config checks |
83 | -if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
|
84 | - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
85 | - if($config_check_results != $_lang['configcheck_ok']) { |
|
83 | +if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
|
84 | + include_once(MODX_MANAGER_PATH.'includes/config_check.inc.php'); |
|
85 | + if ($config_check_results != $_lang['configcheck_ok']) { |
|
86 | 86 | $ph['config_check_results'] = $config_check_results; |
87 | 87 | $ph['config_display'] = 'block'; |
88 | 88 | } else { |
@@ -93,8 +93,8 @@ discard block |
||
93 | 93 | } |
94 | 94 | |
95 | 95 | // Check logout-reminder |
96 | -if(isset($_SESSION['show_logout_reminder'])) { |
|
97 | - switch($_SESSION['show_logout_reminder']['type']) { |
|
96 | +if (isset($_SESSION['show_logout_reminder'])) { |
|
97 | + switch ($_SESSION['show_logout_reminder']['type']) { |
|
98 | 98 | case 'logout_reminder': |
99 | 99 | $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
100 | 100 | $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | </tr> |
149 | 149 | </table>'; |
150 | 150 | |
151 | -$nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>'; |
|
151 | +$nrnewmessages = '<span class="text-danger">'.$_SESSION['nrnewmessages'].'</span>'; |
|
152 | 152 | |
153 | 153 | $ph['UserInfo'] = $modx->parseText($tpl, array( |
154 | 154 | 'username' => $modx->getLoginUserName(), |
@@ -160,13 +160,13 @@ discard block |
||
160 | 160 | |
161 | 161 | $from = array(); |
162 | 162 | $from[] = $modx->getDatabase()->getFullTableName('active_user_sessions'); |
163 | -$from[] = " us LEFT JOIN " . $modx->getDatabase()->getFullTableName('active_users') . " au ON au.sid=us.sid WHERE au.action <> '8'"; |
|
163 | +$from[] = " us LEFT JOIN ".$modx->getDatabase()->getFullTableName('active_users')." au ON au.sid=us.sid WHERE au.action <> '8'"; |
|
164 | 164 | $rs = $modx->getDatabase()->select('*', $from, '', 'username ASC, au.sid ASC'); |
165 | 165 | |
166 | -if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
166 | +if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
167 | 167 | $html = '<p>[%no_active_users_found%]</p>'; |
168 | 168 | } else { |
169 | - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
169 | + include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php'); |
|
170 | 170 | $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
171 | 171 | $ph['now'] = strftime('%H:%M:%S', $now); |
172 | 172 | $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $userList = array(); |
192 | 192 | $userCount = array(); |
193 | 193 | // Create userlist with session-count first before output |
194 | - while($activeusers = $modx->getDatabase()->getRow($rs)) { |
|
194 | + while ($activeusers = $modx->getDatabase()->getRow($rs)) { |
|
195 | 195 | $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
196 | 196 | |
197 | 197 | $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
@@ -209,9 +209,9 @@ discard block |
||
209 | 209 | $currentaction |
210 | 210 | ); |
211 | 211 | } |
212 | - foreach($userList as $params) { |
|
212 | + foreach ($userList as $params) { |
|
213 | 213 | $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
214 | - $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params); |
|
214 | + $html .= "\n\t\t".vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | $html .= ' |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | $ph['OnlineInfo'] = $html; |
224 | 224 | |
225 | 225 | // include rss feeds for important forum topics |
226 | -include_once(MODX_MANAGER_PATH . 'includes/rss.inc.php'); |
|
226 | +include_once(MODX_MANAGER_PATH.'includes/rss.inc.php'); |
|
227 | 227 | $ph['modx_security_notices_content'] = $feedData['modx_security_notices_content']; |
228 | 228 | $ph['modx_news_content'] = $feedData['modx_news_content']; |
229 | 229 | |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | |
255 | 255 | // invoke event OnManagerWelcomePrerender |
256 | 256 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); |
257 | -if(is_array($evtOut)) { |
|
257 | +if (is_array($evtOut)) { |
|
258 | 258 | $output = implode('', $evtOut); |
259 | 259 | $ph['OnManagerWelcomePrerender'] = $output; |
260 | 260 | } |
@@ -384,57 +384,57 @@ discard block |
||
384 | 384 | |
385 | 385 | // invoke OnManagerWelcomeHome event |
386 | 386 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); |
387 | -if(is_array($sitewidgets)) { |
|
387 | +if (is_array($sitewidgets)) { |
|
388 | 388 | $newwidgets = array(); |
389 | - foreach($sitewidgets as $widget){ |
|
389 | + foreach ($sitewidgets as $widget) { |
|
390 | 390 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
391 | 391 | } |
392 | 392 | $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; |
393 | 393 | } |
394 | 394 | |
395 | -usort($widgets, function ($a, $b) { |
|
395 | +usort($widgets, function($a, $b){ |
|
396 | 396 | return $a['menuindex'] - $b['menuindex']; |
397 | 397 | }); |
398 | 398 | |
399 | 399 | $tpl = $modx->getChunk('manager#welcome\Widget'); |
400 | 400 | $output = ''; |
401 | -foreach($widgets as $widget) { |
|
402 | - if ($widget['hide'] != '1'){ |
|
401 | +foreach ($widgets as $widget) { |
|
402 | + if ($widget['hide'] != '1') { |
|
403 | 403 | $output .= $modx->parseText($tpl, $widget); |
404 | 404 | } |
405 | 405 | } |
406 | 406 | $ph['widgets'] = $output; |
407 | 407 | |
408 | 408 | // load template |
409 | -if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
|
410 | - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
|
409 | +if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
|
410 | + $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH.'media/style/common/welcome.tpl'; |
|
411 | 411 | } |
412 | 412 | |
413 | 413 | $target = $modx->config['manager_welcome_tpl']; |
414 | 414 | $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); |
415 | 415 | $target = $modx->mergeSettingsContent($target); |
416 | 416 | |
417 | -if(substr($target, 0, 1) === '@') { |
|
418 | - if(substr($target, 0, 6) === '@CHUNK') { |
|
417 | +if (substr($target, 0, 1) === '@') { |
|
418 | + if (substr($target, 0, 6) === '@CHUNK') { |
|
419 | 419 | $content = $modx->getChunk(trim(substr($target, 7))); |
420 | - } elseif(substr($target, 0, 5) === '@FILE') { |
|
420 | + } elseif (substr($target, 0, 5) === '@FILE') { |
|
421 | 421 | $content = file_get_contents(trim(substr($target, 6))); |
422 | 422 | } else { |
423 | 423 | $content = ''; |
424 | 424 | } |
425 | 425 | } else { |
426 | 426 | $chunk = $modx->getChunk($target); |
427 | - if($chunk !== false && !empty($chunk)) { |
|
427 | + if ($chunk !== false && !empty($chunk)) { |
|
428 | 428 | $content = $chunk; |
429 | - } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
430 | - $content = file_get_contents(MODX_BASE_PATH . $target); |
|
431 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
432 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
|
433 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
429 | + } elseif (is_file(MODX_BASE_PATH.$target)) { |
|
430 | + $content = file_get_contents(MODX_BASE_PATH.$target); |
|
431 | + } elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl')) { |
|
432 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl'); |
|
433 | + } elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html')) // ClipperCMS compatible |
|
434 | 434 | { |
435 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
435 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html'); |
|
436 | 436 | } else { |
437 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
437 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/common/welcome.tpl'); |
|
438 | 438 | } |
439 | 439 | } |
440 | 440 | |
@@ -442,7 +442,7 @@ discard block |
||
442 | 442 | $content = $modx->mergeConditionalTagsContent($content); |
443 | 443 | $content = $modx->mergeSettingsContent($content); |
444 | 444 | $content = $modx->parseText($content, $ph); |
445 | -if(strpos($content, '[+') !== false) { |
|
445 | +if (strpos($content, '[+') !== false) { |
|
446 | 446 | $modx->toPlaceholders($ph); |
447 | 447 | $content = $modx->mergePlaceholderContent($content); |
448 | 448 | } |
@@ -451,7 +451,7 @@ discard block |
||
451 | 451 | $content = $modx->parseText($content, $_style, '[&', '&]'); |
452 | 452 | $content = $modx->cleanUpMODXTags($content); //cleanup |
453 | 453 | |
454 | -if($js = $modx->getRegisteredClientScripts()) { |
|
454 | +if ($js = $modx->getRegisteredClientScripts()) { |
|
455 | 455 | $content .= $js; |
456 | 456 | } |
457 | 457 |
@@ -1,11 +1,11 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die('<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly.'); |
4 | 4 | } |
5 | 5 | |
6 | 6 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
7 | 7 | |
8 | -if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { |
|
8 | +if($modx->hasPermission('settings') && (!isset($settings_version) || $settings_version != $modx->getVersionData('version'))) { |
|
9 | 9 | // seems to be a new install - send the user to the configuration page |
10 | 10 | exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>'); |
11 | 11 | } |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | $_SESSION['nrnewmessages'] = 0; |
17 | 17 | |
18 | 18 | // setup message info |
19 | -if($modx->hasPermission('messages')) { |
|
19 | +if($modx->hasPermission('messages')) { |
|
20 | 20 | include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
21 | 21 | $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
22 | 22 | $_SESSION['nrnewmessages'] = $nrnewmessages; |
@@ -33,46 +33,46 @@ discard block |
||
33 | 33 | |
34 | 34 | $iconTpl = $modx->getChunk('manager#welcome\WrapIcon'); |
35 | 35 | // setup icons |
36 | -if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
|
36 | +if($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
|
37 | 37 | $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
38 | 38 | $ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75); |
39 | 39 | } |
40 | -if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
|
40 | +if($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
|
41 | 41 | $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
42 | 42 | $ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99); |
43 | 43 | } |
44 | -if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
|
44 | +if($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
|
45 | 45 | $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
46 | 46 | $ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106); |
47 | 47 | } |
48 | -if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { |
|
48 | +if($modx->hasPermission('new_template') || $modx->hasPermission('edit_template') || $modx->hasPermission('new_snippet') || $modx->hasPermission('edit_snippet') || $modx->hasPermission('new_plugin') || $modx->hasPermission('edit_plugin') || $modx->hasPermission('manage_metatags')) { |
|
49 | 49 | $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
50 | 50 | $ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76); |
51 | 51 | } |
52 | -if($modx->hasPermission('bk_manager')) { |
|
52 | +if($modx->hasPermission('bk_manager')) { |
|
53 | 53 | $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
54 | 54 | $ph['BackupIcon'] = sprintf($iconTpl,$icon, 93); |
55 | 55 | } |
56 | -if($modx->hasPermission('help')) { |
|
56 | +if($modx->hasPermission('help')) { |
|
57 | 57 | $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
58 | 58 | $ph['HelpIcon'] = sprintf($iconTpl,$icon, 9); |
59 | 59 | } |
60 | 60 | |
61 | -if($modx->hasPermission('new_document')) { |
|
61 | +if($modx->hasPermission('new_document')) { |
|
62 | 62 | $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
63 | 63 | $ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4); |
64 | 64 | $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
65 | 65 | $ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72); |
66 | 66 | } |
67 | -if($modx->hasPermission('assets_images')) { |
|
67 | +if($modx->hasPermission('assets_images')) { |
|
68 | 68 | $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
69 | 69 | $ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72); |
70 | 70 | } |
71 | -if($modx->hasPermission('assets_files')) { |
|
71 | +if($modx->hasPermission('assets_files')) { |
|
72 | 72 | $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
73 | 73 | $ph['FilesIcon'] = sprintf($iconTpl,$icon, 72); |
74 | 74 | } |
75 | -if($modx->hasPermission('change_password')) { |
|
75 | +if($modx->hasPermission('change_password')) { |
|
76 | 76 | $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
77 | 77 | $ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28); |
78 | 78 | } |
@@ -80,21 +80,21 @@ discard block |
||
80 | 80 | $ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8); |
81 | 81 | |
82 | 82 | // do some config checks |
83 | -if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
|
83 | +if(($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
|
84 | 84 | include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
85 | - if($config_check_results != $_lang['configcheck_ok']) { |
|
85 | + if($config_check_results != $_lang['configcheck_ok']) { |
|
86 | 86 | $ph['config_check_results'] = $config_check_results; |
87 | 87 | $ph['config_display'] = 'block'; |
88 | - } else { |
|
88 | + } else { |
|
89 | 89 | $ph['config_display'] = 'none'; |
90 | 90 | } |
91 | -} else { |
|
91 | +} else { |
|
92 | 92 | $ph['config_display'] = 'none'; |
93 | 93 | } |
94 | 94 | |
95 | 95 | // Check logout-reminder |
96 | -if(isset($_SESSION['show_logout_reminder'])) { |
|
97 | - switch($_SESSION['show_logout_reminder']['type']) { |
|
96 | +if(isset($_SESSION['show_logout_reminder'])) { |
|
97 | + switch($_SESSION['show_logout_reminder']['type']) { |
|
98 | 98 | case 'logout_reminder': |
99 | 99 | $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
100 | 100 | $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); |
@@ -102,7 +102,7 @@ discard block |
||
102 | 102 | } |
103 | 103 | $ph['show_logout_reminder'] = 'block'; |
104 | 104 | unset($_SESSION['show_logout_reminder']); |
105 | -} else { |
|
105 | +} else { |
|
106 | 106 | $ph['show_logout_reminder'] = 'none'; |
107 | 107 | } |
108 | 108 | |
@@ -163,9 +163,9 @@ discard block |
||
163 | 163 | $from[] = " us LEFT JOIN " . $modx->getDatabase()->getFullTableName('active_users') . " au ON au.sid=us.sid WHERE au.action <> '8'"; |
164 | 164 | $rs = $modx->getDatabase()->select('*', $from, '', 'username ASC, au.sid ASC'); |
165 | 165 | |
166 | -if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
166 | +if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
167 | 167 | $html = '<p>[%no_active_users_found%]</p>'; |
168 | -} else { |
|
168 | +} else { |
|
169 | 169 | include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
170 | 170 | $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
171 | 171 | $ph['now'] = strftime('%H:%M:%S', $now); |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $userList = array(); |
192 | 192 | $userCount = array(); |
193 | 193 | // Create userlist with session-count first before output |
194 | - while($activeusers = $modx->getDatabase()->getRow($rs)) { |
|
194 | + while($activeusers = $modx->getDatabase()->getRow($rs)) { |
|
195 | 195 | $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
196 | 196 | |
197 | 197 | $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $currentaction |
210 | 210 | ); |
211 | 211 | } |
212 | - foreach($userList as $params) { |
|
212 | + foreach($userList as $params) { |
|
213 | 213 | $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
214 | 214 | $html .= "\n\t\t" . vsprintf('<tr%s><td><strong%s>%s</strong></td><td>%s%s</td><td>%s</td><td>%s</td><td>%s</td></tr>', $params); |
215 | 215 | } |
@@ -254,7 +254,7 @@ discard block |
||
254 | 254 | |
255 | 255 | // invoke event OnManagerWelcomePrerender |
256 | 256 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); |
257 | -if(is_array($evtOut)) { |
|
257 | +if(is_array($evtOut)) { |
|
258 | 258 | $output = implode('', $evtOut); |
259 | 259 | $ph['OnManagerWelcomePrerender'] = $output; |
260 | 260 | } |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
360 | 360 | 'hide'=>'0' |
361 | 361 | ); |
362 | -if ($modx->config['rss_url_news']) { |
|
362 | +if ($modx->config['rss_url_news']) { |
|
363 | 363 | $widgets['news'] = array( |
364 | 364 | 'menuindex' => '40', |
365 | 365 | 'id' => 'news', |
@@ -370,7 +370,7 @@ discard block |
||
370 | 370 | 'hide'=>'0' |
371 | 371 | ); |
372 | 372 | } |
373 | -if ($modx->config['rss_url_security']) { |
|
373 | +if ($modx->config['rss_url_security']) { |
|
374 | 374 | $widgets['security'] = array( |
375 | 375 | 'menuindex' => '50', |
376 | 376 | 'id' => 'security', |
@@ -384,29 +384,29 @@ discard block |
||
384 | 384 | |
385 | 385 | // invoke OnManagerWelcomeHome event |
386 | 386 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); |
387 | -if(is_array($sitewidgets)) { |
|
387 | +if(is_array($sitewidgets)) { |
|
388 | 388 | $newwidgets = array(); |
389 | - foreach($sitewidgets as $widget){ |
|
389 | + foreach($sitewidgets as $widget) { |
|
390 | 390 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
391 | 391 | } |
392 | 392 | $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; |
393 | 393 | } |
394 | 394 | |
395 | -usort($widgets, function ($a, $b) { |
|
395 | +usort($widgets, function ($a, $b){ |
|
396 | 396 | return $a['menuindex'] - $b['menuindex']; |
397 | 397 | }); |
398 | 398 | |
399 | 399 | $tpl = $modx->getChunk('manager#welcome\Widget'); |
400 | 400 | $output = ''; |
401 | -foreach($widgets as $widget) { |
|
402 | - if ($widget['hide'] != '1'){ |
|
401 | +foreach($widgets as $widget) { |
|
402 | + if ($widget['hide'] != '1') { |
|
403 | 403 | $output .= $modx->parseText($tpl, $widget); |
404 | 404 | } |
405 | 405 | } |
406 | 406 | $ph['widgets'] = $output; |
407 | 407 | |
408 | 408 | // load template |
409 | -if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
|
409 | +if(!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
|
410 | 410 | $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
411 | 411 | } |
412 | 412 | |
@@ -414,26 +414,28 @@ discard block |
||
414 | 414 | $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); |
415 | 415 | $target = $modx->mergeSettingsContent($target); |
416 | 416 | |
417 | -if(substr($target, 0, 1) === '@') { |
|
418 | - if(substr($target, 0, 6) === '@CHUNK') { |
|
417 | +if(substr($target, 0, 1) === '@') { |
|
418 | + if(substr($target, 0, 6) === '@CHUNK') { |
|
419 | 419 | $content = $modx->getChunk(trim(substr($target, 7))); |
420 | - } elseif(substr($target, 0, 5) === '@FILE') { |
|
420 | + } elseif(substr($target, 0, 5) === '@FILE') { |
|
421 | 421 | $content = file_get_contents(trim(substr($target, 6))); |
422 | - } else { |
|
422 | + } else { |
|
423 | 423 | $content = ''; |
424 | 424 | } |
425 | -} else { |
|
425 | +} else { |
|
426 | 426 | $chunk = $modx->getChunk($target); |
427 | - if($chunk !== false && !empty($chunk)) { |
|
427 | + if($chunk !== false && !empty($chunk)) { |
|
428 | 428 | $content = $chunk; |
429 | - } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
429 | + } elseif(is_file(MODX_BASE_PATH . $target)) { |
|
430 | 430 | $content = file_get_contents(MODX_BASE_PATH . $target); |
431 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
431 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
432 | 432 | $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
433 | - } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) // ClipperCMS compatible |
|
433 | + } elseif(is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) { |
|
434 | + // ClipperCMS compatible |
|
434 | 435 | { |
435 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
436 | - } else { |
|
436 | + $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
437 | + } |
|
438 | + } else { |
|
437 | 439 | $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
438 | 440 | } |
439 | 441 | } |
@@ -442,7 +444,7 @@ discard block |
||
442 | 444 | $content = $modx->mergeConditionalTagsContent($content); |
443 | 445 | $content = $modx->mergeSettingsContent($content); |
444 | 446 | $content = $modx->parseText($content, $ph); |
445 | -if(strpos($content, '[+') !== false) { |
|
447 | +if(strpos($content, '[+') !== false) { |
|
446 | 448 | $modx->toPlaceholders($ph); |
447 | 449 | $content = $modx->mergePlaceholderContent($content); |
448 | 450 | } |
@@ -451,7 +453,7 @@ discard block |
||
451 | 453 | $content = $modx->parseText($content, $_style, '[&', '&]'); |
452 | 454 | $content = $modx->cleanUpMODXTags($content); //cleanup |
453 | 455 | |
454 | -if($js = $modx->getRegisteredClientScripts()) { |
|
456 | +if($js = $modx->getRegisteredClientScripts()) { |
|
455 | 457 | $content .= $js; |
456 | 458 | } |
457 | 459 |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | - $site_unavailable_message_view = isset($site_unavailable_message) ? $site_unavailable_message : $_lang['siteunavailable_message_default']; |
|
2 | + $site_unavailable_message_view = isset($site_unavailable_message) ? $site_unavailable_message : $_lang['siteunavailable_message_default']; |
|
3 | 3 | ?> |
4 | 4 | <style> |
5 | 5 | table.sysSettings > tbody td, table.sysSettings > tbody th {border-bottom:1px dotted #ccc;padding:10px;} |
@@ -135,8 +135,8 @@ discard block |
||
135 | 135 | <?php |
136 | 136 | // Check if PHX is enabled |
137 | 137 | $count = $modx->getDatabase()->getRecordCount( |
138 | - $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('site_plugins'), |
|
139 | - "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") |
|
138 | + $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('site_plugins'), |
|
139 | + "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") |
|
140 | 140 | ); |
141 | 141 | if($count) { |
142 | 142 | $disabledFilters = 1; |
@@ -259,14 +259,14 @@ discard block |
||
259 | 259 | <th><?php echo $_lang['serveroffset_title'] ?><br><small>[(server_offset_time)]</small></th> |
260 | 260 | <td> <select name="server_offset_time" size="1" class="inputBox"> |
261 | 261 | <?php |
262 | - for($i=-24; $i<25; $i++) { |
|
263 | - $seconds = $i*60*60; |
|
264 | - $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ; |
|
265 | - ?> |
|
262 | + for($i=-24; $i<25; $i++) { |
|
263 | + $seconds = $i*60*60; |
|
264 | + $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ; |
|
265 | + ?> |
|
266 | 266 | <option value="<?php echo $seconds; ?>" <?php echo $selectedtext; ?>><?php echo $i; ?></option> |
267 | 267 | <?php |
268 | - } |
|
269 | - ?> |
|
268 | + } |
|
269 | + ?> |
|
270 | 270 | </select> |
271 | 271 | <div class="comment"><?php printf($_lang['serveroffset_message'], strftime('%H:%M:%S', time()), strftime('%H:%M:%S', time()+$server_offset_time)); ?></div> |
272 | 272 | </td> |
@@ -13,8 +13,8 @@ discard block |
||
13 | 13 | <tr> |
14 | 14 | <th><?php echo $_lang['sitestatus_title'] ?><br><small>[(site_status)]</small></th> |
15 | 15 | <td> |
16 | - <?php echo wrap_label($_lang['online'], form_radio('site_status', 1));?><br /> |
|
17 | - <?php echo wrap_label($_lang['offline'], form_radio('site_status', 0));?> |
|
16 | + <?php echo wrap_label($_lang['online'], form_radio('site_status', 1)); ?><br /> |
|
17 | + <?php echo wrap_label($_lang['offline'], form_radio('site_status', 0)); ?> |
|
18 | 18 | </td> |
19 | 19 | </tr> |
20 | 20 | <tr> |
@@ -58,12 +58,12 @@ discard block |
||
58 | 58 | <br /> |
59 | 59 | <p><?php echo $_lang['update_settings_from_language']; ?></p> |
60 | 60 | <select name="reload_site_unavailable" id="reload_site_unavailable_select" onchange="confirmLangChange(this, 'siteunavailable_message_default', 'site_unavailable_message_textarea');"> |
61 | -<?php echo get_lang_options('siteunavailable_message_default');?> |
|
61 | +<?php echo get_lang_options('siteunavailable_message_default'); ?> |
|
62 | 62 | </select> |
63 | 63 | </th> |
64 | 64 | <td> <textarea name="site_unavailable_message" id="site_unavailable_message_textarea" style="width:100%; height: 120px;"><?php echo $site_unavailable_message_view; ?></textarea> |
65 | - <input type="hidden" name="siteunavailable_message_default" id="siteunavailable_message_default_hidden" value="<?php echo addslashes($_lang['siteunavailable_message_default']);?>" /> |
|
66 | - <div class="comment"><?php echo $_lang['siteunavailable_message'];?></div> |
|
65 | + <input type="hidden" name="siteunavailable_message_default" id="siteunavailable_message_default_hidden" value="<?php echo addslashes($_lang['siteunavailable_message_default']); ?>" /> |
|
66 | + <div class="comment"><?php echo $_lang['siteunavailable_message']; ?></div> |
|
67 | 67 | </td> |
68 | 68 | </tr> |
69 | 69 | <tr> |
@@ -78,17 +78,17 @@ discard block |
||
78 | 78 | 'c.category, t.templatename ASC' |
79 | 79 | ); |
80 | 80 | ?> |
81 | - <select name="default_template" class="inputBox" onchange="documentDirty=true;wrap=document.getElementById('template_reset_options_wrapper');if(this.options[this.selectedIndex].value != '<?php echo $default_template;?>'){wrap.style.display='block';}else{wrap.style.display='none';}" style="width:150px"> |
|
81 | + <select name="default_template" class="inputBox" onchange="documentDirty=true;wrap=document.getElementById('template_reset_options_wrapper');if(this.options[this.selectedIndex].value != '<?php echo $default_template; ?>'){wrap.style.display='block';}else{wrap.style.display='none';}" style="width:150px"> |
|
82 | 82 | <?php |
83 | 83 | |
84 | 84 | $currentCategory = ''; |
85 | 85 | while ($row = $modx->getDatabase()->getRow($rs)) { |
86 | 86 | $thisCategory = $row['category']; |
87 | - if($thisCategory == null) { |
|
87 | + if ($thisCategory == null) { |
|
88 | 88 | $thisCategory = $_lang['no_category']; |
89 | 89 | } |
90 | - if($thisCategory != $currentCategory) { |
|
91 | - if($closeOptGroup) { |
|
90 | + if ($thisCategory != $currentCategory) { |
|
91 | + if ($closeOptGroup) { |
|
92 | 92 | echo "\t\t\t\t\t</optgroup>\n"; |
93 | 93 | } |
94 | 94 | echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n"; |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | echo "\t\t\t\t\t".'<option value="'.$row['id'].'"'.$selectedtext.'>'.$row['templatename']."</option>\n"; |
107 | 107 | $currentCategory = $thisCategory; |
108 | 108 | } |
109 | - if($thisCategory != '') { |
|
109 | + if ($thisCategory != '') { |
|
110 | 110 | echo "\t\t\t\t\t</optgroup>\n"; |
111 | 111 | } |
112 | 112 | ?> |
@@ -114,19 +114,19 @@ discard block |
||
114 | 114 | <br /> |
115 | 115 | <div id="template_reset_options_wrapper" style="display:none;"> |
116 | 116 | <label><input type="radio" name="reset_template" value="1" /> <?php echo $_lang['template_reset_all']; ?></label><br /> |
117 | - <label><input type="radio" name="reset_template" value="2" /> <?php echo sprintf($_lang['template_reset_specific'],$oldTmpName); ?></label> |
|
117 | + <label><input type="radio" name="reset_template" value="2" /> <?php echo sprintf($_lang['template_reset_specific'], $oldTmpName); ?></label> |
|
118 | 118 | </div> |
119 | 119 | <input type="hidden" name="old_template" value="<?php echo $oldTmpId; ?>" /> |
120 | 120 | <div class="comment"><?php echo $_lang['defaulttemplate_message'] ?></div> |
121 | 121 | </td> |
122 | 122 | </tr> |
123 | 123 | <tr> |
124 | - <th><?php echo $_lang['defaulttemplate_logic_title'];?><br><small>[(auto_template_logic)]</small></th> |
|
124 | + <th><?php echo $_lang['defaulttemplate_logic_title']; ?><br><small>[(auto_template_logic)]</small></th> |
|
125 | 125 | <td> |
126 | - <p><?php echo $_lang['defaulttemplate_logic_general_message'];?></p> |
|
127 | - <label><input type="radio" name="auto_template_logic" value="system"<?php if($auto_template_logic == 'system') {echo " checked='checked'";}?>/> <?php echo $_lang['defaulttemplate_logic_system_message']; ?></label><br /> |
|
128 | - <label><input type="radio" name="auto_template_logic" value="parent"<?php if($auto_template_logic == 'parent') {echo " checked='checked'";}?>/> <?php echo $_lang['defaulttemplate_logic_parent_message']; ?></label><br /> |
|
129 | - <label><input type="radio" name="auto_template_logic" value="sibling"<?php if($auto_template_logic == 'sibling') {echo " checked='checked'";}?>/> <?php echo $_lang['defaulttemplate_logic_sibling_message']; ?></label><br /> |
|
126 | + <p><?php echo $_lang['defaulttemplate_logic_general_message']; ?></p> |
|
127 | + <label><input type="radio" name="auto_template_logic" value="system"<?php if ($auto_template_logic == 'system') {echo " checked='checked'"; }?>/> <?php echo $_lang['defaulttemplate_logic_system_message']; ?></label><br /> |
|
128 | + <label><input type="radio" name="auto_template_logic" value="parent"<?php if ($auto_template_logic == 'parent') {echo " checked='checked'"; }?>/> <?php echo $_lang['defaulttemplate_logic_parent_message']; ?></label><br /> |
|
129 | + <label><input type="radio" name="auto_template_logic" value="sibling"<?php if ($auto_template_logic == 'sibling') {echo " checked='checked'"; }?>/> <?php echo $_lang['defaulttemplate_logic_sibling_message']; ?></label><br /> |
|
130 | 130 | </td> |
131 | 131 | </tr> |
132 | 132 | <tr> |
@@ -138,22 +138,22 @@ discard block |
||
138 | 138 | $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('site_plugins'), |
139 | 139 | "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") |
140 | 140 | ); |
141 | - if($count) { |
|
141 | + if ($count) { |
|
142 | 142 | $disabledFilters = 1; |
143 | 143 | echo '<b>'.$_lang['enable_filter_phx_warning'].'</b><br/>'; |
144 | 144 | } |
145 | 145 | else $disabledFilters = false; |
146 | 146 | ?> |
147 | - <?php echo wrap_label($_lang['yes'],form_radio('enable_filter', 1, '', $disabledFilters));?><br /> |
|
148 | - <?php echo wrap_label($_lang['no'], form_radio('enable_filter', 0, '', $disabledFilters));?> |
|
147 | + <?php echo wrap_label($_lang['yes'], form_radio('enable_filter', 1, '', $disabledFilters)); ?><br /> |
|
148 | + <?php echo wrap_label($_lang['no'], form_radio('enable_filter', 0, '', $disabledFilters)); ?> |
|
149 | 149 | <div class="comment"><?php echo $_lang['enable_filter_message']; ?></div> |
150 | 150 | </td> |
151 | 151 | </tr> |
152 | 152 | <tr> |
153 | 153 | <th><?php echo $_lang['enable_at_syntax_title'] ?><br><small>[(enable_at_syntax)]</small></th> |
154 | 154 | <td > |
155 | - <?php echo wrap_label($_lang['yes'],form_radio('enable_at_syntax', 1));?><br /> |
|
156 | - <?php echo wrap_label($_lang['no'], form_radio('enable_at_syntax', 0));?> |
|
155 | + <?php echo wrap_label($_lang['yes'], form_radio('enable_at_syntax', 1)); ?><br /> |
|
156 | + <?php echo wrap_label($_lang['no'], form_radio('enable_at_syntax', 0)); ?> |
|
157 | 157 | <div class="comment"> |
158 | 158 | <?php echo $_lang['enable_at_syntax_message']; ?> |
159 | 159 | <ul> |
@@ -167,8 +167,8 @@ discard block |
||
167 | 167 | <tr> |
168 | 168 | <th><?php echo $_lang['defaultpublish_title'] ?><br><small>[(publish_default)]</small></th> |
169 | 169 | <td> |
170 | - <?php echo wrap_label($_lang['yes'],form_radio('publish_default', 1));?><br /> |
|
171 | - <?php echo wrap_label($_lang['no'],form_radio('publish_default', 0));?> |
|
170 | + <?php echo wrap_label($_lang['yes'], form_radio('publish_default', 1)); ?><br /> |
|
171 | + <?php echo wrap_label($_lang['no'], form_radio('publish_default', 0)); ?> |
|
172 | 172 | <div class="comment"><?php echo $_lang['defaultpublish_message'] ?></div> |
173 | 173 | </td> |
174 | 174 | </tr> |
@@ -176,24 +176,24 @@ discard block |
||
176 | 176 | <tr> |
177 | 177 | <th><?php echo $_lang['defaultcache_title'] ?><br><small>[(cache_default)]</small></th> |
178 | 178 | <td> |
179 | - <?php echo wrap_label($_lang['yes'],form_radio('cache_default', 1));?><br /> |
|
180 | - <?php echo wrap_label($_lang['no'],form_radio('cache_default', 0));?> |
|
179 | + <?php echo wrap_label($_lang['yes'], form_radio('cache_default', 1)); ?><br /> |
|
180 | + <?php echo wrap_label($_lang['no'], form_radio('cache_default', 0)); ?> |
|
181 | 181 | <div class="comment"><?php echo $_lang['defaultcache_message'] ?></div> |
182 | 182 | </td> |
183 | 183 | </tr> |
184 | 184 | <tr> |
185 | 185 | <th><?php echo $_lang['defaultsearch_title'] ?><br><small>[(search_default)]</small></th> |
186 | 186 | <td> |
187 | - <?php echo wrap_label($_lang['yes'],form_radio('search_default', 1));?><br /> |
|
188 | - <?php echo wrap_label($_lang['no'],form_radio('search_default', 0));?> |
|
187 | + <?php echo wrap_label($_lang['yes'], form_radio('search_default', 1)); ?><br /> |
|
188 | + <?php echo wrap_label($_lang['no'], form_radio('search_default', 0)); ?> |
|
189 | 189 | <div class="comment"><?php echo $_lang['defaultsearch_message'] ?></div> |
190 | 190 | </td> |
191 | 191 | </tr> |
192 | 192 | <tr> |
193 | 193 | <th><?php echo $_lang['defaultmenuindex_title'] ?><br><small>[(auto_menuindex)]</small></th> |
194 | 194 | <td> |
195 | - <?php echo wrap_label($_lang['yes'],form_radio('auto_menuindex', 1));?><br /> |
|
196 | - <?php echo wrap_label($_lang['no'],form_radio('auto_menuindex', 0));?> |
|
195 | + <?php echo wrap_label($_lang['yes'], form_radio('auto_menuindex', 1)); ?><br /> |
|
196 | + <?php echo wrap_label($_lang['no'], form_radio('auto_menuindex', 0)); ?> |
|
197 | 197 | <div class="comment"><?php echo $_lang['defaultmenuindex_message'] ?></div> |
198 | 198 | </td> |
199 | 199 | </tr> |
@@ -203,8 +203,8 @@ discard block |
||
203 | 203 | <table border="0" cellspacing="0" cellpadding="0"><tr><td valign="top"> |
204 | 204 | <select name="lst_custom_contenttype" style="width:200px;height:100px;" size="5"> |
205 | 205 | <?php |
206 | - $ct = explode(",",$custom_contenttype); |
|
207 | - for($i=0;$i<count($ct);$i++) { |
|
206 | + $ct = explode(",", $custom_contenttype); |
|
207 | + for ($i = 0; $i < count($ct); $i++) { |
|
208 | 208 | echo "<option value=\"".$ct[$i]."\">".$ct[$i]."</option>"; |
209 | 209 | } |
210 | 210 | ?> |
@@ -218,14 +218,14 @@ discard block |
||
218 | 218 | <th><?php echo $_lang['docid_incrmnt_method_title'] ?><br><small>[(docid_incrmnt_method)]</small></th> |
219 | 219 | <td> |
220 | 220 | <label><input type="radio" name="docid_incrmnt_method" value="0" |
221 | - <?php echo ($docid_incrmnt_method=='0') ? 'checked="checked"' : "" ; ?> /> |
|
221 | + <?php echo ($docid_incrmnt_method == '0') ? 'checked="checked"' : ""; ?> /> |
|
222 | 222 | <?php echo $_lang['docid_incrmnt_method_0']?></label><br /> |
223 | 223 | |
224 | 224 | <label><input type="radio" name="docid_incrmnt_method" value="1" |
225 | - <?php echo ($docid_incrmnt_method=='1') ? 'checked="checked"' : "" ; ?> /> |
|
225 | + <?php echo ($docid_incrmnt_method == '1') ? 'checked="checked"' : ""; ?> /> |
|
226 | 226 | <?php echo $_lang['docid_incrmnt_method_1']?></label><br /> |
227 | 227 | <label><input type="radio" name="docid_incrmnt_method" value="2" |
228 | - <?php echo ($docid_incrmnt_method=='2') ? 'checked="checked"' : "" ; ?> /> |
|
228 | + <?php echo ($docid_incrmnt_method == '2') ? 'checked="checked"' : ""; ?> /> |
|
229 | 229 | <?php echo $_lang['docid_incrmnt_method_2']?></label><br /> |
230 | 230 | </td> |
231 | 231 | </tr> |
@@ -233,24 +233,24 @@ discard block |
||
233 | 233 | <tr> |
234 | 234 | <th><?php echo $_lang['enable_cache_title'] ?><br><small>[(enable_cache)]</small></th> |
235 | 235 | <td> |
236 | - <?php echo wrap_label($_lang['enabled'],form_radio('enable_cache', 1));?><br /> |
|
237 | - <?php echo wrap_label($_lang['disabled'], form_radio('enable_cache', 0));?><br /> |
|
238 | - <?php echo wrap_label($_lang['disabled_at_login'], form_radio('enable_cache', 2));?> |
|
236 | + <?php echo wrap_label($_lang['enabled'], form_radio('enable_cache', 1)); ?><br /> |
|
237 | + <?php echo wrap_label($_lang['disabled'], form_radio('enable_cache', 0)); ?><br /> |
|
238 | + <?php echo wrap_label($_lang['disabled_at_login'], form_radio('enable_cache', 2)); ?> |
|
239 | 239 | </td> |
240 | 240 | </tr> |
241 | 241 | |
242 | 242 | <tr> |
243 | 243 | <th><?php echo $_lang['cache_type_title'] ?><br><small>[(cache_type)]</small></th> |
244 | 244 | <td> |
245 | -<?php echo wrap_label($_lang['cache_type_1'],form_radio('cache_type', 1));?><br /> |
|
246 | -<?php echo wrap_label($_lang['cache_type_2'], form_radio('cache_type', 2));?> |
|
245 | +<?php echo wrap_label($_lang['cache_type_1'], form_radio('cache_type', 1)); ?><br /> |
|
246 | +<?php echo wrap_label($_lang['cache_type_2'], form_radio('cache_type', 2)); ?> |
|
247 | 247 | </td> |
248 | 248 | </tr> |
249 | 249 | <tr> |
250 | 250 | <th><?php echo $_lang['minifyphp_incache_title'] ?><br><small>[(minifyphp_incache)]</small></th> |
251 | 251 | <td> |
252 | -<?php echo wrap_label($_lang['enabled'],form_radio('minifyphp_incache', 1));?><br /> |
|
253 | -<?php echo wrap_label($_lang['disabled'], form_radio('minifyphp_incache', 0));?> |
|
252 | +<?php echo wrap_label($_lang['enabled'], form_radio('minifyphp_incache', 1)); ?><br /> |
|
253 | +<?php echo wrap_label($_lang['disabled'], form_radio('minifyphp_incache', 0)); ?> |
|
254 | 254 | <div class="comment"><?php echo $_lang['minifyphp_incache_message'] ?></div> |
255 | 255 | </td> |
256 | 256 | </tr> |
@@ -259,23 +259,23 @@ discard block |
||
259 | 259 | <th><?php echo $_lang['serveroffset_title'] ?><br><small>[(server_offset_time)]</small></th> |
260 | 260 | <td> <select name="server_offset_time" size="1" class="inputBox"> |
261 | 261 | <?php |
262 | - for($i=-24; $i<25; $i++) { |
|
263 | - $seconds = $i*60*60; |
|
264 | - $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ; |
|
262 | + for ($i = -24; $i < 25; $i++) { |
|
263 | + $seconds = $i * 60 * 60; |
|
264 | + $selectedtext = $seconds == $server_offset_time ? "selected='selected'" : ""; |
|
265 | 265 | ?> |
266 | 266 | <option value="<?php echo $seconds; ?>" <?php echo $selectedtext; ?>><?php echo $i; ?></option> |
267 | 267 | <?php |
268 | 268 | } |
269 | 269 | ?> |
270 | 270 | </select> |
271 | - <div class="comment"><?php printf($_lang['serveroffset_message'], strftime('%H:%M:%S', time()), strftime('%H:%M:%S', time()+$server_offset_time)); ?></div> |
|
271 | + <div class="comment"><?php printf($_lang['serveroffset_message'], strftime('%H:%M:%S', time()), strftime('%H:%M:%S', time() + $server_offset_time)); ?></div> |
|
272 | 272 | </td> |
273 | 273 | </tr> |
274 | 274 | <tr> |
275 | 275 | <th><?php echo $_lang['server_protocol_title'] ?><br><small>[(server_protocol)]</small></th> |
276 | 276 | <td> |
277 | - <?php echo wrap_label($_lang['server_protocol_http'],form_radio('server_protocol', 'http'));?><br /> |
|
278 | - <?php echo wrap_label($_lang['server_protocol_https'], form_radio('server_protocol', 'https'));?> |
|
277 | + <?php echo wrap_label($_lang['server_protocol_http'], form_radio('server_protocol', 'http')); ?><br /> |
|
278 | + <?php echo wrap_label($_lang['server_protocol_https'], form_radio('server_protocol', 'https')); ?> |
|
279 | 279 | <div class="comment"><?php echo $_lang['server_protocol_message'] ?></div> |
280 | 280 | </td> |
281 | 281 | </tr> |
@@ -288,8 +288,8 @@ discard block |
||
288 | 288 | <tr> |
289 | 289 | <th><?php echo $_lang['track_visitors_title'] ?><br><small>[(track_visitors)]</small></th> |
290 | 290 | <td> |
291 | - <?php echo wrap_label($_lang['yes'],form_radio('track_visitors', 1));?><br /> |
|
292 | - <?php echo wrap_label($_lang['no'],form_radio('track_visitors', 0));?> |
|
291 | + <?php echo wrap_label($_lang['yes'], form_radio('track_visitors', 1)); ?><br /> |
|
292 | + <?php echo wrap_label($_lang['no'], form_radio('track_visitors', 0)); ?> |
|
293 | 293 | <div class="comment"><?php echo $_lang['track_visitors_message'] ?></div> |
294 | 294 | </td> |
295 | 295 | </tr> |
@@ -301,7 +301,7 @@ discard block |
||
301 | 301 | <?php |
302 | 302 | // invoke OnSiteSettingsRender event |
303 | 303 | $evtOut = $modx->invokeEvent('OnSiteSettingsRender'); |
304 | - if(is_array($evtOut)) echo implode("",$evtOut); |
|
304 | + if (is_array($evtOut)) echo implode("", $evtOut); |
|
305 | 305 | ?> |
306 | 306 | </td> |
307 | 307 | </tr> |
@@ -82,23 +82,23 @@ discard block |
||
82 | 82 | <?php |
83 | 83 | |
84 | 84 | $currentCategory = ''; |
85 | - while ($row = $modx->getDatabase()->getRow($rs)) { |
|
85 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
86 | 86 | $thisCategory = $row['category']; |
87 | - if($thisCategory == null) { |
|
87 | + if($thisCategory == null) { |
|
88 | 88 | $thisCategory = $_lang['no_category']; |
89 | 89 | } |
90 | - if($thisCategory != $currentCategory) { |
|
91 | - if($closeOptGroup) { |
|
90 | + if($thisCategory != $currentCategory) { |
|
91 | + if($closeOptGroup) { |
|
92 | 92 | echo "\t\t\t\t\t</optgroup>\n"; |
93 | 93 | } |
94 | 94 | echo "\t\t\t\t\t<optgroup label=\"$thisCategory\">\n"; |
95 | 95 | $closeOptGroup = true; |
96 | - } else { |
|
96 | + } else { |
|
97 | 97 | $closeOptGroup = false; |
98 | 98 | } |
99 | 99 | |
100 | 100 | $selectedtext = $row['id'] == $default_template ? ' selected="selected"' : ''; |
101 | - if ($selectedtext) { |
|
101 | + if ($selectedtext) { |
|
102 | 102 | $oldTmpId = $row['id']; |
103 | 103 | $oldTmpName = $row['templatename']; |
104 | 104 | } |
@@ -106,7 +106,7 @@ discard block |
||
106 | 106 | echo "\t\t\t\t\t".'<option value="'.$row['id'].'"'.$selectedtext.'>'.$row['templatename']."</option>\n"; |
107 | 107 | $currentCategory = $thisCategory; |
108 | 108 | } |
109 | - if($thisCategory != '') { |
|
109 | + if($thisCategory != '') { |
|
110 | 110 | echo "\t\t\t\t\t</optgroup>\n"; |
111 | 111 | } |
112 | 112 | ?> |
@@ -138,11 +138,12 @@ discard block |
||
138 | 138 | $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('site_plugins'), |
139 | 139 | "plugincode LIKE '%phx.parser.class.inc.php%OnParseDocument();%' AND disabled != 1") |
140 | 140 | ); |
141 | - if($count) { |
|
141 | + if($count) { |
|
142 | 142 | $disabledFilters = 1; |
143 | 143 | echo '<b>'.$_lang['enable_filter_phx_warning'].'</b><br/>'; |
144 | - } |
|
145 | - else $disabledFilters = false; |
|
144 | + } else { |
|
145 | + $disabledFilters = false; |
|
146 | + } |
|
146 | 147 | ?> |
147 | 148 | <?php echo wrap_label($_lang['yes'],form_radio('enable_filter', 1, '', $disabledFilters));?><br /> |
148 | 149 | <?php echo wrap_label($_lang['no'], form_radio('enable_filter', 0, '', $disabledFilters));?> |
@@ -204,7 +205,7 @@ discard block |
||
204 | 205 | <select name="lst_custom_contenttype" style="width:200px;height:100px;" size="5"> |
205 | 206 | <?php |
206 | 207 | $ct = explode(",",$custom_contenttype); |
207 | - for($i=0;$i<count($ct);$i++) { |
|
208 | + for($i=0;$i<count($ct);$i++) { |
|
208 | 209 | echo "<option value=\"".$ct[$i]."\">".$ct[$i]."</option>"; |
209 | 210 | } |
210 | 211 | ?> |
@@ -259,7 +260,7 @@ discard block |
||
259 | 260 | <th><?php echo $_lang['serveroffset_title'] ?><br><small>[(server_offset_time)]</small></th> |
260 | 261 | <td> <select name="server_offset_time" size="1" class="inputBox"> |
261 | 262 | <?php |
262 | - for($i=-24; $i<25; $i++) { |
|
263 | + for($i=-24; $i<25; $i++) { |
|
263 | 264 | $seconds = $i*60*60; |
264 | 265 | $selectedtext = $seconds==$server_offset_time ? "selected='selected'" : "" ; |
265 | 266 | ?> |
@@ -301,7 +302,9 @@ discard block |
||
301 | 302 | <?php |
302 | 303 | // invoke OnSiteSettingsRender event |
303 | 304 | $evtOut = $modx->invokeEvent('OnSiteSettingsRender'); |
304 | - if(is_array($evtOut)) echo implode("",$evtOut); |
|
305 | + if(is_array($evtOut)) { |
|
306 | + echo implode("",$evtOut); |
|
307 | + } |
|
305 | 308 | ?> |
306 | 309 | </td> |
307 | 310 | </tr> |
@@ -1,32 +1,32 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('web_access_permissions')) { |
6 | - $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
6 | + $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // find all document groups, for the select :) |
10 | 10 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('documentgroup_names'), '', 'name'); |
11 | 11 | if($modx->getDatabase()->getRecordCount($rs) < 1) { |
12 | - $docgroupselector = "[no groups to add]"; |
|
12 | + $docgroupselector = "[no groups to add]"; |
|
13 | 13 | } else { |
14 | - $docgroupselector = '<select name="docgroup">' . "\n"; |
|
15 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
16 | - $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
17 | - } |
|
18 | - $docgroupselector .= "</select>\n"; |
|
14 | + $docgroupselector = '<select name="docgroup">' . "\n"; |
|
15 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
16 | + $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
17 | + } |
|
18 | + $docgroupselector .= "</select>\n"; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('webgroup_names'), '', 'name'); |
22 | 22 | if($modx->getDatabase()->getRecordCount($rs) < 1) { |
23 | - $usrgroupselector = '[no user groups]'; |
|
23 | + $usrgroupselector = '[no user groups]'; |
|
24 | 24 | } else { |
25 | - $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
26 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
27 | - $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
28 | - } |
|
29 | - $usrgroupselector .= "</select>\n"; |
|
25 | + $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
26 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
27 | + $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
28 | + } |
|
29 | + $usrgroupselector .= "</select>\n"; |
|
30 | 30 | } |
31 | 31 | |
32 | 32 | ?> |
@@ -88,24 +88,24 @@ discard block |
||
88 | 88 | </form> |
89 | 89 | </div> |
90 | 90 | <?php |
91 | - $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getDatabase()->getFullTableName('webgroup_names') . " AS groupnames |
|
91 | + $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getDatabase()->getFullTableName('webgroup_names') . " AS groupnames |
|
92 | 92 | LEFT JOIN " . $modx->getDatabase()->getFullTableName('web_groups') . " AS groups ON groups.webgroup = groupnames.id |
93 | 93 | LEFT JOIN " . $modx->getDatabase()->getFullTableName('web_users') . " AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name'); |
94 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
95 | - ?> |
|
94 | + if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
95 | + ?> |
|
96 | 96 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
97 | 97 | <?php |
98 | - } else { |
|
99 | - ?> |
|
98 | + } else { |
|
99 | + ?> |
|
100 | 100 | <div class="form-group"> |
101 | 101 | <?php |
102 | - $pid = ''; |
|
103 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
104 | - if($pid != $row['id']) { |
|
105 | - if($pid != '') { |
|
106 | - echo '</div><div class="form-group">'; |
|
107 | - } |
|
108 | - ?> |
|
102 | + $pid = ''; |
|
103 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
104 | + if($pid != $row['id']) { |
|
105 | + if($pid != '') { |
|
106 | + echo '</div><div class="form-group">'; |
|
107 | + } |
|
108 | + ?> |
|
109 | 109 | <form method="post" action="index.php" name="accesspermissions"> |
110 | 110 | <input type="hidden" name="a" value="92" /> |
111 | 111 | <input type="hidden" name="groupid" value="<?= $row['id'] ?>" /> |
@@ -120,21 +120,21 @@ discard block |
||
120 | 120 | </form> |
121 | 121 | <?= $_lang['web_access_permissions_users_in_group'] ?> |
122 | 122 | <?php |
123 | - } |
|
124 | - if(!$row['user_id']) { |
|
125 | - ?> |
|
123 | + } |
|
124 | + if(!$row['user_id']) { |
|
125 | + ?> |
|
126 | 126 | <i><?= $_lang['access_permissions_no_users_in_group'] ?></i> |
127 | 127 | <?php |
128 | - $pid = $row['id']; |
|
129 | - continue; |
|
130 | - } |
|
131 | - ?> |
|
128 | + $pid = $row['id']; |
|
129 | + continue; |
|
130 | + } |
|
131 | + ?> |
|
132 | 132 | <?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=88&id=<?= $row['user_id'] ?>"><?= $row['user_name'] ?></a> |
133 | 133 | <?php |
134 | - $pid = $row['id']; |
|
135 | - } |
|
136 | - } |
|
137 | - ?> |
|
134 | + $pid = $row['id']; |
|
135 | + } |
|
136 | + } |
|
137 | + ?> |
|
138 | 138 | </div> |
139 | 139 | </div> |
140 | 140 | </div> |
@@ -159,24 +159,24 @@ discard block |
||
159 | 159 | </form> |
160 | 160 | </div> |
161 | 161 | <?php |
162 | - $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getDatabase()->getFullTableName('documentgroup_names') . " AS dgnames |
|
162 | + $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getDatabase()->getFullTableName('documentgroup_names') . " AS dgnames |
|
163 | 163 | LEFT JOIN " . $modx->getDatabase()->getFullTableName('document_groups') . " AS dg ON dg.document_group = dgnames.id |
164 | 164 | LEFT JOIN " . $modx->getDatabase()->getFullTableName('site_content') . " AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id'); |
165 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
166 | - ?> |
|
165 | + if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
166 | + ?> |
|
167 | 167 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
168 | 168 | <?php |
169 | - } else { |
|
170 | - ?> |
|
169 | + } else { |
|
170 | + ?> |
|
171 | 171 | <div class="form-group"> |
172 | 172 | <?php |
173 | - $pid = ''; |
|
174 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
175 | - if($pid != $row['id']) { |
|
176 | - if($pid != '') { |
|
177 | - echo '</div><div class="form-group">'; |
|
178 | - } |
|
179 | - ?> |
|
173 | + $pid = ''; |
|
174 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
175 | + if($pid != $row['id']) { |
|
176 | + if($pid != '') { |
|
177 | + echo '</div><div class="form-group">'; |
|
178 | + } |
|
179 | + ?> |
|
180 | 180 | <form method="post" action="index.php" name="accesspermissions"> |
181 | 181 | <input type="hidden" name="a" value="92" /> |
182 | 182 | <input type="hidden" name="groupid" value="<?= $row['id'] ?>" /> |
@@ -191,21 +191,21 @@ discard block |
||
191 | 191 | </form> |
192 | 192 | <?= $_lang['access_permissions_resources_in_group'] ?> |
193 | 193 | <?php |
194 | - } |
|
195 | - if(!$row['doc_id']) { |
|
196 | - ?> |
|
194 | + } |
|
195 | + if(!$row['doc_id']) { |
|
196 | + ?> |
|
197 | 197 | <i><?= $_lang['access_permissions_no_resources_in_group'] ?></i> |
198 | 198 | <?php |
199 | - $pid = $row['id']; |
|
200 | - continue; |
|
201 | - } |
|
202 | - ?> |
|
199 | + $pid = $row['id']; |
|
200 | + continue; |
|
201 | + } |
|
202 | + ?> |
|
203 | 203 | <?= ($pid == $row['id'] ? ', ' : '') ?><a href="index.php?a=3&id=<?= $row['doc_id'] ?>" title="<?= $modx->getPhpCompat()->htmlspecialchars($row['doc_title']) ?>"><?= $row['doc_id'] ?></a> |
204 | 204 | <?php |
205 | - $pid = $row['id']; |
|
206 | - } |
|
207 | - } |
|
208 | - ?> |
|
205 | + $pid = $row['id']; |
|
206 | + } |
|
207 | + } |
|
208 | + ?> |
|
209 | 209 | </div> |
210 | 210 | </div> |
211 | 211 | </div> |
@@ -217,15 +217,15 @@ discard block |
||
217 | 217 | <div class="container container-body"> |
218 | 218 | <p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p> |
219 | 219 | <?php |
220 | - $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getDatabase()->getFullTableName('webgroup_names') . " AS groupnames |
|
220 | + $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getDatabase()->getFullTableName('webgroup_names') . " AS groupnames |
|
221 | 221 | LEFT JOIN " . $modx->getDatabase()->getFullTableName('webgroup_access') . " AS groupacc ON groupacc.webgroup = groupnames.id |
222 | 222 | LEFT JOIN " . $modx->getDatabase()->getFullTableName('documentgroup_names') . " AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name'); |
223 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
224 | - ?> |
|
223 | + if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
224 | + ?> |
|
225 | 225 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
226 | 226 | <?php |
227 | - } else { |
|
228 | - ?> |
|
227 | + } else { |
|
228 | + ?> |
|
229 | 229 | <div class="form-group"> |
230 | 230 | <b><?= $_lang["access_permissions_group_link"] ?></b> |
231 | 231 | <form method="post" action="index.php" name="accesspermissions"> |
@@ -241,38 +241,38 @@ discard block |
||
241 | 241 | <hr> |
242 | 242 | <ul> |
243 | 243 | <?php |
244 | - $pid = ''; |
|
245 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
246 | - if($row['id'] != $pid) { |
|
247 | - if($pid != '') { |
|
248 | - echo '</ul></li>'; |
|
249 | - } // close previous one |
|
250 | - ?> |
|
244 | + $pid = ''; |
|
245 | + while($row = $modx->getDatabase()->getRow($rs)) { |
|
246 | + if($row['id'] != $pid) { |
|
247 | + if($pid != '') { |
|
248 | + echo '</ul></li>'; |
|
249 | + } // close previous one |
|
250 | + ?> |
|
251 | 251 | <li><b><?= $row['name'] ?></b></li> |
252 | 252 | <?php |
253 | - if(!$row['dg_id']) { |
|
254 | - echo '<i>' . $_lang['no_groups_found'] . '</i></li>'; |
|
255 | - $pid = ''; |
|
256 | - continue; |
|
257 | - } else { |
|
258 | - echo '<ul>'; |
|
259 | - } |
|
260 | - } |
|
261 | - if(!$row['dg_id']) { |
|
262 | - continue; |
|
263 | - } |
|
264 | - ?> |
|
253 | + if(!$row['dg_id']) { |
|
254 | + echo '<i>' . $_lang['no_groups_found'] . '</i></li>'; |
|
255 | + $pid = ''; |
|
256 | + continue; |
|
257 | + } else { |
|
258 | + echo '<ul>'; |
|
259 | + } |
|
260 | + } |
|
261 | + if(!$row['dg_id']) { |
|
262 | + continue; |
|
263 | + } |
|
264 | + ?> |
|
265 | 265 | <li><?= $row['dg_name'] ?> |
266 | 266 | <small><i>(<a class="text-danger" href="index.php?a=92&coupling=<?= $row['link_id'] ?>&operation=remove_document_group_from_user_group"><?= $_lang['remove'] ?></a>)</i></small> |
267 | 267 | </li> |
268 | 268 | <?php |
269 | - $pid = $row['id']; |
|
270 | - } |
|
271 | - ?> |
|
269 | + $pid = $row['id']; |
|
270 | + } |
|
271 | + ?> |
|
272 | 272 | </ul> |
273 | 273 | <?php |
274 | - } |
|
275 | - ?> |
|
274 | + } |
|
275 | + ?> |
|
276 | 276 | </div> |
277 | 277 | </div> |
278 | 278 |
@@ -1,30 +1,30 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('web_access_permissions')) { |
|
5 | +if (!$modx->hasPermission('web_access_permissions')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | 9 | // find all document groups, for the select :) |
10 | 10 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('documentgroup_names'), '', 'name'); |
11 | -if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
11 | +if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
12 | 12 | $docgroupselector = "[no groups to add]"; |
13 | 13 | } else { |
14 | - $docgroupselector = '<select name="docgroup">' . "\n"; |
|
15 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
16 | - $docgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
14 | + $docgroupselector = '<select name="docgroup">'."\n"; |
|
15 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
16 | + $docgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n"; |
|
17 | 17 | } |
18 | 18 | $docgroupselector .= "</select>\n"; |
19 | 19 | } |
20 | 20 | |
21 | 21 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('webgroup_names'), '', 'name'); |
22 | -if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
22 | +if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
23 | 23 | $usrgroupselector = '[no user groups]'; |
24 | 24 | } else { |
25 | - $usrgroupselector = '<select name="usergroup">' . "\n"; |
|
26 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
27 | - $usrgroupselector .= "\t" . '<option value="' . $row['id'] . '">' . $row['name'] . "</option>\n"; |
|
25 | + $usrgroupselector = '<select name="usergroup">'."\n"; |
|
26 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
27 | + $usrgroupselector .= "\t".'<option value="'.$row['id'].'">'.$row['name']."</option>\n"; |
|
28 | 28 | } |
29 | 29 | $usrgroupselector .= "</select>\n"; |
30 | 30 | } |
@@ -60,7 +60,7 @@ discard block |
||
60 | 60 | <div class="alert alert-info"><?= $_lang['access_permissions_introtext'] ?></div> |
61 | 61 | </div> |
62 | 62 | |
63 | -<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">' . $_lang['access_permissions_off'] . '</div>' : '') ?></div> |
|
63 | +<div class="container"><?= ($use_udperms != 1 ? '<div class="alert alert-danger">'.$_lang['access_permissions_off'].'</div>' : '') ?></div> |
|
64 | 64 | |
65 | 65 | |
66 | 66 | <div class="tab-pane" id="wuapPane"> |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | </form> |
89 | 89 | </div> |
90 | 90 | <?php |
91 | - $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getDatabase()->getFullTableName('webgroup_names') . " AS groupnames |
|
92 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName('web_groups') . " AS groups ON groups.webgroup = groupnames.id |
|
93 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName('web_users') . " AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name'); |
|
94 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
91 | + $rs = $modx->getDatabase()->select('groupnames.*, users.id AS user_id, users.username user_name ', $modx->getDatabase()->getFullTableName('webgroup_names')." AS groupnames |
|
92 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName('web_groups')." AS groups ON groups.webgroup = groupnames.id |
|
93 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName('web_users')." AS users ON users.id = groups.webuser", '', 'groupnames.name, user_name'); |
|
94 | + if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
95 | 95 | ?> |
96 | 96 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
97 | 97 | <?php |
@@ -100,9 +100,9 @@ discard block |
||
100 | 100 | <div class="form-group"> |
101 | 101 | <?php |
102 | 102 | $pid = ''; |
103 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
104 | - if($pid != $row['id']) { |
|
105 | - if($pid != '') { |
|
103 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
104 | + if ($pid != $row['id']) { |
|
105 | + if ($pid != '') { |
|
106 | 106 | echo '</div><div class="form-group">'; |
107 | 107 | } |
108 | 108 | ?> |
@@ -121,7 +121,7 @@ discard block |
||
121 | 121 | <?= $_lang['web_access_permissions_users_in_group'] ?> |
122 | 122 | <?php |
123 | 123 | } |
124 | - if(!$row['user_id']) { |
|
124 | + if (!$row['user_id']) { |
|
125 | 125 | ?> |
126 | 126 | <i><?= $_lang['access_permissions_no_users_in_group'] ?></i> |
127 | 127 | <?php |
@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | </form> |
160 | 160 | </div> |
161 | 161 | <?php |
162 | - $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getDatabase()->getFullTableName('documentgroup_names') . " AS dgnames |
|
163 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName('document_groups') . " AS dg ON dg.document_group = dgnames.id |
|
164 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName('site_content') . " AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id'); |
|
165 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
162 | + $rs = $modx->getDatabase()->select('dgnames.id, dgnames.name, sc.id AS doc_id, sc.pagetitle AS doc_title', $modx->getDatabase()->getFullTableName('documentgroup_names')." AS dgnames |
|
163 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName('document_groups')." AS dg ON dg.document_group = dgnames.id |
|
164 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName('site_content')." AS sc ON sc.id = dg.document", '', 'dgnames.name, sc.id'); |
|
165 | + if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
166 | 166 | ?> |
167 | 167 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
168 | 168 | <?php |
@@ -171,9 +171,9 @@ discard block |
||
171 | 171 | <div class="form-group"> |
172 | 172 | <?php |
173 | 173 | $pid = ''; |
174 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
175 | - if($pid != $row['id']) { |
|
176 | - if($pid != '') { |
|
174 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
175 | + if ($pid != $row['id']) { |
|
176 | + if ($pid != '') { |
|
177 | 177 | echo '</div><div class="form-group">'; |
178 | 178 | } |
179 | 179 | ?> |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | <?= $_lang['access_permissions_resources_in_group'] ?> |
193 | 193 | <?php |
194 | 194 | } |
195 | - if(!$row['doc_id']) { |
|
195 | + if (!$row['doc_id']) { |
|
196 | 196 | ?> |
197 | 197 | <i><?= $_lang['access_permissions_no_resources_in_group'] ?></i> |
198 | 198 | <?php |
@@ -217,10 +217,10 @@ discard block |
||
217 | 217 | <div class="container container-body"> |
218 | 218 | <p class="element-edit-message-tab alert alert-warning"><?= $_lang['access_permissions_links_tab'] ?></p> |
219 | 219 | <?php |
220 | - $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getDatabase()->getFullTableName('webgroup_names') . " AS groupnames |
|
221 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName('webgroup_access') . " AS groupacc ON groupacc.webgroup = groupnames.id |
|
222 | - LEFT JOIN " . $modx->getDatabase()->getFullTableName('documentgroup_names') . " AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name'); |
|
223 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
220 | + $rs = $modx->getDatabase()->select('groupnames.*, groupacc.id AS link_id, dgnames.id AS dg_id, dgnames.name AS dg_name', $modx->getDatabase()->getFullTableName('webgroup_names')." AS groupnames |
|
221 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName('webgroup_access')." AS groupacc ON groupacc.webgroup = groupnames.id |
|
222 | + LEFT JOIN " . $modx->getDatabase()->getFullTableName('documentgroup_names')." AS dgnames ON dgnames.id = groupacc.documentgroup", '', 'name, dg_name'); |
|
223 | + if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
224 | 224 | ?> |
225 | 225 | <div class="text-danger"><?= $_lang['no_groups_found'] ?></div> |
226 | 226 | <?php |
@@ -242,23 +242,23 @@ discard block |
||
242 | 242 | <ul> |
243 | 243 | <?php |
244 | 244 | $pid = ''; |
245 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
246 | - if($row['id'] != $pid) { |
|
247 | - if($pid != '') { |
|
245 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
246 | + if ($row['id'] != $pid) { |
|
247 | + if ($pid != '') { |
|
248 | 248 | echo '</ul></li>'; |
249 | 249 | } // close previous one |
250 | 250 | ?> |
251 | 251 | <li><b><?= $row['name'] ?></b></li> |
252 | 252 | <?php |
253 | - if(!$row['dg_id']) { |
|
254 | - echo '<i>' . $_lang['no_groups_found'] . '</i></li>'; |
|
253 | + if (!$row['dg_id']) { |
|
254 | + echo '<i>'.$_lang['no_groups_found'].'</i></li>'; |
|
255 | 255 | $pid = ''; |
256 | 256 | continue; |
257 | 257 | } else { |
258 | 258 | echo '<ul>'; |
259 | 259 | } |
260 | 260 | } |
261 | - if(!$row['dg_id']) { |
|
261 | + if (!$row['dg_id']) { |
|
262 | 262 | continue; |
263 | 263 | } |
264 | 264 | ?> |
@@ -1,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | -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->getDatabase()->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->getDatabase()->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0; |
|
33 | - $isfolder = $modx->getDatabase()->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->getDatabase()->getValue("SELECT parent FROM ".$tbl_site_content." WHERE id=$id LIMIT 1")) : 0; |
|
33 | + $isfolder = $modx->getDatabase()->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->getDatabase()->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->getDatabase()->getRow($rs); |
43 | -if(!$content) { |
|
43 | +if (!$content) { |
|
44 | 44 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
45 | 45 | } |
46 | 46 | |
@@ -82,11 +82,11 @@ discard block |
||
82 | 82 | ); |
83 | 83 | $filter_sort = ''; |
84 | 84 | $filter_dir = ''; |
85 | -if($numRecords > 0) { |
|
86 | - $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 - // |
|
87 | - '<option value="published"' . (($sort == 'published') ? ' selected' : '') . '>' . $_lang['resource_opt_is_published'] . '</option>' . //********// |
|
85 | +if ($numRecords > 0) { |
|
86 | + $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 - // |
|
87 | + '<option value="published"'.(($sort == 'published') ? ' selected' : '').'>'.$_lang['resource_opt_is_published'].'</option>'.//********// |
|
88 | 88 | '</select>'; |
89 | - $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>'; |
|
89 | + $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>'; |
|
90 | 90 | $resource = $modx->getDatabase()->makeArray($rs); |
91 | 91 | |
92 | 92 | // CSS style for table |
@@ -130,10 +130,10 @@ discard block |
||
130 | 130 | ); |
131 | 131 | $modx->getMakeTable()->setColumnWidths($tbWidth); |
132 | 132 | |
133 | - $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; |
|
134 | - $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; |
|
135 | - $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; |
|
136 | - $add_path = $sd . $sb . $pg; |
|
133 | + $sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC'; |
|
134 | + $sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon'; |
|
135 | + $pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : ''; |
|
136 | + $add_path = $sd.$sb.$pg; |
|
137 | 137 | |
138 | 138 | $icons = array( |
139 | 139 | 'text/html' => $_style['tree_page_html'], |
@@ -151,9 +151,9 @@ discard block |
||
151 | 151 | ); |
152 | 152 | |
153 | 153 | $listDocs = array(); |
154 | - foreach($resource as $k => $children) { |
|
154 | + foreach ($resource as $k => $children) { |
|
155 | 155 | |
156 | - switch($children['id']) { |
|
156 | + switch ($children['id']) { |
|
157 | 157 | case $modx->config['site_start'] : |
158 | 158 | $icon = $_style['tree_page_home']; |
159 | 159 | break; |
@@ -167,10 +167,10 @@ discard block |
||
167 | 167 | $icon = $_style['tree_page_info']; |
168 | 168 | break; |
169 | 169 | default: |
170 | - if($children['isfolder']) { |
|
170 | + if ($children['isfolder']) { |
|
171 | 171 | $icon = $_style['tree_folder_new']; |
172 | 172 | } else { |
173 | - if(isset($icons[$children['contentType']])) { |
|
173 | + if (isset($icons[$children['contentType']])) { |
|
174 | 174 | $icon = $icons[$children['contentType']]; |
175 | 175 | } else { |
176 | 176 | $icon = $_style['tree_page']; |
@@ -185,32 +185,32 @@ discard block |
||
185 | 185 | $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish')); |
186 | 186 | //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary'); |
187 | 187 | //$class .= ($children['isfolder'] ? ' font-weight-bold' : ''); |
188 | - if($modx->hasPermission('edit_document')) { |
|
189 | - $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>'; |
|
188 | + if ($modx->hasPermission('edit_document')) { |
|
189 | + $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 | 190 | } else { |
191 | - $title = '<span class="doc-item' . $private . '">' . $icon . '<span class="' . $class . '">' . $children['pagetitle'] . '</span></span>'; |
|
191 | + $title = '<span class="doc-item'.$private.'">'.$icon.'<span class="'.$class.'">'.$children['pagetitle'].'</span></span>'; |
|
192 | 192 | } |
193 | 193 | |
194 | - $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>'; |
|
194 | + $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>'; |
|
195 | 195 | |
196 | - $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>'; |
|
196 | + $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>'; |
|
197 | 197 | |
198 | 198 | $listDocs[] = array( |
199 | - 'docid' => '<div class="text-right">' . $children['id'] . '</div>', |
|
199 | + 'docid' => '<div class="text-right">'.$children['id'].'</div>', |
|
200 | 200 | 'title' => $title, |
201 | - 'createdon' => '<div class="text-right">' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '</div>', |
|
202 | - 'pub_date' => '<div class="text-right">' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '</div>', |
|
203 | - '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>', |
|
204 | - '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 |
|
205 | - class="' . $_style["icons_move_document"] . '"></i></a>' . $icon_pub_unpub : '') . ($modx->hasPermission('delete_document') ? $icon_del_undel : '') . '</div>' |
|
201 | + 'createdon' => '<div class="text-right">'.($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')).'</div>', |
|
202 | + 'pub_date' => '<div class="text-right">'.($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '').'</div>', |
|
203 | + '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>', |
|
204 | + '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 |
|
205 | + class="' . $_style["icons_move_document"].'"></i></a>'.$icon_pub_unpub : '').($modx->hasPermission('delete_document') ? $icon_del_undel : '').'</div>' |
|
206 | 206 | ); |
207 | 207 | } |
208 | 208 | |
209 | - $modx->getMakeTable()->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); |
|
210 | - $children_output = $modx->getMakeTable()->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); |
|
209 | + $modx->getMakeTable()->createPagingNavigation($numRecords, 'a=3&id='.$content['id'].'&dir='.$dir.'&sort='.$sort); |
|
210 | + $children_output = $modx->getMakeTable()->create($listDocs, $listTableHeader, 'index.php?a=3&id='.$content['id']); |
|
211 | 211 | } else { |
212 | 212 | // No Child documents |
213 | - $children_output = '<div class="container"><p>' . $_lang['resources_in_container_no'] . '</p></div>'; |
|
213 | + $children_output = '<div class="container"><p>'.$_lang['resources_in_container_no'].'</p></div>'; |
|
214 | 214 | } |
215 | 215 | ?> |
216 | 216 | <script type="text/javascript"> |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | }, |
237 | 237 | cancel: function() { |
238 | 238 | documentDirty = false; |
239 | - document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id=' . $id . $add_path) ?>'; |
|
239 | + document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id='.$id.$add_path) ?>'; |
|
240 | 240 | }, |
241 | 241 | move: function() { |
242 | 242 | document.location.href = "index.php?id=<?= $_REQUEST['id'] ?>&a=51"; |
@@ -247,7 +247,7 @@ discard block |
||
247 | 247 | } |
248 | 248 | }, |
249 | 249 | view: function() { |
250 | - window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'] . 'index.php?id=' . $id ?>', 'previeWin'); |
|
250 | + window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'].'index.php?id='.$id ?>', 'previeWin'); |
|
251 | 251 | } |
252 | 252 | }; |
253 | 253 | |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | <script type="text/javascript" src="media/script/tablesort.js"></script> |
256 | 256 | |
257 | 257 | <h1> |
258 | - <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>' ?> |
|
258 | + <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>' ?> |
|
259 | 259 | </h1> |
260 | 260 | |
261 | 261 | <?= $_style['actionbuttons']['static']['document'] ?> |
@@ -282,16 +282,16 @@ discard block |
||
282 | 282 | <tr> |
283 | 283 | <td width="200" valign="top"><?= $_lang['long_title'] ?>:</td> |
284 | 284 | <td> |
285 | - <small><?= $content['longtitle'] != '' ? $content['longtitle'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></small> |
|
285 | + <small><?= $content['longtitle'] != '' ? $content['longtitle'] : "(<i>".$_lang['not_set']."</i>)" ?></small> |
|
286 | 286 | </td> |
287 | 287 | </tr> |
288 | 288 | <tr> |
289 | 289 | <td valign="top"><?= $_lang['resource_description'] ?>:</td> |
290 | - <td><?= $content['description'] != '' ? $content['description'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></td> |
|
290 | + <td><?= $content['description'] != '' ? $content['description'] : "(<i>".$_lang['not_set']."</i>)" ?></td> |
|
291 | 291 | </tr> |
292 | 292 | <tr> |
293 | 293 | <td valign="top"><?= $_lang['resource_summary'] ?>:</td> |
294 | - <td><?= $content['introtext'] != '' ? $content['introtext'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></td> |
|
294 | + <td><?= $content['introtext'] != '' ? $content['introtext'] : "(<i>".$_lang['not_set']."</i>)" ?></td> |
|
295 | 295 | </tr> |
296 | 296 | <tr> |
297 | 297 | <td valign="top"><?= $_lang['type'] ?>:</td> |
@@ -299,7 +299,7 @@ discard block |
||
299 | 299 | </tr> |
300 | 300 | <tr> |
301 | 301 | <td valign="top"><?= $_lang['resource_alias'] ?>:</td> |
302 | - <td><?= $content['alias'] != '' ? $content['alias'] : "(<i>" . $_lang['not_set'] . "</i>)" ?></td> |
|
302 | + <td><?= $content['alias'] != '' ? $content['alias'] : "(<i>".$_lang['not_set']."</i>)" ?></td> |
|
303 | 303 | </tr> |
304 | 304 | <tr> |
305 | 305 | <td colspan="2"> </td> |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | <td><?= $modx->toDateFormat($content['createdon'] + $server_offset_time) ?> (<b><?= $createdbyname ?></b>) |
313 | 313 | </td> |
314 | 314 | </tr> |
315 | - <?php if($editedbyname != '') { ?> |
|
315 | + <?php if ($editedbyname != '') { ?> |
|
316 | 316 | <tr> |
317 | 317 | <td><?= $_lang['page_data_edited'] ?>:</td> |
318 | 318 | <td><?= $modx->toDateFormat($content['editedon'] + $server_offset_time) ?> (<b><?= $editedbyname ?></b>) |
@@ -327,15 +327,15 @@ discard block |
||
327 | 327 | </tr> |
328 | 328 | <tr> |
329 | 329 | <td><?= $_lang['page_data_status'] ?>:</td> |
330 | - <td><?= $content['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publisheddoc">' . $_lang['page_data_published'] . '</span>' ?></td> |
|
330 | + <td><?= $content['published'] == 0 ? '<span class="unpublishedDoc">'.$_lang['page_data_unpublished'].'</span>' : '<span class="publisheddoc">'.$_lang['page_data_published'].'</span>' ?></td> |
|
331 | 331 | </tr> |
332 | 332 | <tr> |
333 | 333 | <td><?= $_lang['page_data_publishdate'] ?>:</td> |
334 | - <td><?= $content['pub_date'] == 0 ? "(<i>" . $_lang['not_set'] . "</i>)" : $modx->toDateFormat($content['pub_date']) ?></td> |
|
334 | + <td><?= $content['pub_date'] == 0 ? "(<i>".$_lang['not_set']."</i>)" : $modx->toDateFormat($content['pub_date']) ?></td> |
|
335 | 335 | </tr> |
336 | 336 | <tr> |
337 | 337 | <td><?= $_lang['page_data_unpublishdate'] ?>:</td> |
338 | - <td><?= $content['unpub_date'] == 0 ? "(<i>" . $_lang['not_set'] . "</i>)" : $modx->toDateFormat($content['unpub_date']) ?></td> |
|
338 | + <td><?= $content['unpub_date'] == 0 ? "(<i>".$_lang['not_set']."</i>)" : $modx->toDateFormat($content['unpub_date']) ?></td> |
|
339 | 339 | </tr> |
340 | 340 | <tr> |
341 | 341 | <td><?= $_lang['page_data_cacheable'] ?>:</td> |
@@ -355,11 +355,11 @@ discard block |
||
355 | 355 | </tr> |
356 | 356 | <tr> |
357 | 357 | <td><?= $_lang['page_data_web_access'] ?>:</td> |
358 | - <td><?= $content['privateweb'] == 0 ? $_lang['public'] : '<b style="color: #821517">' . $_lang['private'] . '</b> ' . $_style["icons_secured"] ?></td> |
|
358 | + <td><?= $content['privateweb'] == 0 ? $_lang['public'] : '<b style="color: #821517">'.$_lang['private'].'</b> '.$_style["icons_secured"] ?></td> |
|
359 | 359 | </tr> |
360 | 360 | <tr> |
361 | 361 | <td><?= $_lang['page_data_mgr_access'] ?>:</td> |
362 | - <td><?= $content['privatemgr'] == 0 ? $_lang['public'] : '<b style="color: #821517">' . $_lang['private'] . '</b> ' . $_style["icons_secured"] ?></td> |
|
362 | + <td><?= $content['privatemgr'] == 0 ? $_lang['public'] : '<b style="color: #821517">'.$_lang['private'].'</b> '.$_style["icons_secured"] ?></td> |
|
363 | 363 | </tr> |
364 | 364 | <tr> |
365 | 365 | <td colspan="2"> </td> |
@@ -389,13 +389,13 @@ discard block |
||
389 | 389 | <script type="text/javascript">docSettings.addTabPage(document.getElementById("tabChildren"));</script> |
390 | 390 | <div class="container container-body"> |
391 | 391 | <div class="form-group clearfix"> |
392 | - <?php if($numRecords > 0) : ?> |
|
392 | + <?php if ($numRecords > 0) : ?> |
|
393 | 393 | <div class="float-xs-left"> |
394 | - <span class="publishedDoc"><?= $numRecords . ' ' . $_lang['resources_in_container'] ?> (<strong><?= $content['pagetitle'] ?></strong>)</span> |
|
394 | + <span class="publishedDoc"><?= $numRecords.' '.$_lang['resources_in_container'] ?> (<strong><?= $content['pagetitle'] ?></strong>)</span> |
|
395 | 395 | </div> |
396 | 396 | <?php endif; ?> |
397 | 397 | <div class="float-xs-right"> |
398 | - <?= $filter_sort . ' ' . $filter_dir ?> |
|
398 | + <?= $filter_sort.' '.$filter_dir ?> |
|
399 | 399 | </div> |
400 | 400 | |
401 | 401 | </div> |
@@ -405,23 +405,23 @@ discard block |
||
405 | 405 | </div> |
406 | 406 | </div><!-- end tab-page --> |
407 | 407 | |
408 | - <?php if($modx->config['cache_type'] != 2) { ?> |
|
408 | + <?php if ($modx->config['cache_type'] != 2) { ?> |
|
409 | 409 | <!-- Page Source --> |
410 | 410 | <div class="tab-page" id="tabSource"> |
411 | 411 | <h2 class="tab"><?= $_lang['page_data_source'] ?></h2> |
412 | 412 | <script type="text/javascript">docSettings.addTabPage(document.getElementById("tabSource"));</script> |
413 | 413 | <?php |
414 | 414 | $buffer = ""; |
415 | - $filename = $modx->config['base_path'] . "assets/cache/docid_" . $id . ".pageCache.php"; |
|
415 | + $filename = $modx->config['base_path']."assets/cache/docid_".$id.".pageCache.php"; |
|
416 | 416 | $handle = @fopen($filename, "r"); |
417 | - if(!$handle) { |
|
418 | - $buffer = '<div class="container container-body">' . $_lang['page_data_notcached'] . '</div>'; |
|
417 | + if (!$handle) { |
|
418 | + $buffer = '<div class="container container-body">'.$_lang['page_data_notcached'].'</div>'; |
|
419 | 419 | } else { |
420 | - while(!feof($handle)) { |
|
420 | + while (!feof($handle)) { |
|
421 | 421 | $buffer .= fgets($handle, 4096); |
422 | 422 | } |
423 | 423 | fclose($handle); |
424 | - $buffer = '<div class="navbar navbar-editor">' . $_lang['page_data_cached'] . '</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">' . $modx->getPhpCompat()->htmlspecialchars($buffer) . "</textarea></div>\n"; |
|
424 | + $buffer = '<div class="navbar navbar-editor">'.$_lang['page_data_cached'].'</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">'.$modx->getPhpCompat()->htmlspecialchars($buffer)."</textarea></div>\n"; |
|
425 | 425 | } |
426 | 426 | echo $buffer; |
427 | 427 | ?> |
@@ -431,12 +431,12 @@ discard block |
||
431 | 431 | </div><!-- end documentPane --> |
432 | 432 | |
433 | 433 | <?php |
434 | -if(isset($_GET['tab']) && is_numeric($_GET['tab'])) { |
|
435 | - echo '<script type="text/javascript"> docSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
434 | +if (isset($_GET['tab']) && is_numeric($_GET['tab'])) { |
|
435 | + echo '<script type="text/javascript"> docSettings.setSelectedIndex( '.$_GET['tab'].' );</script>'; |
|
436 | 436 | } |
437 | 437 | ?> |
438 | 438 | |
439 | -<?php if($show_preview == 1) { ?> |
|
439 | +<?php if ($show_preview == 1) { ?> |
|
440 | 440 | <div class="sectionHeader"><?= $_lang['preview'] ?></div> |
441 | 441 | <div class="sectionBody" id="lyr2"> |
442 | 442 | <iframe src="<?= MODX_SITE_URL ?>index.php?id=<?= $id ?>&z=manprev" frameborder="0" border="0" id="previewIframe"></iframe> |
@@ -1,15 +1,15 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
3 | - die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
3 | + die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly."); |
|
4 | 4 | } |
5 | 5 | if(!$modx->hasPermission('settings')) { |
6 | - $modx->webAlertAndQuit($_lang['error_no_privileges']); |
|
6 | + $modx->webAlertAndQuit($_lang['error_no_privileges']); |
|
7 | 7 | } |
8 | 8 | |
9 | 9 | // check to see the edit settings page isn't locked |
10 | 10 | $rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'"); |
11 | 11 | if($username = $modx->getDatabase()->getValue($rs)) { |
12 | - $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
|
12 | + $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
|
13 | 13 | } |
14 | 14 | // end check for lock |
15 | 15 | |
@@ -19,7 +19,7 @@ discard block |
||
19 | 19 | include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); |
20 | 20 | $rs = $modx->getDatabase()->select('setting_name, setting_value', $modx->getDatabase()->getFullTableName('system_settings')); |
21 | 21 | while($row = $modx->getDatabase()->getRow($rs)) { |
22 | - $settings[$row['setting_name']] = $row['setting_value']; |
|
22 | + $settings[$row['setting_name']] = $row['setting_value']; |
|
23 | 23 | } |
24 | 24 | $settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']); |
25 | 25 | $settings['rb_base_dir'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['rb_base_dir']); |
@@ -30,11 +30,11 @@ discard block |
||
30 | 30 | $lang_keys = array(); |
31 | 31 | $dir = dir('includes/lang'); |
32 | 32 | while($file = $dir->read()) { |
33 | - if(strpos($file, '.inc.php') > 0) { |
|
34 | - $endpos = strpos($file, '.'); |
|
35 | - $languagename = substr($file, 0, $endpos); |
|
36 | - $lang_keys[$languagename] = get_lang_keys($file); |
|
37 | - } |
|
33 | + if(strpos($file, '.inc.php') > 0) { |
|
34 | + $endpos = strpos($file, '.'); |
|
35 | + $languagename = substr($file, 0, $endpos); |
|
36 | + $lang_keys[$languagename] = get_lang_keys($file); |
|
37 | + } |
|
38 | 38 | } |
39 | 39 | $dir->close(); |
40 | 40 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
@@ -76,14 +76,14 @@ discard block |
||
76 | 76 | </script> |
77 | 77 | |
78 | 78 | <?php |
79 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
80 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
81 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
82 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
83 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
84 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
85 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
86 | - ?> |
|
79 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
80 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
81 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
82 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
83 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
84 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
85 | + include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
86 | + ?> |
|
87 | 87 | </div> |
88 | 88 | </div> |
89 | 89 | </form> |
@@ -130,5 +130,5 @@ discard block |
||
130 | 130 | </script> |
131 | 131 | <?php |
132 | 132 | if(is_numeric($_GET['tab'])) { |
133 | - echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
133 | + echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
134 | 134 | } |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('settings')) { |
|
5 | +if (!$modx->hasPermission('settings')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang['error_no_privileges']); |
7 | 7 | } |
8 | 8 | |
9 | 9 | // check to see the edit settings page isn't locked |
10 | -$rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
11 | -if($username = $modx->getDatabase()->getValue($rs)) { |
|
10 | +$rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=17 AND internalKey!='".$modx->getLoginUserID()."'"); |
|
11 | +if ($username = $modx->getDatabase()->getValue($rs)) { |
|
12 | 12 | $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
13 | 13 | } |
14 | 14 | // end check for lock |
@@ -16,21 +16,21 @@ discard block |
||
16 | 16 | // reload system settings from the database. |
17 | 17 | // this will prevent user-defined settings from being saved as system setting |
18 | 18 | $settings = array(); |
19 | -include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); |
|
19 | +include_once(MODX_MANAGER_PATH.'includes/default_config.php'); |
|
20 | 20 | $rs = $modx->getDatabase()->select('setting_name, setting_value', $modx->getDatabase()->getFullTableName('system_settings')); |
21 | -while($row = $modx->getDatabase()->getRow($rs)) { |
|
21 | +while ($row = $modx->getDatabase()->getRow($rs)) { |
|
22 | 22 | $settings[$row['setting_name']] = $row['setting_value']; |
23 | 23 | } |
24 | -$settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']); |
|
25 | -$settings['rb_base_dir'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['rb_base_dir']); |
|
24 | +$settings['filemanager_path'] = preg_replace('@^'.preg_quote(MODX_BASE_PATH).'@', '[(base_path)]', $settings['filemanager_path']); |
|
25 | +$settings['rb_base_dir'] = preg_replace('@^'.preg_quote(MODX_BASE_PATH).'@', '[(base_path)]', $settings['rb_base_dir']); |
|
26 | 26 | |
27 | 27 | extract($settings, EXTR_OVERWRITE); |
28 | 28 | |
29 | 29 | // load languages and keys |
30 | 30 | $lang_keys = array(); |
31 | 31 | $dir = dir('includes/lang'); |
32 | -while($file = $dir->read()) { |
|
33 | - if(strpos($file, '.inc.php') > 0) { |
|
32 | +while ($file = $dir->read()) { |
|
33 | + if (strpos($file, '.inc.php') > 0) { |
|
34 | 34 | $endpos = strpos($file, '.'); |
35 | 35 | $languagename = substr($file, 0, $endpos); |
36 | 36 | $lang_keys[$languagename] = get_lang_keys($file); |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | <input type="hidden" name="site_id" value="<?php echo $site_id; ?>" /> |
68 | 68 | <input type="hidden" name="settings_version" value="<?php echo $modx->getVersionData('version'); ?>" /> |
69 | 69 | <!-- this field is used to check site settings have been entered/ updated after install or upgrade --> |
70 | - <?php if(!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { ?> |
|
70 | + <?php if (!isset($settings_version) || $settings_version != $modx->getVersionData('version')) { ?> |
|
71 | 71 | <div class='sectionBody'><p class='element-edit-message-tab alert alert-warning'><?php echo $_lang['settings_after_install']; ?></p></div> |
72 | 72 | <?php } ?> |
73 | 73 | <div class="tab-pane" id="settingsPane"> |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | </script> |
77 | 77 | |
78 | 78 | <?php |
79 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
80 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
81 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
82 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
83 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
84 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
85 | - include_once(MODX_MANAGER_PATH . 'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
79 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab1_site_settings.inc.php'); |
|
80 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab2_furl_settings.inc.php'); |
|
81 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab3_user_settings.inc.php'); |
|
82 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab4_manager_settings.inc.php'); |
|
83 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab5_security_settings.inc.php'); |
|
84 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab6_filemanager_settings.inc.php'); |
|
85 | + include_once(MODX_MANAGER_PATH.'actions/mutate_settings/tab7_filebrowser_settings.inc.php'); |
|
86 | 86 | ?> |
87 | 87 | </div> |
88 | 88 | </div> |
@@ -129,6 +129,6 @@ discard block |
||
129 | 129 | }); |
130 | 130 | </script> |
131 | 131 | <?php |
132 | -if(is_numeric($_GET['tab'])) { |
|
133 | - echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
|
132 | +if (is_numeric($_GET['tab'])) { |
|
133 | + echo '<script type="text/javascript">tpSettings.setSelectedIndex( '.$_GET['tab'].' );</script>'; |
|
134 | 134 | } |
@@ -1,14 +1,14 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if(!$modx->hasPermission('settings')) { |
|
5 | +if(!$modx->hasPermission('settings')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang['error_no_privileges']); |
7 | 7 | } |
8 | 8 | |
9 | 9 | // check to see the edit settings page isn't locked |
10 | 10 | $rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=17 AND internalKey!='" . $modx->getLoginUserID() . "'"); |
11 | -if($username = $modx->getDatabase()->getValue($rs)) { |
|
11 | +if($username = $modx->getDatabase()->getValue($rs)) { |
|
12 | 12 | $modx->webAlertAndQuit(sprintf($_lang['lock_settings_msg'], $username)); |
13 | 13 | } |
14 | 14 | // end check for lock |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $settings = array(); |
19 | 19 | include_once(MODX_MANAGER_PATH . 'includes/default_config.php'); |
20 | 20 | $rs = $modx->getDatabase()->select('setting_name, setting_value', $modx->getDatabase()->getFullTableName('system_settings')); |
21 | -while($row = $modx->getDatabase()->getRow($rs)) { |
|
21 | +while($row = $modx->getDatabase()->getRow($rs)) { |
|
22 | 22 | $settings[$row['setting_name']] = $row['setting_value']; |
23 | 23 | } |
24 | 24 | $settings['filemanager_path'] = preg_replace('@^' . preg_quote(MODX_BASE_PATH) . '@', '[(base_path)]', $settings['filemanager_path']); |
@@ -29,8 +29,8 @@ discard block |
||
29 | 29 | // load languages and keys |
30 | 30 | $lang_keys = array(); |
31 | 31 | $dir = dir('includes/lang'); |
32 | -while($file = $dir->read()) { |
|
33 | - if(strpos($file, '.inc.php') > 0) { |
|
32 | +while($file = $dir->read()) { |
|
33 | + if(strpos($file, '.inc.php') > 0) { |
|
34 | 34 | $endpos = strpos($file, '.'); |
35 | 35 | $languagename = substr($file, 0, $endpos); |
36 | 36 | $lang_keys[$languagename] = get_lang_keys($file); |
@@ -129,6 +129,6 @@ discard block |
||
129 | 129 | }); |
130 | 130 | </script> |
131 | 131 | <?php |
132 | -if(is_numeric($_GET['tab'])) { |
|
132 | +if(is_numeric($_GET['tab'])) { |
|
133 | 133 | echo '<script type="text/javascript">tpSettings.setSelectedIndex( ' . $_GET['tab'] . ' );</script>'; |
134 | 134 | } |