@@ -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('edit_document') || !$modx->hasPermission('save_document')) { |
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | |
9 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : null; |
|
9 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : null; |
|
10 | 10 | $reset = isset($_POST['reset']) && $_POST['reset'] == 'true' ? 1 : 0; |
11 | 11 | $items = isset($_POST['list']) ? $_POST['list'] : ''; |
12 | 12 | $ressourcelist = ''; |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | } |
24 | 24 | |
25 | 25 | if (isset($_POST['listSubmitted'])) { |
26 | - $updateMsg .= '<div class="text-success" id="updated">' . $_lang['sort_updated'] . '</div>'; |
|
26 | + $updateMsg .= '<div class="text-success" id="updated">'.$_lang['sort_updated'].'</div>'; |
|
27 | 27 | if (strlen($items) > 0) { |
28 | 28 | $items = explode(';', $items); |
29 | 29 | foreach ($items as $key => $value) { |
@@ -43,15 +43,15 @@ discard block |
||
43 | 43 | $tblsc = $modx->getDatabase()->getFullTableName('site_content'); |
44 | 44 | $tbldg = $modx->getDatabase()->getFullTableName('document_groups'); |
45 | 45 | |
46 | - $rs = $modx->getDatabase()->select('pagetitle', $tblsc, 'id=' . $id . ''); |
|
46 | + $rs = $modx->getDatabase()->select('pagetitle', $tblsc, 'id='.$id.''); |
|
47 | 47 | $pagetitle = $modx->getDatabase()->getValue($rs); |
48 | 48 | |
49 | 49 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
50 | 50 | $docgrp_cond = $docgrp ? "OR dg.document_group IN ({$docgrp})" : ''; |
51 | - $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
52 | - $access = " AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
51 | + $mgrRole = (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
52 | + $access = " AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
53 | 53 | |
54 | - $rs = $modx->getDatabase()->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc . 'AS sc LEFT JOIN ' . $tbldg . ' dg ON dg.document=sc.id', 'sc.parent=' . $id . $access . ' GROUP BY sc.id', 'menuindex ASC'); |
|
54 | + $rs = $modx->getDatabase()->select('sc.id, sc.pagetitle, sc.parent, sc.menuindex, sc.published, sc.hidemenu, sc.deleted, sc.isfolder', $tblsc.'AS sc LEFT JOIN '.$tbldg.' dg ON dg.document=sc.id', 'sc.parent='.$id.$access.' GROUP BY sc.id', 'menuindex ASC'); |
|
55 | 55 | |
56 | 56 | if ($modx->getDatabase()->getRecordCount($rs)) { |
57 | 57 | $ressourcelist .= '<div class="clearfix"><ul id="sortlist" class="sortableList">'; |
@@ -60,12 +60,12 @@ discard block |
||
60 | 60 | $classes .= ($row['hidemenu']) ? ' notInMenuNode ' : ' inMenuNode'; |
61 | 61 | $classes .= ($row['published']) ? ' publishedNode ' : ' unpublishedNode '; |
62 | 62 | $classes = ($row['deleted']) ? ' deletedNode ' : $classes; |
63 | - $icon = $row['isfolder'] ? '<i class="' . $_style['files_folder'] . '"></i> ' : ' <i class="' . $_style['files_page_html'] . '"></i> '; |
|
64 | - $ressourcelist .= '<li id="item_' . $row['id'] . '" class="' . $classes . '">' . $icon . $row['pagetitle'] . ' <small>(' . $row['id'] . ')</small></li>'; |
|
63 | + $icon = $row['isfolder'] ? '<i class="'.$_style['files_folder'].'"></i> ' : ' <i class="'.$_style['files_page_html'].'"></i> '; |
|
64 | + $ressourcelist .= '<li id="item_'.$row['id'].'" class="'.$classes.'">'.$icon.$row['pagetitle'].' <small>('.$row['id'].')</small></li>'; |
|
65 | 65 | } |
66 | 66 | $ressourcelist .= '</ul></div>'; |
67 | 67 | } else { |
68 | - $updateMsg = '<p class="text-danger">' . $_lang['sort_nochildren'] . '</p>'; |
|
68 | + $updateMsg = '<p class="text-danger">'.$_lang['sort_nochildren'].'</p>'; |
|
69 | 69 | } |
70 | 70 | } |
71 | 71 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | </script> |
149 | 149 | |
150 | 150 | <h1> |
151 | - <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $modx->getPhpCompat()->entities($pagetitle) . '<small>(' . $id . ')</small>' : $_lang['sort_menuindex']) ?> |
|
151 | + <i class="fa fa-sort-numeric-asc"></i><?= ($pagetitle ? $modx->getPhpCompat()->entities($pagetitle).'<small>('.$id.')</small>' : $_lang['sort_menuindex']) ?> |
|
152 | 152 | </h1> |
153 | 153 | |
154 | 154 | <?= $_style['actionbuttons']['dynamic']['save'] ?> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | $tbl_site_plugins = $modx->getDatabase()->getFullTableName('site_plugins'); |
24 | 24 | $tbl_site_plugin_events = $modx->getDatabase()->getFullTableName('site_plugin_events'); |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | $content['properties'] = str_replace("&", "&", $content['properties']); |
47 | 47 | } else { |
48 | 48 | $_SESSION['itemname'] = $_lang["new_plugin"]; |
49 | - $content['category'] = (int)$_REQUEST['catid']; |
|
49 | + $content['category'] = (int) $_REQUEST['catid']; |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | if ($modx->getManagerApi()->hasFormValues()) { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | // Add lock-element JS-Script |
57 | 57 | $lockElementId = $id; |
58 | 58 | $lockElementType = 5; |
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 | |
62 | 62 | |
@@ -473,7 +473,7 @@ discard block |
||
473 | 473 | <input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>"> |
474 | 474 | |
475 | 475 | <h1> |
476 | - <i class="fa fa-plug"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_plugin']) ?><i class="fa fa-question-circle help"></i> |
|
476 | + <i class="fa fa-plug"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_plugin']) ?><i class="fa fa-question-circle help"></i> |
|
477 | 477 | </h1> |
478 | 478 | |
479 | 479 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | <div class="form-control-name clearfix"> |
500 | 500 | <input name="name" type="text" maxlength="100" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
501 | 501 | <?php if ($modx->hasPermission('save_role')): ?> |
502 | - <label class="custom-control" title="<?= $_lang['lock_plugin'] . "\n" . $_lang['lock_plugin_msg'] ?>" tooltip> |
|
502 | + <label class="custom-control" title="<?= $_lang['lock_plugin']."\n".$_lang['lock_plugin_msg'] ?>" tooltip> |
|
503 | 503 | <input name="locked" type="checkbox" value="on"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
504 | 504 | <i class="fa fa-lock"></i> |
505 | 505 | </label> |
@@ -523,9 +523,9 @@ discard block |
||
523 | 523 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
524 | 524 | <option> </option> |
525 | 525 | <?php |
526 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
526 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
527 | 527 | foreach (getCategories() as $n => $v) { |
528 | - echo '<option value="' . $v['id'] . '"' . ($content["category"] == $v["id"] ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>"; |
|
528 | + echo '<option value="'.$v['id'].'"'.($content["category"] == $v["id"] ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($v["category"])."</option>"; |
|
529 | 529 | } |
530 | 530 | ?> |
531 | 531 | </select> |
@@ -541,7 +541,7 @@ discard block |
||
541 | 541 | <?php if ($modx->hasPermission('save_role')): ?> |
542 | 542 | <div class="form-group"> |
543 | 543 | <div class="form-row"> |
544 | - <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>" . $_lang['plugin_disabled'] . "</span>" : $_lang['plugin_disabled']) ?></label> |
|
544 | + <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>".$_lang['plugin_disabled']."</span>" : $_lang['plugin_disabled']) ?></label> |
|
545 | 545 | </div> |
546 | 546 | <div class="form-row"> |
547 | 547 | <label> |
@@ -588,11 +588,11 @@ discard block |
||
588 | 588 | <select name="moduleguid" class="form-control" onchange="documentDirty=true;"> |
589 | 589 | <option> </option> |
590 | 590 | <?php |
591 | - $ds = $modx->getDatabase()->select('sm.id,sm.name,sm.guid', $modx->getDatabase()->getFullTableName("site_modules") . " sm |
|
592 | - INNER JOIN " . $modx->getDatabase()->getFullTableName("site_module_depobj") . " smd ON smd.module=sm.id AND smd.type=30 |
|
593 | - INNER JOIN " . $modx->getDatabase()->getFullTableName("site_plugins") . " sp ON sp.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams='1'", 'sm.name'); |
|
591 | + $ds = $modx->getDatabase()->select('sm.id,sm.name,sm.guid', $modx->getDatabase()->getFullTableName("site_modules")." sm |
|
592 | + INNER JOIN " . $modx->getDatabase()->getFullTableName("site_module_depobj")." smd ON smd.module=sm.id AND smd.type=30 |
|
593 | + INNER JOIN " . $modx->getDatabase()->getFullTableName("site_plugins")." sp ON sp.id=smd.resource", "smd.resource='{$id}' AND sm.enable_sharedparams='1'", 'sm.name'); |
|
594 | 594 | while ($row = $modx->getDatabase()->getRow($ds)) { |
595 | - echo "<option value='" . $row['guid'] . "'" . ($content["moduleguid"] == $row["guid"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($row["name"]) . "</option>"; |
|
595 | + echo "<option value='".$row['guid']."'".($content["moduleguid"] == $row["guid"] ? " selected='selected'" : "").">".$modx->getPhpCompat()->htmlspecialchars($row["name"])."</option>"; |
|
596 | 596 | } |
597 | 597 | ?> |
598 | 598 | </select> |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | echoEventRows($evtnames); |
655 | 655 | } |
656 | 656 | echo '<hr class="clear">'; |
657 | - echo '<div class="form-group"><b>' . $services[$srv - 1] . '</b></div>'; |
|
657 | + echo '<div class="form-group"><b>'.$services[$srv - 1].'</b></div>'; |
|
658 | 658 | } |
659 | 659 | // display group name |
660 | 660 | if ($grp != $row['groupname']) { |
@@ -663,9 +663,9 @@ discard block |
||
663 | 663 | echoEventRows($evtnames); |
664 | 664 | } |
665 | 665 | echo '<hr class="clear">'; |
666 | - echo '<div class="form-group"><b>' . $row['groupname'] . '</b></div>'; |
|
666 | + echo '<div class="form-group"><b>'.$row['groupname'].'</b></div>'; |
|
667 | 667 | } |
668 | - $evtnames[] = '<input name="sysevents[]" id="' . $row['name'] . '" type="checkbox" ' . (in_array($row['id'], $evts) ? ' checked="checked" ' : '') . 'class="inputBox" value="' . $row['id'] . '" /> <label for="' . $row['name'] . '" ' . bold(in_array($row['id'], $evts)) . '> ' . $row['name'] . '</label>' . "\n"; |
|
668 | + $evtnames[] = '<input name="sysevents[]" id="'.$row['name'].'" type="checkbox" '.(in_array($row['id'], $evts) ? ' checked="checked" ' : '').'class="inputBox" value="'.$row['id'].'" /> <label for="'.$row['name'].'" '.bold(in_array($row['id'], $evts)).'> '.$row['name'].'</label>'."\n"; |
|
669 | 669 | if (count($evtnames) == 2) { |
670 | 670 | echoEventRows($evtnames); |
671 | 671 | } |
@@ -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 16: |
8 | - if(!$modx->hasPermission('edit_template')) { |
|
8 | + if (!$modx->hasPermission('edit_template')) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | break; |
12 | 12 | case 19: |
13 | - if(!$modx->hasPermission('new_template')) { |
|
13 | + if (!$modx->hasPermission('new_template')) { |
|
14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | 15 | } |
16 | 16 | break; |
@@ -18,12 +18,12 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | $tbl_site_templates = $modx->getDatabase()->getFullTableName('site_templates'); |
24 | 24 | |
25 | 25 | // check to see the snippet editor isn't locked |
26 | -if($lockedEl = $modx->elementIsLocked(1, $id)) { |
|
26 | +if ($lockedEl = $modx->elementIsLocked(1, $id)) { |
|
27 | 27 | $modx->webAlertAndQuit(sprintf($_lang['lock_msg'], $lockedEl['username'], $_lang['template'])); |
28 | 28 | } |
29 | 29 | // end check for lock |
@@ -32,23 +32,23 @@ discard block |
||
32 | 32 | $modx->lockElement(1, $id); |
33 | 33 | |
34 | 34 | $content = array(); |
35 | -if(!empty($id)) { |
|
35 | +if (!empty($id)) { |
|
36 | 36 | $rs = $modx->getDatabase()->select('*', $tbl_site_templates, "id='{$id}'"); |
37 | 37 | $content = $modx->getDatabase()->getRow($rs); |
38 | - if(!$content) { |
|
38 | + if (!$content) { |
|
39 | 39 | $modx->webAlertAndQuit("No database record has been found for this template."); |
40 | 40 | } |
41 | 41 | |
42 | 42 | $_SESSION['itemname'] = $content['templatename']; |
43 | - if($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
43 | + if ($content['locked'] == 1 && $_SESSION['mgrRole'] != 1) { |
|
44 | 44 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
45 | 45 | } |
46 | 46 | } else { |
47 | 47 | $_SESSION['itemname'] = $_lang["new_template"]; |
48 | - $content['category'] = (int)$_REQUEST['catid']; |
|
48 | + $content['category'] = (int) $_REQUEST['catid']; |
|
49 | 49 | } |
50 | 50 | |
51 | -if($modx->getManagerApi()->hasFormValues()) { |
|
51 | +if ($modx->getManagerApi()->hasFormValues()) { |
|
52 | 52 | $modx->getManagerApi()->loadFormValues(); |
53 | 53 | } |
54 | 54 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | // Add lock-element JS-Script |
59 | 59 | $lockElementId = $id; |
60 | 60 | $lockElementType = 1; |
61 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
61 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
62 | 62 | ?> |
63 | 63 | <script type="text/javascript"> |
64 | 64 | |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | <?php |
101 | 101 | // invoke OnTempFormPrerender event |
102 | 102 | $evtOut = $modx->invokeEvent("OnTempFormPrerender", array("id" => $id)); |
103 | - if(is_array($evtOut)) { |
|
103 | + if (is_array($evtOut)) { |
|
104 | 104 | echo implode("", $evtOut); |
105 | 105 | } |
106 | 106 | ?> |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | <input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>"> |
110 | 110 | |
111 | 111 | <h1> |
112 | - <i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i> |
|
112 | + <i class="fa fa-newspaper-o"></i><?= ($content['templatename'] ? $content['templatename'].'<small>('.$content['id'].')</small>' : $_lang['new_template']) ?><i class="fa fa-question-circle help"></i> |
|
113 | 113 | </h1> |
114 | 114 | |
115 | 115 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -132,15 +132,15 @@ discard block |
||
132 | 132 | <div class="row form-row"> |
133 | 133 | <label class="col-md-3 col-lg-2"> |
134 | 134 | <?= $_lang['template_name'] ?> |
135 | - <?php if($id == $modx->config['default_template']) { |
|
136 | - echo '<small class="form-text text-danger">' . mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset) . '</small>'; |
|
135 | + <?php if ($id == $modx->config['default_template']) { |
|
136 | + echo '<small class="form-text text-danger">'.mb_strtolower(rtrim($_lang['defaulttemplate_title'], ':'), $modx_manager_charset).'</small>'; |
|
137 | 137 | } ?> |
138 | 138 | </label> |
139 | 139 | <div class="col-md-9 col-lg-10"> |
140 | 140 | <div class="form-control-name clearfix"> |
141 | 141 | <input name="templatename" type="text" maxlength="100" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['templatename']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;"> |
142 | - <?php if($modx->hasPermission('save_role')): ?> |
|
143 | - <label class="custom-control" title="<?= $_lang['lock_template'] . "\n" . $_lang['lock_template_msg'] ?>" tooltip> |
|
142 | + <?php if ($modx->hasPermission('save_role')): ?> |
|
143 | + <label class="custom-control" title="<?= $_lang['lock_template']."\n".$_lang['lock_template_msg'] ?>" tooltip> |
|
144 | 144 | <input name="locked" type="checkbox"<?= ($content['locked'] == 1 ? ' checked="checked"' : '') ?> /> |
145 | 145 | <i class="fa fa-lock"></i> |
146 | 146 | </label> |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
163 | 163 | <option> </option> |
164 | 164 | <?php |
165 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
166 | - foreach(getCategories() as $n => $v) { |
|
167 | - echo "<option value='" . $v['id'] . "'" . ($content["category"] == $v["id"] ? " selected='selected'" : "") . ">" . $modx->getPhpCompat()->htmlspecialchars($v["category"]) . "</option>"; |
|
165 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
166 | + foreach (getCategories() as $n => $v) { |
|
167 | + echo "<option value='".$v['id']."'".($content["category"] == $v["id"] ? " selected='selected'" : "").">".$modx->getPhpCompat()->htmlspecialchars($v["category"])."</option>"; |
|
168 | 168 | } |
169 | 169 | ?> |
170 | 170 | </select> |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | </div> |
178 | 178 | </div> |
179 | 179 | </div> |
180 | - <?php if($modx->hasPermission('save_role')): ?> |
|
180 | + <?php if ($modx->hasPermission('save_role')): ?> |
|
181 | 181 | <div class="form-group"> |
182 | 182 | <label> |
183 | 183 | <input name="selectable" type="checkbox"<?= ($selectable == 1 ? ' checked="checked"' : '') ?> /> <?= $_lang['template_selectable'] ?></label> |
@@ -198,30 +198,30 @@ discard block |
||
198 | 198 | |
199 | 199 | <?php |
200 | 200 | $selectedTvs = array(); |
201 | - if(!isset($_POST['assignedTv'])) { |
|
201 | + if (!isset($_POST['assignedTv'])) { |
|
202 | 202 | $rs = $modx->getDatabase()->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category", $_lang['no_category']), sprintf("%s tv |
203 | 203 | LEFT JOIN %s tr ON tv.id=tr.tmplvarid |
204 | 204 | LEFT JOIN %s cat ON tv.category=cat.id", $modx->getDatabase()->getFullTableName('site_tmplvars'), $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), $modx->getDatabase()->getFullTableName('categories')), "templateid='{$id}'", "tr.rank DESC, tv.rank DESC, tvcaption DESC, tvid DESC" // workaround for correct sort of none-existing ranks |
205 | 205 | ); |
206 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
206 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
207 | 207 | $selectedTvs[$row['tvid']] = $row; |
208 | 208 | } |
209 | - $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC |
|
209 | + $selectedTvs = array_reverse($selectedTvs, true); // reverse ORDERBY DESC |
|
210 | 210 | } |
211 | 211 | |
212 | 212 | $unselectedTvs = array(); |
213 | 213 | $rs = $modx->getDatabase()->select(sprintf("tv.name AS tvname, tv.id AS tvid, tr.templateid AS templateid, tv.description AS tvdescription, tv.caption AS tvcaption, tv.locked AS tvlocked, if(isnull(cat.category),'%s',cat.category) AS category, cat.id as catid", $_lang['no_category']), sprintf("%s tv |
214 | 214 | LEFT JOIN %s tr ON tv.id=tr.tmplvarid |
215 | 215 | LEFT JOIN %s cat ON tv.category=cat.id", $modx->getDatabase()->getFullTableName('site_tmplvars'), $modx->getDatabase()->getFullTableName('site_tmplvar_templates'), $modx->getDatabase()->getFullTableName('categories')), "", "category, tvcaption"); |
216 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
216 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
217 | 217 | $unselectedTvs[$row['tvid']] = $row; |
218 | 218 | } |
219 | 219 | |
220 | 220 | // Catch checkboxes if form not validated |
221 | - if(isset($_POST['assignedTv'])) { |
|
221 | + if (isset($_POST['assignedTv'])) { |
|
222 | 222 | $selectedTvs = array(); |
223 | - foreach($_POST['assignedTv'] as $tvid) { |
|
224 | - if(isset($unselectedTvs[$tvid])) { |
|
223 | + foreach ($_POST['assignedTv'] as $tvid) { |
|
224 | + if (isset($unselectedTvs[$tvid])) { |
|
225 | 225 | $selectedTvs[$tvid] = $unselectedTvs[$tvid]; |
226 | 226 | } |
227 | 227 | }; |
@@ -238,20 +238,20 @@ discard block |
||
238 | 238 | |
239 | 239 | <div class="container container-body"> |
240 | 240 | <?php |
241 | - if($total > 0) { |
|
242 | - echo '<p>' . $_lang['template_tv_msg'] . '</p>'; |
|
241 | + if ($total > 0) { |
|
242 | + echo '<p>'.$_lang['template_tv_msg'].'</p>'; |
|
243 | 243 | } |
244 | - if($modx->hasPermission('save_template') && $total > 1 && $id) { |
|
244 | + if ($modx->hasPermission('save_template') && $total > 1 && $id) { |
|
245 | 245 | echo sprintf('<div class="form-group"><a class="btn btn-primary" href="index.php?a=117&id=%s">%s</a></div>', $id, $_lang['template_tv_edit']); |
246 | 246 | } |
247 | 247 | |
248 | 248 | // Selected TVs |
249 | 249 | $tvList = ''; |
250 | - if($total > 0) { |
|
250 | + if ($total > 0) { |
|
251 | 251 | $tvList .= '<ul>'; |
252 | - foreach($selectedTvs as $row) { |
|
253 | - $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
254 | - $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
252 | + foreach ($selectedTvs as $row) { |
|
253 | + $desc = !empty($row['tvdescription']) ? ' <small>('.$row['tvdescription'].')</small>' : ''; |
|
254 | + $locked = $row['tvlocked'] ? ' <em>('.$_lang['locked'].')</em>' : ""; |
|
255 | 255 | $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" checked="checked" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->getManagerApi()->action, $id, $_lang['edit']); |
256 | 256 | } |
257 | 257 | $tvList .= '</ul>'; |
@@ -262,22 +262,22 @@ discard block |
||
262 | 262 | echo $tvList; |
263 | 263 | |
264 | 264 | // Unselected TVs |
265 | - $tvList = '<hr/><p>' . $_lang['template_notassigned_tv'] . '</p><ul>'; |
|
265 | + $tvList = '<hr/><p>'.$_lang['template_notassigned_tv'].'</p><ul>'; |
|
266 | 266 | $preCat = ''; |
267 | 267 | $insideUl = 0; |
268 | - while($row = array_shift($unselectedTvs)) { |
|
269 | - if(isset($selectedTvs[$row['tvid']])) { |
|
268 | + while ($row = array_shift($unselectedTvs)) { |
|
269 | + if (isset($selectedTvs[$row['tvid']])) { |
|
270 | 270 | continue; |
271 | 271 | } // Skip selected |
272 | 272 | $row['category'] = stripslashes($row['category']); //pixelchutes |
273 | - if($preCat !== $row['category']) { |
|
273 | + if ($preCat !== $row['category']) { |
|
274 | 274 | $tvList .= $insideUl ? '</ul>' : ''; |
275 | - $tvList .= '<li><strong>' . $row['category'] . ($row['catid'] != '' ? ' <small>(' . $row['catid'] . ')</small>' : '') . '</strong><ul>'; |
|
275 | + $tvList .= '<li><strong>'.$row['category'].($row['catid'] != '' ? ' <small>('.$row['catid'].')</small>' : '').'</strong><ul>'; |
|
276 | 276 | $insideUl = 1; |
277 | 277 | } |
278 | 278 | |
279 | - $desc = !empty($row['tvdescription']) ? ' <small>(' . $row['tvdescription'] . ')</small>' : ''; |
|
280 | - $locked = $row['tvlocked'] ? ' <em>(' . $_lang['locked'] . ')</em>' : ""; |
|
279 | + $desc = !empty($row['tvdescription']) ? ' <small>('.$row['tvdescription'].')</small>' : ''; |
|
280 | + $locked = $row['tvlocked'] ? ' <em>('.$_lang['locked'].')</em>' : ""; |
|
281 | 281 | $tvList .= sprintf('<li><label><input name="assignedTv[]" value="%s" type="checkbox" onchange="documentDirty=true;jQuery(\'#tvsDirty\').val(\'1\');"> %s <small>(%s)</small> - %s%s</label>%s <a href="index.php?id=%s&a=301&or=%s&oid=%s">%s</a></li>', $row['tvid'], $row['tvname'], $row['tvid'], $row['tvcaption'], $desc, $locked, $row['tvid'], $modx->getManagerApi()->action, $id, $_lang['edit']); |
282 | 282 | $tvList .= '</li>'; |
283 | 283 | |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | <?php |
295 | 295 | // invoke OnTempFormRender event |
296 | 296 | $evtOut = $modx->invokeEvent("OnTempFormRender", array("id" => $id)); |
297 | - if(is_array($evtOut)) { |
|
297 | + if (is_array($evtOut)) { |
|
298 | 298 | echo implode("", $evtOut); |
299 | 299 | } |
300 | 300 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | // Get table names (alphabetical) |
24 | 24 | $tbl_site_htmlsnippets = $modx->getDatabase()->getFullTableName('site_htmlsnippets'); |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | $content['name'] = $_REQUEST['itemname']; |
48 | 48 | } else { |
49 | 49 | $_SESSION['itemname'] = $_lang["new_htmlsnippet"]; |
50 | - $content['category'] = (int)$_REQUEST['catid']; |
|
50 | + $content['category'] = (int) $_REQUEST['catid']; |
|
51 | 51 | } |
52 | 52 | |
53 | 53 | if ($modx->getManagerApi()->hasFormValues()) { |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | // Add lock-element JS-Script |
66 | 66 | $lockElementId = $id; |
67 | 67 | $lockElementType = 3; |
68 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
68 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
69 | 69 | |
70 | 70 | // Print RTE Javascript function |
71 | 71 | ?> |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | <input type="hidden" name="mode" value="<?= $modx->getManagerApi()->action ?>" /> |
137 | 137 | |
138 | 138 | <h1> |
139 | - <i class="fa fa-th-large"></i><?= ($content['name'] ? $content['name'] . '<small>(' . $content['id'] . ')</small>' : $_lang['new_htmlsnippet']) ?><i class="fa fa-question-circle help"></i> |
|
139 | + <i class="fa fa-th-large"></i><?= ($content['name'] ? $content['name'].'<small>('.$content['id'].')</small>' : $_lang['new_htmlsnippet']) ?><i class="fa fa-question-circle help"></i> |
|
140 | 140 | </h1> |
141 | 141 | |
142 | 142 | <?= $_style['actionbuttons']['dynamic']['element'] ?> |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | <div class="form-control-name clearfix"> |
161 | 161 | <input name="name" type="text" maxlength="100" value="<?= $modx->getPhpCompat()->htmlspecialchars($content['name']) ?>" class="form-control form-control-lg" onchange="documentDirty=true;" /> |
162 | 162 | <?php if ($modx->hasPermission('save_role')): ?> |
163 | - <label class="custom-control" title="<?= $_lang['lock_htmlsnippet'] . "\n" . $_lang['lock_htmlsnippet_msg'] ?>" tooltip> |
|
163 | + <label class="custom-control" title="<?= $_lang['lock_htmlsnippet']."\n".$_lang['lock_htmlsnippet_msg'] ?>" tooltip> |
|
164 | 164 | <input name="locked" type="checkbox" value="on"<?= ($content['locked'] == 1 || $content['locked'] == 'on' ? ' checked="checked"' : '') ?> /> |
165 | 165 | <i class="fa fa-lock"></i> |
166 | 166 | </label> |
@@ -184,9 +184,9 @@ discard block |
||
184 | 184 | <select name="categoryid" class="form-control" onchange="documentDirty=true;"> |
185 | 185 | <option> </option> |
186 | 186 | <?php |
187 | - include_once(MODX_MANAGER_PATH . 'includes/categories.inc.php'); |
|
187 | + include_once(MODX_MANAGER_PATH.'includes/categories.inc.php'); |
|
188 | 188 | foreach (getCategories() as $n => $v) { |
189 | - echo "\t\t\t\t" . '<option value="' . $v['id'] . '"' . ($content['category'] == $v['id'] || (empty($content['category']) && $_POST['categoryid'] == $v['id']) ? ' selected="selected"' : '') . '>' . $modx->getPhpCompat()->htmlspecialchars($v['category']) . "</option>\n"; |
|
189 | + echo "\t\t\t\t".'<option value="'.$v['id'].'"'.($content['category'] == $v['id'] || (empty($content['category']) && $_POST['categoryid'] == $v['id']) ? ' selected="selected"' : '').'>'.$modx->getPhpCompat()->htmlspecialchars($v['category'])."</option>\n"; |
|
190 | 190 | } |
191 | 191 | ?> |
192 | 192 | </select> |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | </div> |
201 | 201 | <?php if ($_SESSION['mgrRole'] == 1): ?> |
202 | 202 | <div class="form-row"> |
203 | - <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>" . $_lang['disabled'] . "</span>" : $_lang['disabled']) ?></label> |
|
203 | + <label><input name="disabled" type="checkbox" value="on"<?= ($content['disabled'] == 1 ? ' checked="checked"' : '') ?> /> <?= ($content['disabled'] == 1 ? "<span class='text-danger'>".$_lang['disabled']."</span>" : $_lang['disabled']) ?></label> |
|
204 | 204 | </div> |
205 | 205 | <?php endif; ?> |
206 | 206 | </div> |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | $evtOut = $modx->invokeEvent('OnRichTextEditorRegister'); |
217 | 217 | if (is_array($evtOut)) { |
218 | 218 | foreach ($evtOut as $i => $editor) { |
219 | - echo "\t" . '<option value="' . $editor . '"' . ($which_editor == $editor ? ' selected="selected"' : '') . '>' . $editor . "</option>\n"; |
|
219 | + echo "\t".'<option value="'.$editor.'"'.($which_editor == $editor ? ' selected="selected"' : '').'>'.$editor."</option>\n"; |
|
220 | 220 | } |
221 | 221 | } |
222 | 222 | ?> |
@@ -1,16 +1,16 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | -switch($modx->getManagerApi()->action) { |
|
6 | +switch ($modx->getManagerApi()->action) { |
|
7 | 7 | case 12: |
8 | - if(!$modx->hasPermission('edit_user')) { |
|
8 | + if (!$modx->hasPermission('edit_user')) { |
|
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
10 | 10 | } |
11 | 11 | break; |
12 | 12 | case 11: |
13 | - if(!$modx->hasPermission('new_user')) { |
|
13 | + if (!$modx->hasPermission('new_user')) { |
|
14 | 14 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
15 | 15 | } |
16 | 16 | break; |
@@ -18,24 +18,24 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$user = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$user = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | // check to see the snippet editor isn't locked |
24 | -$rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='" . $modx->getLoginUserID() . "'"); |
|
25 | -if($username = $modx->getDatabase()->getValue($rs)) { |
|
24 | +$rs = $modx->getDatabase()->select('username', $modx->getDatabase()->getFullTableName('active_users'), "action=12 AND id='{$user}' AND internalKey!='".$modx->getLoginUserID()."'"); |
|
25 | +if ($username = $modx->getDatabase()->getValue($rs)) { |
|
26 | 26 | $modx->webAlertAndQuit(sprintf($_lang["lock_msg"], $username, "user")); |
27 | 27 | } |
28 | 28 | // end check for lock |
29 | 29 | |
30 | -if($modx->getManagerApi()->action == '12') { |
|
30 | +if ($modx->getManagerApi()->action == '12') { |
|
31 | 31 | // get user attribute |
32 | 32 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_attributes'), "internalKey = '{$user}'"); |
33 | 33 | $userdata = $modx->getDatabase()->getRow($rs); |
34 | - if(!$userdata) { |
|
34 | + if (!$userdata) { |
|
35 | 35 | $modx->webAlertAndQuit("No user returned!"); |
36 | 36 | } |
37 | 37 | |
38 | - if($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) { |
|
38 | + if ($_SESSION['mgrRole'] != 1 && $userdata['role'] == 1) { |
|
39 | 39 | $modx->webAlertAndQuit('Illegal attempt to create/modify administrator by non-administrator!'); |
40 | 40 | } |
41 | 41 | |
@@ -43,10 +43,10 @@ discard block |
||
43 | 43 | // get user settings |
44 | 44 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_settings'), "user = '{$user}'"); |
45 | 45 | $usersettings = array(); |
46 | - while($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
46 | + while ($row = $modx->getDatabase()->getRow($rs)) $usersettings[$row['setting_name']] = $row['setting_value']; |
|
47 | 47 | // manually extract so that user display settings are not overwritten |
48 | - foreach($usersettings as $k => $v) { |
|
49 | - if($k != 'manager_language' && $k != 'manager_theme') { |
|
48 | + foreach ($usersettings as $k => $v) { |
|
49 | + if ($k != 'manager_language' && $k != 'manager_theme') { |
|
50 | 50 | ${$k} = $v; |
51 | 51 | } |
52 | 52 | } |
@@ -54,7 +54,7 @@ discard block |
||
54 | 54 | // get user name |
55 | 55 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('manager_users'), "id = '{$user}'"); |
56 | 56 | $usernamedata = $modx->getDatabase()->getRow($rs); |
57 | - if(!$usernamedata) { |
|
57 | + if (!$usernamedata) { |
|
58 | 58 | $modx->webAlertAndQuit("No user returned while getting username!"); |
59 | 59 | } |
60 | 60 | $_SESSION['itemname'] = $usernamedata['username']; |
@@ -66,14 +66,14 @@ discard block |
||
66 | 66 | } |
67 | 67 | |
68 | 68 | // avoid doubling htmlspecialchars (already encoded in DB) |
69 | -foreach($userdata as $key => $val) { |
|
69 | +foreach ($userdata as $key => $val) { |
|
70 | 70 | $userdata[$key] = html_entity_decode($val, ENT_NOQUOTES, $modx->config['modx_charset']); |
71 | 71 | }; |
72 | 72 | $usernamedata['username'] = html_entity_decode($usernamedata['username'], ENT_NOQUOTES, $modx->config['modx_charset']); |
73 | 73 | |
74 | 74 | // restore saved form |
75 | 75 | $formRestored = false; |
76 | -if($modx->getManagerApi()->hasFormValues()) { |
|
76 | +if ($modx->getManagerApi()->hasFormValues()) { |
|
77 | 77 | $modx->getManagerApi()->loadFormValues(); |
78 | 78 | // restore post values |
79 | 79 | $userdata = array_merge($userdata, $_POST); |
@@ -88,13 +88,13 @@ discard block |
||
88 | 88 | // include the country list language file |
89 | 89 | $_country_lang = array(); |
90 | 90 | include_once "lang/country/english_country.inc.php"; |
91 | -if($manager_language != "english" && file_exists($modx->config['site_manager_path'] . "includes/lang/country/" . $manager_language . "_country.inc.php")) { |
|
92 | - include_once "lang/country/" . $manager_language . "_country.inc.php"; |
|
91 | +if ($manager_language != "english" && file_exists($modx->config['site_manager_path']."includes/lang/country/".$manager_language."_country.inc.php")) { |
|
92 | + include_once "lang/country/".$manager_language."_country.inc.php"; |
|
93 | 93 | } |
94 | 94 | asort($_country_lang); |
95 | 95 | |
96 | 96 | $displayStyle = ($_SESSION['browser'] === 'modern') ? 'table-row' : 'block'; |
97 | -if($which_browser == 'default') { |
|
97 | +if ($which_browser == 'default') { |
|
98 | 98 | $which_browser = $modx->configGlobal['which_browser'] ? $modx->configGlobal['which_browser'] : $modx->config['which_browser']; |
99 | 99 | } |
100 | 100 | ?> |
@@ -186,7 +186,7 @@ discard block |
||
186 | 186 | document.userform.save.click(); |
187 | 187 | }, |
188 | 188 | delete: function() { |
189 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
189 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
190 | 190 | alert("<?php echo $_lang['alert_delete_self']; ?>"); |
191 | 191 | <?php } else { ?> |
192 | 192 | if(confirm("<?php echo $_lang['confirm_delete_user']; ?>") === true) { |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | $evtOut = $modx->invokeEvent("OnUserFormPrerender", array( |
210 | 210 | "id" => $user |
211 | 211 | )); |
212 | - if(is_array($evtOut)) { |
|
212 | + if (is_array($evtOut)) { |
|
213 | 213 | echo implode("", $evtOut); |
214 | 214 | } |
215 | 215 | ?> |
@@ -218,7 +218,7 @@ discard block |
||
218 | 218 | <input type="hidden" name="blockedmode" value="<?php echo ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || ($userdata['blockedafter'] < time() && $userdata['blockedafter'] != 0) || $userdata['failedlogins'] > 3) ? "1" : "0" ?>" /> |
219 | 219 | |
220 | 220 | <h1> |
221 | - <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'] . '<small>(' . $usernamedata['id'] . ')</small>' : $_lang['user_title']) ?> |
|
221 | + <i class="fa fa fa-user"></i><?= ($usernamedata['username'] ? $usernamedata['username'].'<small>('.$usernamedata['id'].')</small>' : $_lang['user_title']) ?> |
|
222 | 222 | </h1> |
223 | 223 | |
224 | 224 | <?php echo $_style['actionbuttons']['dynamic']['user'] ?> |
@@ -236,13 +236,13 @@ discard block |
||
236 | 236 | <table border="0" cellspacing="0" cellpadding="3" class="table table--edit table--editUser"> |
237 | 237 | <tr> |
238 | 238 | <td colspan="3"><span id="blocked" class="warning"> |
239 | - <?php if($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
239 | + <?php if ($userdata['blocked'] == 1 || ($userdata['blockeduntil'] > time() && $userdata['blockeduntil'] != 0) || $userdata['failedlogins'] > 3) { ?> |
|
240 | 240 | <?php echo $_lang['user_is_blocked']; ?> |
241 | 241 | <?php } ?> |
242 | 242 | </span> |
243 | 243 | <br /></td> |
244 | 244 | </tr> |
245 | - <?php if(!empty($userdata['id'])) { ?> |
|
245 | + <?php if (!empty($userdata['id'])) { ?> |
|
246 | 246 | <tr id="showname" style="display: <?php echo ($modx->getManagerApi()->action == '12' && (!isset($usernamedata['oldusername']) || $usernamedata['oldusername'] == $usernamedata['username'])) ? $displayStyle : 'none'; ?> "> |
247 | 247 | <td colspan="3"><i class="<?php echo $_style["icons_user"] ?>"></i> <b><?php echo $modx->getPhpCompat()->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?></b> - <span class="comment"><a href="javascript:;" onClick="changeName();return false;"><?php echo $_lang["change_name"]; ?></a></span> |
248 | 248 | <input type="hidden" name="oldusername" value="<?php echo $modx->getPhpCompat()->htmlspecialchars(!empty($usernamedata['oldusername']) ? $usernamedata['oldusername'] : $usernamedata['username']); ?>" /> |
@@ -255,7 +255,7 @@ discard block |
||
255 | 255 | <td><input type="text" name="newusername" class="inputBox" value="<?php echo $modx->getPhpCompat()->htmlspecialchars($usernamedata['username']); ?>" onChange='documentDirty=true;' maxlength="100" /></td> |
256 | 256 | </tr> |
257 | 257 | <tr> |
258 | - <th><?php echo $modx->getManagerApi()->action == '11' ? $_lang['password'] . ":" : $_lang['change_password_new'] . ":"; ?></th> |
|
258 | + <th><?php echo $modx->getManagerApi()->action == '11' ? $_lang['password'].":" : $_lang['change_password_new'].":"; ?></th> |
|
259 | 259 | <td> </td> |
260 | 260 | <td><input name="newpasswordcheck" type="checkbox" onClick="changestate(document.userform.newpassword);changePasswordState(document.userform.newpassword);"<?php echo $modx->getManagerApi()->action == "11" ? " checked disabled" : ""; ?>> |
261 | 261 | <input type="hidden" name="newpassword" value="<?php echo $modx->getManagerApi()->action == "11" ? 1 : 0; ?>" onChange="documentDirty=true;" /> |
@@ -313,8 +313,8 @@ discard block |
||
313 | 313 | ?> |
314 | 314 | <select name="role" class="inputBox" onChange='documentDirty=true;' style="width:300px"> |
315 | 315 | <?php |
316 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
317 | - if($modx->getManagerApi()->action == '11') { |
|
316 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
317 | + if ($modx->getManagerApi()->action == '11') { |
|
318 | 318 | $selectedtext = $row['id'] == '1' ? ' selected="selected"' : ''; |
319 | 319 | } else { |
320 | 320 | $selectedtext = $row['id'] == $userdata['role'] ? "selected='selected'" : ''; |
@@ -368,8 +368,8 @@ discard block |
||
368 | 368 | <?php $chosenCountry = isset($_POST['country']) ? $_POST['country'] : $userdata['country']; ?> |
369 | 369 | <option value="" <?php (!isset($chosenCountry) ? ' selected' : '') ?> > </option> |
370 | 370 | <?php |
371 | - foreach($_country_lang as $key => $country) { |
|
372 | - echo "<option value=\"$key\"" . (isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '') . ">$country</option>"; |
|
371 | + foreach ($_country_lang as $key => $country) { |
|
372 | + echo "<option value=\"$key\"".(isset($chosenCountry) && $chosenCountry == $key ? ' selected' : '').">$country</option>"; |
|
373 | 373 | } |
374 | 374 | ?> |
375 | 375 | </select></td> |
@@ -395,7 +395,7 @@ discard block |
||
395 | 395 | <td> </td> |
396 | 396 | <td><textarea type="text" name="comment" class="inputBox" rows="5" onChange="documentDirty=true;"><?php echo $modx->getPhpCompat()->htmlspecialchars($userdata['comment']); ?></textarea></td> |
397 | 397 | </tr> |
398 | - <?php if($modx->getManagerApi()->action == '12') { ?> |
|
398 | + <?php if ($modx->getManagerApi()->action == '12') { ?> |
|
399 | 399 | <tr> |
400 | 400 | <th><?php echo $_lang['user_logincount']; ?>:</th> |
401 | 401 | <td> </td> |
@@ -432,7 +432,7 @@ discard block |
||
432 | 432 | </tr> |
433 | 433 | <?php } ?> |
434 | 434 | </table> |
435 | - <?php if($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
435 | + <?php if ($_GET['id'] == $modx->getLoginUserID()) { ?> |
|
436 | 436 | <p><?php echo $_lang['user_edit_self_msg']; ?></p> |
437 | 437 | <?php } ?> |
438 | 438 | </div> |
@@ -449,8 +449,8 @@ discard block |
||
449 | 449 | <?php |
450 | 450 | $activelang = !empty($usersettings['manager_language']) ? $usersettings['manager_language'] : ''; |
451 | 451 | $dir = dir("includes/lang"); |
452 | - while($file = $dir->read()) { |
|
453 | - if(strpos($file, ".inc.php") > 0) { |
|
452 | + while ($file = $dir->read()) { |
|
453 | + if (strpos($file, ".inc.php") > 0) { |
|
454 | 454 | $endpos = strpos($file, "."); |
455 | 455 | $languagename = substr($file, 0, $endpos); |
456 | 456 | $selectedtext = $languagename == $activelang ? "selected='selected'" : ""; |
@@ -537,17 +537,17 @@ discard block |
||
537 | 537 | <option value=""></option> |
538 | 538 | <?php |
539 | 539 | $dir = dir("media/style/"); |
540 | - while($file = $dir->read()) { |
|
541 | - if($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
540 | + while ($file = $dir->read()) { |
|
541 | + if ($file != "." && $file != ".." && is_dir("media/style/$file") && substr($file, 0, 1) != '.') { |
|
542 | 542 | $themename = $file; |
543 | - if($themename === 'common') { |
|
543 | + if ($themename === 'common') { |
|
544 | 544 | continue; |
545 | 545 | } |
546 | - $attr = 'value="' . $themename . '" '; |
|
547 | - if(isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
546 | + $attr = 'value="'.$themename.'" '; |
|
547 | + if (isset($usersettings['manager_theme']) && $themename == $usersettings['manager_theme']) { |
|
548 | 548 | $attr .= 'selected="selected" '; |
549 | 549 | } |
550 | - echo "\t\t<option " . rtrim($attr) . '>' . ucwords(str_replace("_", " ", $themename)) . "</option>\n"; |
|
550 | + echo "\t\t<option ".rtrim($attr).'>'.ucwords(str_replace("_", " ", $themename))."</option>\n"; |
|
551 | 551 | } |
552 | 552 | } |
553 | 553 | $dir->close(); |
@@ -588,12 +588,12 @@ discard block |
||
588 | 588 | <td><select name="which_browser" class="inputBox" onChange="documentDirty=true;"> |
589 | 589 | <?php |
590 | 590 | $selected = 'default' == $usersettings['which_browser'] || !$usersettings['which_browser'] ? ' selected="selected"' : ''; |
591 | - echo '<option value="default"' . $selected . '>' . $_lang['option_default'] . "</option>\n"; |
|
592 | - foreach(glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
591 | + echo '<option value="default"'.$selected.'>'.$_lang['option_default']."</option>\n"; |
|
592 | + foreach (glob("media/browser/*", GLOB_ONLYDIR) as $dir) { |
|
593 | 593 | $dir = str_replace('\\', '/', $dir); |
594 | 594 | $browser_name = substr($dir, strrpos($dir, '/') + 1); |
595 | 595 | $selected = $browser_name == $usersettings['which_browser'] ? ' selected="selected"' : ''; |
596 | - echo '<option value="' . $browser_name . '"' . $selected . '>' . "{$browser_name}</option>\n"; |
|
596 | + echo '<option value="'.$browser_name.'"'.$selected.'>'."{$browser_name}</option>\n"; |
|
597 | 597 | } |
598 | 598 | ?> |
599 | 599 | </select></td> |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | </tr> |
621 | 621 | <tr> |
622 | 622 | <td> </td> |
623 | - <td class='comment'><?php echo $_lang["uploadable_images_message"] . $_lang["user_upload_message"] ?></td> |
|
623 | + <td class='comment'><?php echo $_lang["uploadable_images_message"].$_lang["user_upload_message"] ?></td> |
|
624 | 624 | </tr> |
625 | 625 | <tr> |
626 | 626 | <th><?php echo $_lang["uploadable_media_title"] ?></th> |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | </tr> |
633 | 633 | <tr> |
634 | 634 | <td> </td> |
635 | - <td class='comment'><?php echo $_lang["uploadable_media_message"] . $_lang["user_upload_message"] ?></td> |
|
635 | + <td class='comment'><?php echo $_lang["uploadable_media_message"].$_lang["user_upload_message"] ?></td> |
|
636 | 636 | </tr> |
637 | 637 | <tr> |
638 | 638 | <th><?php echo $_lang["uploadable_flash_title"] ?></th> |
@@ -644,7 +644,7 @@ discard block |
||
644 | 644 | </tr> |
645 | 645 | <tr> |
646 | 646 | <td> </td> |
647 | - <td class='comment'><?php echo $_lang["uploadable_flash_message"] . $_lang["user_upload_message"] ?></td> |
|
647 | + <td class='comment'><?php echo $_lang["uploadable_flash_message"].$_lang["user_upload_message"] ?></td> |
|
648 | 648 | </tr> |
649 | 649 | <tr> |
650 | 650 | <th><?php echo $_lang["uploadable_files_title"] ?></th> |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | </tr> |
657 | 657 | <tr> |
658 | 658 | <td> </td> |
659 | - <td class='comment'><?php echo $_lang["uploadable_files_message"] . $_lang["user_upload_message"] ?></td> |
|
659 | + <td class='comment'><?php echo $_lang["uploadable_files_message"].$_lang["user_upload_message"] ?></td> |
|
660 | 660 | </tr> |
661 | 661 | <tr class='row2'> |
662 | 662 | <th><?php echo $_lang["upload_maxsize_title"] ?></th> |
@@ -675,11 +675,11 @@ discard block |
||
675 | 675 | $edt = isset ($usersettings["which_editor"]) ? $usersettings["which_editor"] : ''; |
676 | 676 | // invoke OnRichTextEditorRegister event |
677 | 677 | $evtOut = $modx->invokeEvent("OnRichTextEditorRegister"); |
678 | - echo "<option value='none'" . ($edt == 'none' ? " selected='selected'" : "") . ">" . $_lang["none"] . "</option>\n"; |
|
679 | - if(is_array($evtOut)) { |
|
680 | - for($i = 0; $i < count($evtOut); $i++) { |
|
678 | + echo "<option value='none'".($edt == 'none' ? " selected='selected'" : "").">".$_lang["none"]."</option>\n"; |
|
679 | + if (is_array($evtOut)) { |
|
680 | + for ($i = 0; $i < count($evtOut); $i++) { |
|
681 | 681 | $editor = $evtOut[$i]; |
682 | - echo "<option value='$editor'" . ($edt == $editor ? " selected='selected'" : "") . ">$editor</option>\n"; |
|
682 | + echo "<option value='$editor'".($edt == $editor ? " selected='selected'" : "").">$editor</option>\n"; |
|
683 | 683 | } |
684 | 684 | } |
685 | 685 | ?> |
@@ -717,7 +717,7 @@ discard block |
||
717 | 717 | <?php |
718 | 718 | // invoke OnInterfaceSettingsRender event |
719 | 719 | $evtOut = $modx->invokeEvent("OnInterfaceSettingsRender"); |
720 | - if(is_array($evtOut)) { |
|
720 | + if (is_array($evtOut)) { |
|
721 | 721 | echo implode("", $evtOut); |
722 | 722 | } |
723 | 723 | ?> |
@@ -744,7 +744,7 @@ discard block |
||
744 | 744 | function BrowseServer() { |
745 | 745 | var w = screen.width * 0.7; |
746 | 746 | var h = screen.height * 0.7; |
747 | - OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser;?>/browser.php?Type=images", w, h); |
|
747 | + OpenServerBrowser("<?php echo MODX_MANAGER_URL; ?>media/browser/<?php echo $which_browser; ?>/browser.php?Type=images", w, h); |
|
748 | 748 | } |
749 | 749 | |
750 | 750 | function SetUrl(url, width, height, alt) { |
@@ -767,17 +767,17 @@ discard block |
||
767 | 767 | </tr> |
768 | 768 | </table> |
769 | 769 | </div> |
770 | - <?php if($use_udperms == 1) { |
|
770 | + <?php if ($use_udperms == 1) { |
|
771 | 771 | |
772 | 772 | $groupsarray = array(); |
773 | 773 | |
774 | - if($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited |
|
774 | + if ($modx->getManagerApi()->action == '12') { // only do this bit if the user is being edited |
|
775 | 775 | $rs = $modx->getDatabase()->select('user_group', $modx->getDatabase()->getFullTableName('member_groups'), "member='{$user}'"); |
776 | 776 | $groupsarray = $modx->getDatabase()->getColumn('user_group', $rs); |
777 | 777 | } |
778 | 778 | // retain selected doc groups between post |
779 | - if(is_array($_POST['user_groups'])) { |
|
780 | - foreach($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
779 | + if (is_array($_POST['user_groups'])) { |
|
780 | + foreach ($_POST['user_groups'] as $n => $v) $groupsarray[] = $v; |
|
781 | 781 | } |
782 | 782 | ?> |
783 | 783 | <div class="tab-page" id="tabAccess"> |
@@ -786,8 +786,8 @@ discard block |
||
786 | 786 | <p><?php echo $_lang['access_permissions_user_message'] ?></p> |
787 | 787 | <?php |
788 | 788 | $rs = $modx->getDatabase()->select('name, id', $modx->getDatabase()->getFullTableName('membergroup_names'), '', 'name'); |
789 | - while($row = $modx->getDatabase()->getRow($rs)) { |
|
790 | - echo "<label><input type='checkbox' name='user_groups[]' value='" . $row['id'] . "'" . (in_array($row['id'], $groupsarray) ? " checked='checked'" : "") . " />" . $row['name'] . "</label><br />"; |
|
789 | + while ($row = $modx->getDatabase()->getRow($rs)) { |
|
790 | + echo "<label><input type='checkbox' name='user_groups[]' value='".$row['id']."'".(in_array($row['id'], $groupsarray) ? " checked='checked'" : "")." />".$row['name']."</label><br />"; |
|
791 | 791 | } |
792 | 792 | } |
793 | 793 | ?> |
@@ -800,7 +800,7 @@ discard block |
||
800 | 800 | $evtOut = $modx->invokeEvent("OnUserFormRender", array( |
801 | 801 | "id" => $user |
802 | 802 | )); |
803 | - if(is_array($evtOut)) { |
|
803 | + if (is_array($evtOut)) { |
|
804 | 804 | echo implode("", $evtOut); |
805 | 805 | } |
806 | 806 | ?> |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | |
6 | -switch ((int)$modx->getManagerApi()->action) { |
|
6 | +switch ((int) $modx->getManagerApi()->action) { |
|
7 | 7 | case 35: |
8 | 8 | if (!$modx->hasPermission('edit_role')) { |
9 | 9 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
@@ -18,7 +18,7 @@ discard block |
||
18 | 18 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
19 | 19 | } |
20 | 20 | |
21 | -$role = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
21 | +$role = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
22 | 22 | |
23 | 23 | $tbl_user_roles = $modx->getDatabase()->getFullTableName('user_roles'); |
24 | 24 | |
@@ -46,7 +46,7 @@ discard block |
||
46 | 46 | // Add lock-element JS-Script |
47 | 47 | $lockElementId = $role; |
48 | 48 | $lockElementType = 8; |
49 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
49 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
50 | 50 | ?> |
51 | 51 | <script type="text/javascript"> |
52 | 52 | function changestate(element) { |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | <input type="hidden" name="id" value="<?= $_GET['id'] ?>"> |
83 | 83 | |
84 | 84 | <h1> |
85 | - <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'] . '<small>(' . $roledata['id'] . ')</small>' : $_lang['role_title']) ?> |
|
85 | + <i class="fa fa-legal"></i><?= ($roledata['name'] ? $roledata['name'].'<small>('.$roledata['id'].')</small>' : $_lang['role_title']) ?> |
|
86 | 86 | </h1> |
87 | 87 | |
88 | 88 | <?= $_style['actionbuttons']['dynamic']['savedelete'] ?> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if (!($modx->hasPermission('new_module') || $modx->hasPermission('edit_module') || $modx->hasPermission('exec_module'))) { |
@@ -107,22 +107,22 @@ discard block |
||
107 | 107 | <div class="table-responsive"> |
108 | 108 | <?php |
109 | 109 | if ($_SESSION['mgrRole'] != 1 && !empty($modx->config['use_udperms'])) { |
110 | - $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"' . $_lang['yes'] . '","-") as disabled, IF(sm.icon<>"",sm.icon,"' . $_style['icons_modules'] . '") as icon |
|
111 | - FROM ' . $modx->getDatabase()->getFullTableName('site_modules') . ' AS sm |
|
112 | - LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_module_access') . ' AS sma ON sma.module = sm.id |
|
113 | - LEFT JOIN ' . $modx->getDatabase()->getFullTableName('member_groups') . ' AS mg ON sma.usergroup = mg.user_group |
|
114 | - WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID() . ') AND sm.disabled != 1 AND sm.locked != 1 |
|
110 | + $rs = $modx->getDatabase()->query('SELECT DISTINCT sm.id, sm.name, sm.description, mg.member, IF(disabled,"'.$_lang['yes'].'","-") as disabled, IF(sm.icon<>"",sm.icon,"'.$_style['icons_modules'].'") as icon |
|
111 | + FROM ' . $modx->getDatabase()->getFullTableName('site_modules').' AS sm |
|
112 | + LEFT JOIN ' . $modx->getDatabase()->getFullTableName('site_module_access').' AS sma ON sma.module = sm.id |
|
113 | + LEFT JOIN ' . $modx->getDatabase()->getFullTableName('member_groups').' AS mg ON sma.usergroup = mg.user_group |
|
114 | + WHERE (mg.member IS NULL OR mg.member = ' . $modx->getLoginUserID().') AND sm.disabled != 1 AND sm.locked != 1 |
|
115 | 115 | ORDER BY sm.name'); |
116 | 116 | if ($modx->hasPermission('edit_module')) { |
117 | - $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
|
117 | + $title = "<a href='index.php?a=108&id=[+id+]' title='".$_lang["module_edit_click_title"]."'>[+value+]</a>"; |
|
118 | 118 | } else if ($modx->hasPermission('exec_module')) { |
119 | - $title = "<a href='index.php?a=112&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
|
119 | + $title = "<a href='index.php?a=112&id=[+id+]' title='".$_lang["module_edit_click_title"]."'>[+value+]</a>"; |
|
120 | 120 | } else { |
121 | 121 | $title = '[+value+]'; |
122 | 122 | } |
123 | 123 | } else { |
124 | 124 | $rs = $modx->getDatabase()->select("id, name, description, IF(locked,'{$_lang['yes']}','-') as locked, IF(disabled,'{$_lang['yes']}','-') as disabled, IF(icon<>'',icon,'{$_style['icons_module']}') as icon", $modx->getDatabase()->getFullTableName("site_modules"), (!empty($sqlQuery) ? "(name LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "name"); |
125 | - $title = "<a href='index.php?a=108&id=[+id+]' title='" . $_lang["module_edit_click_title"] . "'>[+value+]</a>"; |
|
125 | + $title = "<a href='index.php?a=108&id=[+id+]' title='".$_lang["module_edit_click_title"]."'>[+value+]</a>"; |
|
126 | 126 | } |
127 | 127 | $grd = new \EvolutionCMS\Support\DataGrid('', $rs, $number_of_results); // set page size to 0 t show all items |
128 | 128 | $grd->noRecordMsg = $_lang["no_records_found"]; |
@@ -131,10 +131,10 @@ discard block |
||
131 | 131 | $grd->itemClass = "tableItem"; |
132 | 132 | $grd->altItemClass = "tableAltItem"; |
133 | 133 | $grd->fields = "icon,name,description,locked,disabled"; |
134 | - $grd->columns = $_lang["icon"] . " ," . $_lang["name"] . " ," . $_lang["description"] . " ," . $_lang["locked"] . " ," . $_lang["disabled"]; |
|
134 | + $grd->columns = $_lang["icon"]." ,".$_lang["name"]." ,".$_lang["description"]." ,".$_lang["locked"]." ,".$_lang["disabled"]; |
|
135 | 135 | $grd->colWidths = "34,,,60,60"; |
136 | 136 | $grd->colAligns = "center,,,center,center"; |
137 | - $grd->colTypes = "template:<a class='tableRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . $_lang["click_to_context"] . "'><i class='[+value+]'></i></a>||template:" . $title; |
|
137 | + $grd->colTypes = "template:<a class='tableRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".$_lang["click_to_context"]."'><i class='[+value+]'></i></a>||template:".$title; |
|
138 | 138 | if ($listmode == '1') { |
139 | 139 | $grd->pageSize = 0; |
140 | 140 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if (!$modx->hasPermission('messages')) { |
@@ -16,7 +16,7 @@ discard block |
||
16 | 16 | <div class="container container-body" id="lyr3"> |
17 | 17 | <b><?= $_lang['messages_read_message'] ?></b> |
18 | 18 | <?php |
19 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_messages'), "id='" . (int)$_REQUEST['id'] . "'"); |
|
19 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_messages'), "id='".(int) $_REQUEST['id']."'"); |
|
20 | 20 | $message = $modx->getDatabase()->getRow($rs); |
21 | 21 | if (!$message) { |
22 | 22 | echo "Wrong number of messages returned!"; |
@@ -87,7 +87,7 @@ discard block |
||
87 | 87 | <p><b><?= $_lang['messages_inbox'] ?></b></p> |
88 | 88 | <?php |
89 | 89 | // Get number of rows |
90 | - $rs = $modx->getDatabase()->select('count(id)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . ""); |
|
90 | + $rs = $modx->getDatabase()->select('count(id)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID().""); |
|
91 | 91 | $num_rows = $modx->getDatabase()->getValue($rs); |
92 | 92 | |
93 | 93 | // ============================================================== |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | if (!isset($_REQUEST['int_cur_position']) || $_REQUEST['int_cur_position'] == 0) { |
101 | 101 | $int_cur_position = 0; |
102 | 102 | } else { |
103 | - $int_cur_position = (int)$_REQUEST['int_cur_position']; |
|
103 | + $int_cur_position = (int) $_REQUEST['int_cur_position']; |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | // Number of result to display on the page, will be in the LIMIT of the sql query also |
@@ -116,21 +116,21 @@ discard block |
||
116 | 116 | $array_row_paging = $p->getPagingRowArray(); |
117 | 117 | |
118 | 118 | // Display the result as you like... |
119 | - $pager .= $_lang['showing'] . " " . $array_paging['lower']; |
|
120 | - $pager .= " " . $_lang['to'] . " " . $array_paging['upper']; |
|
121 | - $pager .= " (" . $array_paging['total'] . " " . $_lang['total'] . ")"; |
|
122 | - $pager .= "<br />" . $array_paging['previous_link'] . "<<" . (isset($array_paging['previous_link']) ? "</a> " : " "); |
|
119 | + $pager .= $_lang['showing']." ".$array_paging['lower']; |
|
120 | + $pager .= " ".$_lang['to']." ".$array_paging['upper']; |
|
121 | + $pager .= " (".$array_paging['total']." ".$_lang['total'].")"; |
|
122 | + $pager .= "<br />".$array_paging['previous_link']."<<".(isset($array_paging['previous_link']) ? "</a> " : " "); |
|
123 | 123 | for ($i = 0; $i < sizeof($array_row_paging); $i++) { |
124 | - $pager .= $array_row_paging[$i] . " "; |
|
124 | + $pager .= $array_row_paging[$i]." "; |
|
125 | 125 | } |
126 | - $pager .= $array_paging['next_link'] . ">>" . (isset($array_paging['next_link']) ? "</a>" : ""); |
|
126 | + $pager .= $array_paging['next_link'].">>".(isset($array_paging['next_link']) ? "</a>" : ""); |
|
127 | 127 | |
128 | 128 | // The above exemple print somethings like: |
129 | 129 | // Results 1 to 20 of 597 <<< 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 >>> |
130 | 130 | // Of course you can now play with array_row_paging in order to print |
131 | 131 | // only the results you would like... |
132 | 132 | |
133 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . "", 'postdate DESC', "{$int_cur_position}, {$int_num_result}"); |
|
133 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()."", 'postdate DESC', "{$int_cur_position}, {$int_num_result}"); |
|
134 | 134 | $limit = $modx->getDatabase()->getRecordCount($rs); |
135 | 135 | if ($limit < 1) { |
136 | 136 | echo $_lang['messages_no_messages']; |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | <p><b><?= $_lang['messages_compose'] ?></b></p> |
189 | 189 | <?php |
190 | 190 | if (($_REQUEST['m'] == 'rp' || $_REQUEST['m'] == 'f') && isset($_REQUEST['id'])) { |
191 | - $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_messages'), "id='" . $_REQUEST['id'] . "'"); |
|
191 | + $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('user_messages'), "id='".$_REQUEST['id']."'"); |
|
192 | 192 | $message = $modx->getDatabase()->getRow($rs); |
193 | 193 | if (!$message) { |
194 | 194 | echo "Wrong number of messages returned!"; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | } |
208 | 208 | $subjecttext = $_REQUEST['m'] == 'rp' ? "Re: " : "Fwd: "; |
209 | 209 | $subjecttext .= $message['subject']; |
210 | - $messagetext = "\n\n\n-----\n" . $_lang['messages_from'] . ": $sendername\n" . $_lang['messages_sent'] . ": " . $modx->toDateFormat($message['postdate'] + $server_offset_time) . "\n" . $_lang['messages_subject'] . ": " . $message['subject'] . "\n\n" . $message['message']; |
|
210 | + $messagetext = "\n\n\n-----\n".$_lang['messages_from'].": $sendername\n".$_lang['messages_sent'].": ".$modx->toDateFormat($message['postdate'] + $server_offset_time)."\n".$_lang['messages_subject'].": ".$message['subject']."\n\n".$message['message']; |
|
211 | 211 | if ($_REQUEST['m'] == 'rp') { |
212 | 212 | $recipientindex = $message['sender']; |
213 | 213 | } |
@@ -294,9 +294,9 @@ discard block |
||
294 | 294 | |
295 | 295 | <?php |
296 | 296 | // count messages again, as any action on the messages page may have altered the message count |
297 | -$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . " and messageread=0"); |
|
297 | +$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID()." and messageread=0"); |
|
298 | 298 | $_SESSION['nrnewmessages'] = $modx->getDatabase()->getValue($rs); |
299 | -$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=" . $modx->getLoginUserID() . ""); |
|
299 | +$rs = $modx->getDatabase()->select('COUNT(*)', $modx->getDatabase()->getFullTableName('user_messages'), "recipient=".$modx->getLoginUserID().""); |
|
300 | 300 | $_SESSION['nrtotalmessages'] = $modx->getDatabase()->getValue($rs); |
301 | 301 | $messagesallowed = $modx->hasPermission('messages'); |
302 | 302 | ?> |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if( ! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | exit(); |
4 | 4 | } |
5 | 5 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
@@ -41,9 +41,9 @@ discard block |
||
41 | 41 | <?php |
42 | 42 | $rs = $modx->getDatabase()->select('*', $modx->getDatabase()->getFullTableName('site_templates')); |
43 | 43 | $option[] = '<option value="">No selected</option>'; |
44 | - $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int)$_REQUEST['templateid'] : ''; |
|
44 | + $templateid = (isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '') ? (int) $_REQUEST['templateid'] : ''; |
|
45 | 45 | $selected = $templateid === 0 ? ' selected="selected"' : ''; |
46 | - $option[] = '<option value="0"' . $selected . '>(blank)</option>'; |
|
46 | + $option[] = '<option value="0"'.$selected.'>(blank)</option>'; |
|
47 | 47 | while ($row = $modx->getDatabase()->getRow($rs)) { |
48 | 48 | $templatename = htmlspecialchars($row['templatename'], ENT_QUOTES, $modx->config['modx_charset']); |
49 | 49 | $selected = $row['id'] == $templateid ? ' selected="selected"' : ''; |
@@ -86,7 +86,7 @@ discard block |
||
86 | 86 | $searchfields = htmlentities(trim($_POST['searchfields']), ENT_QUOTES, $modx_manager_charset); |
87 | 87 | $searchlongtitle = $modx->getDatabase()->escape(trim($_REQUEST['searchfields'])); |
88 | 88 | $search_alias = $modx->getDatabase()->escape(trim($_REQUEST['searchfields'])); |
89 | - $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int)$_REQUEST['templateid'] : ''; |
|
89 | + $templateid = isset($_REQUEST['templateid']) && $_REQUEST['templateid'] !== '' ? (int) $_REQUEST['templateid'] : ''; |
|
90 | 90 | $searchcontent = $modx->getDatabase()->escape($_REQUEST['content']); |
91 | 91 | |
92 | 92 | $fields = 'DISTINCT sc.id, contenttype, pagetitle, longtitle, description, introtext, menutitle, deleted, published, isfolder, type'; |
@@ -100,12 +100,12 @@ discard block |
||
100 | 100 | $friendly_url_suffix = $modx->config['friendly_url_suffix']; |
101 | 101 | $base_url = $modx->config['base_url']; |
102 | 102 | $site_url = $modx->config['site_url']; |
103 | - $url = preg_replace('@' . $friendly_url_suffix . '$@', '', $url); |
|
103 | + $url = preg_replace('@'.$friendly_url_suffix.'$@', '', $url); |
|
104 | 104 | if ($url[0] === '/') { |
105 | - $url = preg_replace('@^' . $base_url . '@', '', $url); |
|
105 | + $url = preg_replace('@^'.$base_url.'@', '', $url); |
|
106 | 106 | } |
107 | 107 | if (substr($url, 0, 4) === 'http') { |
108 | - $url = preg_replace('@^' . $site_url . '@', '', $url); |
|
108 | + $url = preg_replace('@^'.$site_url.'@', '', $url); |
|
109 | 109 | } |
110 | 110 | $idFromAlias = $modx->getIdFromAlias($url); |
111 | 111 | } |
@@ -118,18 +118,18 @@ discard block |
||
118 | 118 | $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; |
119 | 119 | $articul_result = $modx->getDatabase()->query($articul_query); |
120 | 120 | $articul_id_array = $modx->getDatabase()->makeArray($articul_result); |
121 | - if(count($articul_id_array)>0){ |
|
121 | + if (count($articul_id_array) > 0) { |
|
122 | 122 | $articul_id = ''; |
123 | 123 | $i = 1; |
124 | - foreach( $articul_id_array as $articul ) { |
|
125 | - $articul_id.=$articul['contentid']; |
|
126 | - if($i !== count($articul_id_array)){ |
|
127 | - $articul_id.=','; |
|
124 | + foreach ($articul_id_array as $articul) { |
|
125 | + $articul_id .= $articul['contentid']; |
|
126 | + if ($i !== count($articul_id_array)) { |
|
127 | + $articul_id .= ','; |
|
128 | 128 | } |
129 | 129 | $i++; |
130 | 130 | } |
131 | 131 | $articul_id_query = " OR sc.id IN ({$articul_id})"; |
132 | - }else{ |
|
132 | + } else { |
|
133 | 133 | $articul_id_query = ''; |
134 | 134 | } |
135 | 135 | /*end search by TV*/ |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | if (ctype_digit($searchfields)) { |
138 | 138 | $sqladd .= "sc.id='{$searchfields}'"; |
139 | 139 | if (strlen($searchfields) > 3) { |
140 | - $sqladd .= $articul_id_query;//search by TV |
|
140 | + $sqladd .= $articul_id_query; //search by TV |
|
141 | 141 | $sqladd .= " OR sc.pagetitle LIKE '%{$searchfields}%'"; |
142 | 142 | } |
143 | 143 | } |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | $sqladd .= " OR sc.introtext LIKE '%{$searchlongtitle}%'"; |
158 | 158 | $sqladd .= " OR sc.menutitle LIKE '%{$searchlongtitle}%'"; |
159 | 159 | $sqladd .= " OR sc.alias LIKE '%{$search_alias}%'"; |
160 | - $sqladd .= $articul_id_query;//search by TV |
|
160 | + $sqladd .= $articul_id_query; //search by TV |
|
161 | 161 | $sqladd .= ")"; |
162 | 162 | } |
163 | 163 | } else if ($idFromAlias) { |
@@ -181,8 +181,8 @@ discard block |
||
181 | 181 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
182 | 182 | $mgrRole = (isset ($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0; |
183 | 183 | $docgrp_cond = $docgrp ? " OR dg.document_group IN ({$docgrp})" : ''; |
184 | - $fields .= ', MAX(IF(1=' . $mgrRole . ' OR sc.privatemgr=0' . $docgrp_cond . ',1,0)) AS hasAccess'; |
|
185 | - $sqladd = '(' . $sqladd . ") AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
184 | + $fields .= ', MAX(IF(1='.$mgrRole.' OR sc.privatemgr=0'.$docgrp_cond.',1,0)) AS hasAccess'; |
|
185 | + $sqladd = '('.$sqladd.") AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
186 | 186 | } |
187 | 187 | |
188 | 188 | if ($sqladd) { |
@@ -192,7 +192,7 @@ discard block |
||
192 | 192 | $where = $sqladd; |
193 | 193 | |
194 | 194 | if ($where) { |
195 | - $rs = $modx->getDatabase()->select($fields, $tbl_site_content . ' AS sc LEFT JOIN ' . $tbldg . ' AS dg ON dg.document=sc.id', $where, 'sc.id'); |
|
195 | + $rs = $modx->getDatabase()->select($fields, $tbl_site_content.' AS sc LEFT JOIN '.$tbldg.' AS dg ON dg.document=sc.id', $where, 'sc.id'); |
|
196 | 196 | $limit = $modx->getDatabase()->getRecordCount($rs); |
197 | 197 | } else { |
198 | 198 | $limit = 0; |
@@ -211,7 +211,7 @@ discard block |
||
211 | 211 | if ($limit < 1) { |
212 | 212 | echo $_lang['search_empty']; |
213 | 213 | } else { |
214 | - printf('<p>' . $_lang['search_results_returned_msg'] . '</p>', $limit); |
|
214 | + printf('<p>'.$_lang['search_results_returned_msg'].'</p>', $limit); |
|
215 | 215 | ?> |
216 | 216 | <script type="text/javascript" src="media/script/tablesort.js"></script> |
217 | 217 | <table class="grid sortabletable sortable-onload-2 rowstyle-even" id="table-1"> |
@@ -271,14 +271,14 @@ discard block |
||
271 | 271 | if (function_exists('mb_strlen') && function_exists('mb_substr')) { |
272 | 272 | ?> |
273 | 273 | <td<?= $tdClass ?>> |
274 | - <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset) . "..." : $row['pagetitle'] ?></a> |
|
274 | + <a href="index.php?a=27&id=<?= $row['id'] ?>"><?= mb_strlen($row['pagetitle'], $modx_manager_charset) > 70 ? mb_substr($row['pagetitle'], 0, 70, $modx_manager_charset)."..." : $row['pagetitle'] ?></a> |
|
275 | 275 | </td> |
276 | - <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset) . "..." : $row['description'] ?></td> |
|
276 | + <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset)."..." : $row['description'] ?></td> |
|
277 | 277 | <?php |
278 | 278 | } else { |
279 | 279 | ?> |
280 | - <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle'] ?></td> |
|
281 | - <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35) . '...' : $row['description'] ?></td> |
|
280 | + <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20).'...' : $row['pagetitle'] ?></td> |
|
281 | + <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35).'...' : $row['description'] ?></td> |
|
282 | 282 | <?php |
283 | 283 | } |
284 | 284 | ?> |
@@ -298,115 +298,115 @@ discard block |
||
298 | 298 | if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
299 | 299 | $docscounts = $modx->getDatabase()->getRecordCount($rs); |
300 | 300 | if ($docscounts > 0) { |
301 | - $output .= '<li><b><i class="fa fa-sitemap"></i> ' . $_lang["manage_documents"] . ' (' . $docscounts . ')</b></li>'; |
|
301 | + $output .= '<li><b><i class="fa fa-sitemap"></i> '.$_lang["manage_documents"].' ('.$docscounts.')</b></li>'; |
|
302 | 302 | while ($row = $modx->getDatabase()->getRow($rs)) { |
303 | - $output .= '<li' . addClassForItemList('', !$row['published'], $row['deleted']) . '><a href="index.php?a=27&id=' . $row['id'] . '" id="content_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['pagetitle'] . ' <small>(' . $row['id'] . ')</small>', $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
303 | + $output .= '<li'.addClassForItemList('', !$row['published'], $row['deleted']).'><a href="index.php?a=27&id='.$row['id'].'" id="content_'.$row['id'].'" target="main">'.highlightingCoincidence($row['pagetitle'].' <small>('.$row['id'].')</small>', $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
304 | 304 | } |
305 | 305 | } |
306 | 306 | } |
307 | 307 | |
308 | 308 | //templates |
309 | 309 | if ($modx->hasPermission('edit_template')) { |
310 | - $rs = $modx->getDatabase()->select("id,templatename,locked", $modx->getDatabase()->getFullTableName('site_templates'), "`id` like '%" . $searchfields . "%' |
|
311 | - OR `templatename` like '%" . $searchfields . "%' |
|
312 | - OR `description` like '%" . $searchfields . "%' |
|
313 | - OR `content` like '%" . $searchfields . "%'"); |
|
310 | + $rs = $modx->getDatabase()->select("id,templatename,locked", $modx->getDatabase()->getFullTableName('site_templates'), "`id` like '%".$searchfields."%' |
|
311 | + OR `templatename` like '%" . $searchfields."%' |
|
312 | + OR `description` like '%" . $searchfields."%' |
|
313 | + OR `content` like '%" . $searchfields."%'"); |
|
314 | 314 | $templatecounts = $modx->getDatabase()->getRecordCount($rs); |
315 | 315 | if ($templatecounts > 0) { |
316 | - $output .= '<li><b><i class="fa fa-newspaper-o"></i> ' . $_lang["manage_templates"] . ' (' . $templatecounts . ')</b></li>'; |
|
316 | + $output .= '<li><b><i class="fa fa-newspaper-o"></i> '.$_lang["manage_templates"].' ('.$templatecounts.')</b></li>'; |
|
317 | 317 | while ($row = $modx->getDatabase()->getRow($rs)) { |
318 | - $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=16&id=' . $row['id'] . '" id="templates_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
318 | + $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=16&id='.$row['id'].'" id="templates_'.$row['id'].'" target="main">'.highlightingCoincidence($row['templatename'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
319 | 319 | } |
320 | 320 | } |
321 | 321 | } |
322 | 322 | |
323 | 323 | //tvs |
324 | 324 | if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
325 | - $rs = $modx->getDatabase()->select("id,name,locked", $modx->getDatabase()->getFullTableName('site_tmplvars'), "`id` like '%" . $searchfields . "%' |
|
326 | - OR `name` like '%" . $searchfields . "%' |
|
327 | - OR `description` like '%" . $searchfields . "%' |
|
328 | - OR `type` like '%" . $searchfields . "%' |
|
329 | - OR `elements` like '%" . $searchfields . "%' |
|
330 | - OR `display` like '%" . $searchfields . "%' |
|
331 | - OR `display_params` like '%" . $searchfields . "%' |
|
332 | - OR `default_text` like '%" . $searchfields . "%'"); |
|
325 | + $rs = $modx->getDatabase()->select("id,name,locked", $modx->getDatabase()->getFullTableName('site_tmplvars'), "`id` like '%".$searchfields."%' |
|
326 | + OR `name` like '%" . $searchfields."%' |
|
327 | + OR `description` like '%" . $searchfields."%' |
|
328 | + OR `type` like '%" . $searchfields."%' |
|
329 | + OR `elements` like '%" . $searchfields."%' |
|
330 | + OR `display` like '%" . $searchfields."%' |
|
331 | + OR `display_params` like '%" . $searchfields."%' |
|
332 | + OR `default_text` like '%" . $searchfields."%'"); |
|
333 | 333 | $tvscounts = $modx->getDatabase()->getRecordCount($rs); |
334 | 334 | if ($tvscounts > 0) { |
335 | - $output .= '<li><b><i class="fa fa-list-alt"></i> ' . $_lang["settings_templvars"] . ' (' . $tvscounts . ')</b></li>'; |
|
335 | + $output .= '<li><b><i class="fa fa-list-alt"></i> '.$_lang["settings_templvars"].' ('.$tvscounts.')</b></li>'; |
|
336 | 336 | while ($row = $modx->getDatabase()->getRow($rs)) { |
337 | - $output .= '<li' . addClassForItemList($row['locked']) . '><a href="index.php?a=301&id=' . $row['id'] . '" id="tmplvars_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
337 | + $output .= '<li'.addClassForItemList($row['locked']).'><a href="index.php?a=301&id='.$row['id'].'" id="tmplvars_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
338 | 338 | } |
339 | 339 | } |
340 | 340 | } |
341 | 341 | |
342 | 342 | //Chunks |
343 | 343 | if ($modx->hasPermission('edit_chunk')) { |
344 | - $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_htmlsnippets'), "`id` like '%" . $searchfields . "%' |
|
345 | - OR `name` like '%" . $searchfields . "%' |
|
346 | - OR `description` like '%" . $searchfields . "%' |
|
347 | - OR `snippet` like '%" . $searchfields . "%'"); |
|
344 | + $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_htmlsnippets'), "`id` like '%".$searchfields."%' |
|
345 | + OR `name` like '%" . $searchfields."%' |
|
346 | + OR `description` like '%" . $searchfields."%' |
|
347 | + OR `snippet` like '%" . $searchfields."%'"); |
|
348 | 348 | $chunkscounts = $modx->getDatabase()->getRecordCount($rs); |
349 | 349 | if ($chunkscounts > 0) { |
350 | - $output .= '<li><b><i class="fa fa-th-large"></i> ' . $_lang["manage_htmlsnippets"] . ' (' . $chunkscounts . ')</b></li>'; |
|
350 | + $output .= '<li><b><i class="fa fa-th-large"></i> '.$_lang["manage_htmlsnippets"].' ('.$chunkscounts.')</b></li>'; |
|
351 | 351 | while ($row = $modx->getDatabase()->getRow($rs)) { |
352 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=78&id=' . $row['id'] . '" id="htmlsnippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
352 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=78&id='.$row['id'].'" id="htmlsnippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
353 | 353 | } |
354 | 354 | } |
355 | 355 | } |
356 | 356 | |
357 | 357 | //Snippets |
358 | 358 | if ($modx->hasPermission('edit_snippet')) { |
359 | - $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_snippets'), "`id` like '%" . $searchfields . "%' |
|
360 | - OR `name` like '%" . $searchfields . "%' |
|
361 | - OR `description` like '%" . $searchfields . "%' |
|
362 | - OR `snippet` like '%" . $searchfields . "%' |
|
363 | - OR `properties` like '%" . $searchfields . "%' |
|
364 | - OR `moduleguid` like '%" . $searchfields . "%'"); |
|
359 | + $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_snippets'), "`id` like '%".$searchfields."%' |
|
360 | + OR `name` like '%" . $searchfields."%' |
|
361 | + OR `description` like '%" . $searchfields."%' |
|
362 | + OR `snippet` like '%" . $searchfields."%' |
|
363 | + OR `properties` like '%" . $searchfields."%' |
|
364 | + OR `moduleguid` like '%" . $searchfields."%'"); |
|
365 | 365 | $snippetscounts = $modx->getDatabase()->getRecordCount($rs); |
366 | 366 | if ($snippetscounts > 0) { |
367 | - $output .= '<li><b><i class="fa fa-code"></i> ' . $_lang["manage_snippets"] . ' (' . $snippetscounts . ')</b></li>'; |
|
367 | + $output .= '<li><b><i class="fa fa-code"></i> '.$_lang["manage_snippets"].' ('.$snippetscounts.')</b></li>'; |
|
368 | 368 | while ($row = $modx->getDatabase()->getRow($rs)) { |
369 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=22&id=' . $row['id'] . '" id="snippets_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
369 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=22&id='.$row['id'].'" id="snippets_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
370 | 370 | } |
371 | 371 | } |
372 | 372 | } |
373 | 373 | |
374 | 374 | //plugins |
375 | 375 | if ($modx->hasPermission('edit_plugin')) { |
376 | - $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_plugins'), "`id` like '%" . $searchfields . "%' |
|
377 | - OR `name` like '%" . $searchfields . "%' |
|
378 | - OR `description` like '%" . $searchfields . "%' |
|
379 | - OR `plugincode` like '%" . $searchfields . "%' |
|
380 | - OR `properties` like '%" . $searchfields . "%' |
|
381 | - OR `moduleguid` like '%" . $searchfields . "%'"); |
|
376 | + $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_plugins'), "`id` like '%".$searchfields."%' |
|
377 | + OR `name` like '%" . $searchfields."%' |
|
378 | + OR `description` like '%" . $searchfields."%' |
|
379 | + OR `plugincode` like '%" . $searchfields."%' |
|
380 | + OR `properties` like '%" . $searchfields."%' |
|
381 | + OR `moduleguid` like '%" . $searchfields."%'"); |
|
382 | 382 | $pluginscounts = $modx->getDatabase()->getRecordCount($rs); |
383 | 383 | if ($pluginscounts > 0) { |
384 | - $output .= '<li><b><i class="fa fa-plug"></i> ' . $_lang["manage_plugins"] . ' (' . $pluginscounts . ')</b></li>'; |
|
384 | + $output .= '<li><b><i class="fa fa-plug"></i> '.$_lang["manage_plugins"].' ('.$pluginscounts.')</b></li>'; |
|
385 | 385 | while ($row = $modx->getDatabase()->getRow($rs)) { |
386 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=102&id=' . $row['id'] . '" id="plugins_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
386 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=102&id='.$row['id'].'" id="plugins_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
387 | 387 | } |
388 | 388 | } |
389 | 389 | } |
390 | 390 | |
391 | 391 | //modules |
392 | 392 | if ($modx->hasPermission('edit_module')) { |
393 | - $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_modules'), "`id` like '%" . $searchfields . "%' |
|
394 | - OR `name` like '%" . $searchfields . "%' |
|
395 | - OR `description` like '%" . $searchfields . "%' |
|
396 | - OR `modulecode` like '%" . $searchfields . "%' |
|
397 | - OR `properties` like '%" . $searchfields . "%' |
|
398 | - OR `guid` like '%" . $searchfields . "%' |
|
399 | - OR `resourcefile` like '%" . $searchfields . "%'"); |
|
393 | + $rs = $modx->getDatabase()->select("id,name,locked,disabled", $modx->getDatabase()->getFullTableName('site_modules'), "`id` like '%".$searchfields."%' |
|
394 | + OR `name` like '%" . $searchfields."%' |
|
395 | + OR `description` like '%" . $searchfields."%' |
|
396 | + OR `modulecode` like '%" . $searchfields."%' |
|
397 | + OR `properties` like '%" . $searchfields."%' |
|
398 | + OR `guid` like '%" . $searchfields."%' |
|
399 | + OR `resourcefile` like '%" . $searchfields."%'"); |
|
400 | 400 | $modulescounts = $modx->getDatabase()->getRecordCount($rs); |
401 | 401 | if ($modulescounts > 0) { |
402 | - $output .= '<li><b><i class="fa fa-cogs"></i> ' . $_lang["modules"] . ' (' . $modulescounts . ')</b></li>'; |
|
402 | + $output .= '<li><b><i class="fa fa-cogs"></i> '.$_lang["modules"].' ('.$modulescounts.')</b></li>'; |
|
403 | 403 | while ($row = $modx->getDatabase()->getRow($rs)) { |
404 | - $output .= '<li' . addClassForItemList($row['locked'], $row['disabled']) . '><a href="index.php?a=108&id=' . $row['id'] . '" id="modules_' . $row['id'] . '" target="main">' . highlightingCoincidence($row['name'], $_REQUEST['searchfields']) . $_style['icons_external_link'] . '</a></li>'; |
|
404 | + $output .= '<li'.addClassForItemList($row['locked'], $row['disabled']).'><a href="index.php?a=108&id='.$row['id'].'" id="modules_'.$row['id'].'" target="main">'.highlightingCoincidence($row['name'], $_REQUEST['searchfields']).$_style['icons_external_link'].'</a></li>'; |
|
405 | 405 | } |
406 | 406 | } |
407 | 407 | } |
408 | 408 | |
409 | - echo $output ? '<div class="ajaxSearchResults"><ul>' . $output . '</ul></div>' : '1'; |
|
409 | + echo $output ? '<div class="ajaxSearchResults"><ul>'.$output.'</ul></div>' : '1'; |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | ?> |