@@ -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('export_static')) { |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | <div class="container container-body"> |
37 | 37 | <?php |
38 | 38 | if (isset($_POST['export'])) { |
39 | - $rs = include_once(MODX_MANAGER_PATH . 'processors/export_site.processor.php'); |
|
39 | + $rs = include_once(MODX_MANAGER_PATH.'processors/export_site.processor.php'); |
|
40 | 40 | echo $rs; |
41 | 41 | } else { |
42 | 42 | ?> |
@@ -1,13 +1,13 @@ 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 | /********************/ |
7 | -$sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; |
|
8 | -$sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; |
|
9 | -$pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; |
|
10 | -$add_path = $sd . $sb . $pg; |
|
7 | +$sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC'; |
|
8 | +$sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon'; |
|
9 | +$pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : ''; |
|
10 | +$add_path = $sd.$sb.$pg; |
|
11 | 11 | /*******************/ |
12 | 12 | |
13 | 13 | // check permissions |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
25 | 25 | } elseif (isset($_REQUEST['pid']) && $_REQUEST['pid'] != '0') { |
26 | 26 | // check user has permissions for parent |
27 | - include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); |
|
27 | + include_once(MODX_MANAGER_PATH.'processors/user_documents_permissions.class.php'); |
|
28 | 28 | $udperms = new udperms(); |
29 | 29 | $udperms->user = $modx->getLoginUserID(); |
30 | 30 | $udperms->document = empty($_REQUEST['pid']) ? 0 : $_REQUEST['pid']; |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
39 | 39 | } |
40 | 40 | |
41 | -$id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
41 | +$id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
42 | 42 | |
43 | 43 | // Get table names (alphabetical) |
44 | 44 | $tbl_categories = $modx->getFullTableName('categories'); |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | if ($modx->manager->action == 27) { |
57 | 57 | //editing an existing document |
58 | 58 | // check permissions on the document |
59 | - include_once(MODX_MANAGER_PATH . 'processors/user_documents_permissions.class.php'); |
|
59 | + include_once(MODX_MANAGER_PATH.'processors/user_documents_permissions.class.php'); |
|
60 | 60 | $udperms = new udperms(); |
61 | 61 | $udperms->user = $modx->getLoginUserID(); |
62 | 62 | $udperms->document = $id; |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | $modx->config['auto_menuindex'] = 1; |
137 | 137 | } |
138 | 138 | if ($modx->config['auto_menuindex']) { |
139 | - $pid = (int)$_REQUEST['pid']; |
|
139 | + $pid = (int) $_REQUEST['pid']; |
|
140 | 140 | $rs = $modx->db->select('count(*)', $tbl_site_content, "parent='{$pid}'"); |
141 | 141 | $content['menuindex'] = $modx->db->getValue($rs); |
142 | 142 | } else { |
@@ -151,7 +151,7 @@ discard block |
||
151 | 151 | // Add lock-element JS-Script |
152 | 152 | $lockElementId = $id; |
153 | 153 | $lockElementType = 7; |
154 | -require_once(MODX_MANAGER_PATH . 'includes/active_user_locks.inc.php'); |
|
154 | +require_once(MODX_MANAGER_PATH.'includes/active_user_locks.inc.php'); |
|
155 | 155 | ?> |
156 | 156 | <script type="text/javascript"> |
157 | 157 | /* <![CDATA[ */ |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | }, |
182 | 182 | cancel: function() { |
183 | 183 | documentDirty = false; |
184 | - document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id=' . $id . $add_path) ?>'; |
|
184 | + document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id='.$id.$add_path) ?>'; |
|
185 | 185 | }, |
186 | 186 | duplicate: function() { |
187 | 187 | if(confirm("<?= $_lang['confirm_resource_duplicate']?>") === true) { |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | } |
190 | 190 | }, |
191 | 191 | view: function() { |
192 | - window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'] . 'index.php?id=' . $id ?>', 'previeWin'); |
|
192 | + window.open('<?= ($modx->config['friendly_urls'] == '1') ? $modx->makeUrl($id) : $modx->config['site_url'].'index.php?id='.$id ?>', 'previeWin'); |
|
193 | 193 | } |
194 | 194 | }; |
195 | 195 | |
@@ -577,7 +577,7 @@ discard block |
||
577 | 577 | |
578 | 578 | <h1> |
579 | 579 | <i class="fa fa-pencil-square-o"></i><?php if (isset($_REQUEST['id'])) { |
580 | - echo iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']) . (iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '') . '<small>(' . $_REQUEST['id'] . ')</small>'; |
|
580 | + echo iconv_substr($content['pagetitle'], 0, 50, $modx->config['modx_charset']).(iconv_strlen($content['pagetitle'], $modx->config['modx_charset']) > 50 ? '...' : '').'<small>('.$_REQUEST['id'].')</small>'; |
|
581 | 581 | } else { |
582 | 582 | if ($modx->manager->action == '4') { |
583 | 583 | echo $_lang['add_resource']; |
@@ -614,15 +614,15 @@ discard block |
||
614 | 614 | $rs = $modx->db->select('id, pagetitle', $tbl_site_content, "id IN ({$parents})", $where); |
615 | 615 | while ($row = $modx->db->getRow($rs)) { |
616 | 616 | $out .= '<li class="breadcrumbs__li"> |
617 | - <a href="index.php?a=27&id=' . $row['id'] . '" class="breadcrumbs__a">' . htmlspecialchars($row['pagetitle'], ENT_QUOTES, $modx->config['modx_charset']) . '</a> |
|
617 | + <a href="index.php?a=27&id=' . $row['id'].'" class="breadcrumbs__a">'.htmlspecialchars($row['pagetitle'], ENT_QUOTES, $modx->config['modx_charset']).'</a> |
|
618 | 618 | <span class="breadcrumbs__sep">></span> |
619 | 619 | </li>'; |
620 | 620 | } |
621 | 621 | } |
622 | 622 | } |
623 | 623 | |
624 | - $out .= '<li class="breadcrumbs__li breadcrumbs__li_current">' . $title . '</li>'; |
|
625 | - echo '<ul class="breadcrumbs">' . $out . '</ul>'; |
|
624 | + $out .= '<li class="breadcrumbs__li breadcrumbs__li_current">'.$title.'</li>'; |
|
625 | + echo '<ul class="breadcrumbs">'.$out.'</ul>'; |
|
626 | 626 | } |
627 | 627 | ?> |
628 | 628 | |
@@ -751,7 +751,7 @@ discard block |
||
751 | 751 | |
752 | 752 | $selectedtext = ($row['id'] == $content['template']) ? ' selected="selected"' : ''; |
753 | 753 | |
754 | - echo "\t\t\t\t\t" . '<option value="' . $row['id'] . '"' . $selectedtext . '>' . $row['templatename'] . "</option>\n"; |
|
754 | + echo "\t\t\t\t\t".'<option value="'.$row['id'].'"'.$selectedtext.'>'.$row['templatename']."</option>\n"; |
|
755 | 755 | $currentCategory = $thisCategory; |
756 | 756 | } |
757 | 757 | if ($thisCategory != '') { |
@@ -900,7 +900,7 @@ discard block |
||
900 | 900 | $richtexteditorIds[$modx->config['which_editor']][] = 'ta'; |
901 | 901 | $richtexteditorOptions[$modx->config['which_editor']]['ta'] = ''; |
902 | 902 | } else { |
903 | - echo "\t" . '<div><textarea class="phptextarea" id="ta" name="ta" rows="20" wrap="soft" onchange="documentDirty=true;">', $modx->htmlspecialchars($content['content']), '</textarea></div>' . "\n"; |
|
903 | + echo "\t".'<div><textarea class="phptextarea" id="ta" name="ta" rows="20" wrap="soft" onchange="documentDirty=true;">', $modx->htmlspecialchars($content['content']), '</textarea></div>'."\n"; |
|
904 | 904 | } ?> |
905 | 905 | </div> |
906 | 906 | </td> |
@@ -916,7 +916,7 @@ discard block |
||
916 | 916 | |
917 | 917 | if (($content['type'] == 'document' || $modx->manager->action == '4') || ($content['type'] == 'reference' || $modx->manager->action == 72)) { |
918 | 918 | $template = $default_template; |
919 | - $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int)$modx->config['group_tvs']; |
|
919 | + $group_tvs = empty($modx->config['group_tvs']) ? 0 : (int) $modx->config['group_tvs']; |
|
920 | 920 | if (isset($_REQUEST['newtemplate'])) { |
921 | 921 | $template = $_REQUEST['newtemplate']; |
922 | 922 | } else { |
@@ -944,17 +944,17 @@ discard block |
||
944 | 944 | ); |
945 | 945 | $sort = 'tvtpl.rank,tv.rank, tv.id'; |
946 | 946 | if ($group_tvs) { |
947 | - $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"' . $_lang['no_category'] . '") AS category, IFNULL(cat.rank,0) AS category_rank'; |
|
947 | + $field .= ', IFNULL(tv.category,0) as category_id, IFNULL(cat.category,"'.$_lang['no_category'].'") AS category, IFNULL(cat.rank,0) AS category_rank'; |
|
948 | 948 | $from .= ' |
949 | - LEFT JOIN ' . $tbl_categories . ' AS cat ON cat.id=tv.category'; |
|
950 | - $sort = 'cat.rank,cat.id,' . $sort; |
|
949 | + LEFT JOIN ' . $tbl_categories.' AS cat ON cat.id=tv.category'; |
|
950 | + $sort = 'cat.rank,cat.id,'.$sort; |
|
951 | 951 | } |
952 | 952 | $where = vsprintf("tvtpl.templateid='%s' AND (1='%s' OR ISNULL(tva.documentgroup) %s)", $vs); |
953 | 953 | $rs = $modx->db->select($field, $from, $where, $sort); |
954 | 954 | if ($modx->db->getRecordCount($rs)) { |
955 | 955 | $tvsArray = $modx->db->makeArray($rs, 'name'); |
956 | - require_once(MODX_MANAGER_PATH . 'includes/tmplvars.inc.php'); |
|
957 | - require_once(MODX_MANAGER_PATH . 'includes/tmplvars.commands.inc.php'); |
|
956 | + require_once(MODX_MANAGER_PATH.'includes/tmplvars.inc.php'); |
|
957 | + require_once(MODX_MANAGER_PATH.'includes/tmplvars.commands.inc.php'); |
|
958 | 958 | |
959 | 959 | $templateVariablesOutput = ''; |
960 | 960 | $templateVariablesGeneral = ''; |
@@ -968,8 +968,8 @@ discard block |
||
968 | 968 | if ($group_tvs == 1 || $group_tvs == 3) { |
969 | 969 | if ($i === 0) { |
970 | 970 | $templateVariablesOutput .= ' |
971 | - <div class="tab-section" id="tabTV_' . $row['category_id'] . '"> |
|
972 | - <div class="tab-header">' . $row['category'] . '</div> |
|
971 | + <div class="tab-section" id="tabTV_' . $row['category_id'].'"> |
|
972 | + <div class="tab-header">' . $row['category'].'</div> |
|
973 | 973 | <div class="tab-body tmplvars"> |
974 | 974 | <table>' . "\n"; |
975 | 975 | } else { |
@@ -978,17 +978,17 @@ discard block |
||
978 | 978 | </div> |
979 | 979 | </div> |
980 | 980 | |
981 | - <div class="tab-section" id="tabTV_' . $row['category_id'] . '"> |
|
982 | - <div class="tab-header">' . $row['category'] . '</div> |
|
981 | + <div class="tab-section" id="tabTV_' . $row['category_id'].'"> |
|
982 | + <div class="tab-header">' . $row['category'].'</div> |
|
983 | 983 | <div class="tab-body tmplvars"> |
984 | 984 | <table>'; |
985 | 985 | } |
986 | 986 | } elseif ($group_tvs == 2 || $group_tvs == 4) { |
987 | 987 | if ($i === 0) { |
988 | 988 | $templateVariablesOutput .= ' |
989 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
990 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
991 | - <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
989 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
990 | + <h2 class="tab">' . $row['category'].'</h2> |
|
991 | + <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
992 | 992 | |
993 | 993 | <div class="tab-body tmplvars"> |
994 | 994 | <table>'; |
@@ -998,9 +998,9 @@ discard block |
||
998 | 998 | </div> |
999 | 999 | </div> |
1000 | 1000 | |
1001 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
1002 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
1003 | - <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
1001 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
1002 | + <h2 class="tab">' . $row['category'].'</h2> |
|
1003 | + <script type="text/javascript">tpTemplateVariables.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
1004 | 1004 | |
1005 | 1005 | <div class="tab-body tmplvars"> |
1006 | 1006 | <table>'; |
@@ -1008,18 +1008,18 @@ discard block |
||
1008 | 1008 | } elseif ($group_tvs == 5) { |
1009 | 1009 | if ($i === 0) { |
1010 | 1010 | $templateVariablesOutput .= ' |
1011 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
1012 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
1013 | - <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
1011 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
1012 | + <h2 class="tab">' . $row['category'].'</h2> |
|
1013 | + <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
1014 | 1014 | <table>'; |
1015 | 1015 | } else { |
1016 | 1016 | $templateVariablesOutput .= ' |
1017 | 1017 | </table> |
1018 | 1018 | </div> |
1019 | 1019 | |
1020 | - <div id="tabTV_' . $row['category_id'] . '" class="tab-page tmplvars"> |
|
1021 | - <h2 class="tab">' . $row['category'] . '</h2> |
|
1022 | - <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'] . '\'));</script> |
|
1020 | + <div id="tabTV_' . $row['category_id'].'" class="tab-page tmplvars"> |
|
1021 | + <h2 class="tab">' . $row['category'].'</h2> |
|
1022 | + <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'tabTV_' . $row['category_id'].'\'));</script> |
|
1023 | 1023 | |
1024 | 1024 | <table>'; |
1025 | 1025 | } |
@@ -1039,8 +1039,8 @@ discard block |
||
1039 | 1039 | $editor = isset($tvOptions['editor']) ? $tvOptions['editor'] : $modx->config['which_editor']; |
1040 | 1040 | }; |
1041 | 1041 | // Add richtext editor to the list |
1042 | - $richtexteditorIds[$editor][] = "tv" . $row['id']; |
|
1043 | - $richtexteditorOptions[$editor]["tv" . $row['id']] = $tvOptions; |
|
1042 | + $richtexteditorIds[$editor][] = "tv".$row['id']; |
|
1043 | + $richtexteditorOptions[$editor]["tv".$row['id']] = $tvOptions; |
|
1044 | 1044 | } |
1045 | 1045 | |
1046 | 1046 | $templateVariablesTmp = ''; |
@@ -1057,24 +1057,24 @@ discard block |
||
1057 | 1057 | } |
1058 | 1058 | |
1059 | 1059 | // post back value |
1060 | - if (array_key_exists('tv' . $row['id'], $_POST)) { |
|
1061 | - if (is_array($_POST['tv' . $row['id']])) { |
|
1062 | - $tvPBV = implode('||', $_POST['tv' . $row['id']]); |
|
1060 | + if (array_key_exists('tv'.$row['id'], $_POST)) { |
|
1061 | + if (is_array($_POST['tv'.$row['id']])) { |
|
1062 | + $tvPBV = implode('||', $_POST['tv'.$row['id']]); |
|
1063 | 1063 | } else { |
1064 | - $tvPBV = $_POST['tv' . $row['id']]; |
|
1064 | + $tvPBV = $_POST['tv'.$row['id']]; |
|
1065 | 1065 | } |
1066 | 1066 | } else { |
1067 | 1067 | $tvPBV = $row['value']; |
1068 | 1068 | } |
1069 | 1069 | |
1070 | - $tvDescription = (!empty($row['description'])) ? '<br /><span class="comment">' . $row['description'] . '</span>' : ''; |
|
1071 | - $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '<br /><span class="comment inherited">(' . $_lang['tmplvars_inherited'] . ')</span>' : ''; |
|
1072 | - $tvName = $modx->hasPermission('edit_template') ? '<br/><small class="protectedNode">[*' . $row['name'] . '*]</small>' : ''; |
|
1070 | + $tvDescription = (!empty($row['description'])) ? '<br /><span class="comment">'.$row['description'].'</span>' : ''; |
|
1071 | + $tvInherited = (substr($tvPBV, 0, 8) == '@INHERIT') ? '<br /><span class="comment inherited">('.$_lang['tmplvars_inherited'].')</span>' : ''; |
|
1072 | + $tvName = $modx->hasPermission('edit_template') ? '<br/><small class="protectedNode">[*'.$row['name'].'*]</small>' : ''; |
|
1073 | 1073 | |
1074 | 1074 | $templateVariablesTmp .= ' |
1075 | 1075 | <tr> |
1076 | - <td><span class="warning">' . $row['caption'] . $tvName . '</span>' . $tvDescription . $tvInherited . '</td> |
|
1077 | - <td><div style="position:relative;' . ($row['type'] == 'date' ? '' : '') . '">' . renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray) . '</div></td> |
|
1076 | + <td><span class="warning">' . $row['caption'].$tvName.'</span>'.$tvDescription.$tvInherited.'</td> |
|
1077 | + <td><div style="position:relative;' . ($row['type'] == 'date' ? '' : '').'">'.renderFormElement($row['type'], $row['id'], $row['default_text'], $row['elements'], $tvPBV, '', $row, $tvsArray).'</div></td> |
|
1078 | 1078 | </tr>'; |
1079 | 1079 | |
1080 | 1080 | if ($group_tvs && $row['category_id'] == 0) { |
@@ -1088,38 +1088,38 @@ discard block |
||
1088 | 1088 | } |
1089 | 1089 | |
1090 | 1090 | if ($templateVariablesGeneral) { |
1091 | - echo '<table id="tabTV_0" class="tmplvars"><tbody>' . $templateVariablesGeneral . '</tbody></table>'; |
|
1091 | + echo '<table id="tabTV_0" class="tmplvars"><tbody>'.$templateVariablesGeneral.'</tbody></table>'; |
|
1092 | 1092 | } |
1093 | 1093 | |
1094 | 1094 | $templateVariables .= ' |
1095 | 1095 | <!-- Template Variables -->' . "\n"; |
1096 | 1096 | if (!$group_tvs) { |
1097 | 1097 | $templateVariables .= ' |
1098 | - <div class="sectionHeader" id="tv_header">' . $_lang['settings_templvars'] . '</div> |
|
1098 | + <div class="sectionHeader" id="tv_header">' . $_lang['settings_templvars'].'</div> |
|
1099 | 1099 | <div class="sectionBody tmplvars"> |
1100 | 1100 | <table>'; |
1101 | 1101 | } elseif ($group_tvs == 2) { |
1102 | 1102 | $templateVariables .= ' |
1103 | 1103 | <div class="tab-section"> |
1104 | - <div class="tab-header" id="tv_header">' . $_lang['settings_templvars'] . '</div> |
|
1104 | + <div class="tab-header" id="tv_header">' . $_lang['settings_templvars'].'</div> |
|
1105 | 1105 | <div class="tab-pane" id="paneTemplateVariables"> |
1106 | 1106 | <script type="text/javascript"> |
1107 | - tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
|
1107 | + tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').'); |
|
1108 | 1108 | </script>'; |
1109 | 1109 | } elseif ($group_tvs == 3) { |
1110 | 1110 | $templateVariables .= ' |
1111 | 1111 | <div id="templateVariables" class="tab-page tmplvars"> |
1112 | - <h2 class="tab">' . $_lang['settings_templvars'] . '</h2> |
|
1112 | + <h2 class="tab">' . $_lang['settings_templvars'].'</h2> |
|
1113 | 1113 | <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'templateVariables\'));</script>'; |
1114 | 1114 | } elseif ($group_tvs == 4) { |
1115 | 1115 | $templateVariables .= ' |
1116 | 1116 | <div id="templateVariables" class="tab-page tmplvars"> |
1117 | - <h2 class="tab">' . $_lang['settings_templvars'] . '</h2> |
|
1117 | + <h2 class="tab">' . $_lang['settings_templvars'].'</h2> |
|
1118 | 1118 | <script type="text/javascript">tpSettings.addTabPage(document.getElementById(\'templateVariables\'));</script> |
1119 | 1119 | |
1120 | 1120 | <div class="tab-pane" id="paneTemplateVariables"> |
1121 | 1121 | <script type="text/javascript"> |
1122 | - tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false') . '); |
|
1122 | + tpTemplateVariables = new WebFXTabPane(document.getElementById(\'paneTemplateVariables\'), ' . ($modx->config['remember_last_tab'] == 1 ? 'true' : 'false').'); |
|
1123 | 1123 | </script>'; |
1124 | 1124 | } |
1125 | 1125 | $templateVariables .= $templateVariablesOutput; |
@@ -1239,7 +1239,7 @@ discard block |
||
1239 | 1239 | $custom_contenttype = (isset($custom_contenttype) ? $custom_contenttype : "text/html,text/plain,text/xml"); |
1240 | 1240 | $ct = explode(",", $custom_contenttype); |
1241 | 1241 | for ($i = 0; $i < count($ct); $i++) { |
1242 | - echo "\t\t\t\t\t" . '<option value="' . $ct[$i] . '"' . ($content['contentType'] == $ct[$i] ? ' selected="selected"' : '') . '>' . $ct[$i] . "</option>\n"; |
|
1242 | + echo "\t\t\t\t\t".'<option value="'.$ct[$i].'"'.($content['contentType'] == $ct[$i] ? ' selected="selected"' : '').'>'.$ct[$i]."</option>\n"; |
|
1243 | 1243 | } ?> |
1244 | 1244 | </select> |
1245 | 1245 | </td> |
@@ -1374,7 +1374,7 @@ discard block |
||
1374 | 1374 | // Load up, the permissions from the parent (if new document) or existing document |
1375 | 1375 | $rs = $modx->db->select('id, document_group', $tbl_document_groups, "document='{$documentId}'"); |
1376 | 1376 | while ($currentgroup = $modx->db->getRow($rs)) { |
1377 | - $groupsarray[] = $currentgroup['document_group'] . ',' . $currentgroup['id']; |
|
1377 | + $groupsarray[] = $currentgroup['document_group'].','.$currentgroup['id']; |
|
1378 | 1378 | } |
1379 | 1379 | |
1380 | 1380 | // Load up the current permissions and names |
@@ -1413,8 +1413,8 @@ discard block |
||
1413 | 1413 | while ($row = $modx->db->getRow($rs)) { |
1414 | 1414 | |
1415 | 1415 | // Create an inputValue pair (group ID and group link (if it exists)) |
1416 | - $inputValue = $row['id'] . ',' . ($row['link_id'] ? $row['link_id'] : 'new'); |
|
1417 | - $inputId = 'group-' . $row['id']; |
|
1416 | + $inputValue = $row['id'].','.($row['link_id'] ? $row['link_id'] : 'new'); |
|
1417 | + $inputId = 'group-'.$row['id']; |
|
1418 | 1418 | |
1419 | 1419 | $checked = in_array($inputValue, $groupsarray); |
1420 | 1420 | if ($checked) { |
@@ -1438,11 +1438,11 @@ discard block |
||
1438 | 1438 | // Create attribute string list |
1439 | 1439 | $inputString = array(); |
1440 | 1440 | foreach ($inputAttributes as $k => $v) { |
1441 | - $inputString[] = $k . '="' . $v . '"'; |
|
1441 | + $inputString[] = $k.'="'.$v.'"'; |
|
1442 | 1442 | } |
1443 | 1443 | |
1444 | 1444 | // Make the <input> HTML |
1445 | - $inputHTML = '<input ' . implode(' ', $inputString) . ' />'; |
|
1445 | + $inputHTML = '<input '.implode(' ', $inputString).' />'; |
|
1446 | 1446 | |
1447 | 1447 | // does user have this permission? |
1448 | 1448 | $from = "{$tbl_membergroup_access} AS mga, {$tbl_member_groups} AS mg"; |
@@ -1458,7 +1458,7 @@ discard block |
||
1458 | 1458 | } else { |
1459 | 1459 | ++$permissions_no; |
1460 | 1460 | } |
1461 | - $permissions[] = "\t\t" . '<li>' . $inputHTML . '<label for="' . $inputId . '">' . $row['name'] . '</label></li>'; |
|
1461 | + $permissions[] = "\t\t".'<li>'.$inputHTML.'<label for="'.$inputId.'">'.$row['name'].'</label></li>'; |
|
1462 | 1462 | } |
1463 | 1463 | // if mgr user doesn't have access to any of the displayable permissions, forget about them and make doc public |
1464 | 1464 | if ($_SESSION['mgrRole'] != 1 && ($permissions_yes == 0 && $permissions_no > 0)) { |
@@ -1469,7 +1469,7 @@ discard block |
||
1469 | 1469 | if (!empty($permissions)) { |
1470 | 1470 | // Add the "All Document Groups" item if we have rights in both contexts |
1471 | 1471 | if ($isManager && $isWeb) { |
1472 | - array_unshift($permissions, "\t\t" . '<li><input type="checkbox" class="checkbox" name="chkalldocs" id="groupall"' . (!$notPublic ? ' checked="checked"' : '') . ' onclick="makePublic(true);" /><label for="groupall" class="warning">' . $_lang['all_doc_groups'] . '</label></li>'); |
|
1472 | + array_unshift($permissions, "\t\t".'<li><input type="checkbox" class="checkbox" name="chkalldocs" id="groupall"'.(!$notPublic ? ' checked="checked"' : '').' onclick="makePublic(true);" /><label for="groupall" class="warning">'.$_lang['all_doc_groups'].'</label></li>'); |
|
1473 | 1473 | } |
1474 | 1474 | // Output the permissions list... |
1475 | 1475 | ?> |
@@ -1502,7 +1502,7 @@ discard block |
||
1502 | 1502 | </script> |
1503 | 1503 | <p><?= $_lang['access_permissions_docs_message'] ?></p> |
1504 | 1504 | <ul> |
1505 | - <?= implode("\n", $permissions) . "\n" ?> |
|
1505 | + <?= implode("\n", $permissions)."\n" ?> |
|
1506 | 1506 | </ul> |
1507 | 1507 | </div><!--div class="tab-page" id="tabAccess"--> |
1508 | 1508 | <?php |
@@ -478,7 +478,8 @@ discard block |
||
478 | 478 | return s; |
479 | 479 | } |
480 | 480 | |
481 | - <?php if ($content['type'] == 'reference' || $modx->manager->action == '72') { // Web Link specific?> |
|
481 | + <?php if ($content['type'] == 'reference' || $modx->manager->action == '72') { |
|
482 | +// Web Link specific?> |
|
482 | 483 | var lastImageCtrl; |
483 | 484 | var lastFileCtrl; |
484 | 485 | |
@@ -695,7 +696,8 @@ discard block |
||
695 | 696 | </td> |
696 | 697 | </tr> |
697 | 698 | |
698 | - <?php if ($content['type'] == 'reference' || $modx->manager->action == '72') { // Web Link specific?> |
|
699 | + <?php if ($content['type'] == 'reference' || $modx->manager->action == '72') { |
|
700 | +// Web Link specific?> |
|
699 | 701 | |
700 | 702 | <tr> |
701 | 703 | <td><span class="warning"><?= $_lang['weblink'] ?></span> |
@@ -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('view_eventlog')) { |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | <div class="form-group" id="lyr1"> |
18 | 18 | <b><?= $_lang["publish_events"] ?></b> |
19 | 19 | <?php |
20 | - $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); |
|
20 | + $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > ".time()."", 'pub_date ASC'); |
|
21 | 21 | $limit = $modx->db->getRecordCount($rs); |
22 | 22 | if ($limit < 1) { |
23 | 23 | ?> |
@@ -55,7 +55,7 @@ discard block |
||
55 | 55 | <div class="form-group" id="lyr2"> |
56 | 56 | <b><?= $_lang["unpublish_events"] ?></b> |
57 | 57 | <?php |
58 | - $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); |
|
58 | + $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > ".time()."", 'unpub_date ASC'); |
|
59 | 59 | $limit = $modx->db->getRecordCount($rs); |
60 | 60 | if ($limit < 1) { |
61 | 61 | ?> |
@@ -1,8 +1,8 @@ discard block |
||
1 | 1 | <?php |
2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | -if (!$modx->hasPermission('view_eventlog')) { |
|
5 | +if (!$modx->hasPermission('view_eventlog')) { |
|
6 | 6 | $modx->webAlertAndQuit($_lang["error_no_privileges"]); |
7 | 7 | } |
8 | 8 | ?> |
@@ -19,11 +19,11 @@ discard block |
||
19 | 19 | <?php |
20 | 20 | $rs = $modx->db->select('id, pagetitle, pub_date', $modx->getFullTableName('site_content'), "pub_date > " . time() . "", 'pub_date ASC'); |
21 | 21 | $limit = $modx->db->getRecordCount($rs); |
22 | - if ($limit < 1) { |
|
22 | + if ($limit < 1) { |
|
23 | 23 | ?> |
24 | 24 | <p><?= $_lang["no_docs_pending_publishing"] ?></p> |
25 | 25 | <?php |
26 | - } else { |
|
26 | + } else { |
|
27 | 27 | ?> |
28 | 28 | <div class="table-responsive"> |
29 | 29 | <table class="grid sortabletable" id="table-1"> |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | </thead> |
37 | 37 | <tbody> |
38 | 38 | <?php |
39 | - while ($row = $modx->db->getRow($rs)) { |
|
39 | + while ($row = $modx->db->getRow($rs)) { |
|
40 | 40 | ?> |
41 | 41 | <tr> |
42 | 42 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -57,11 +57,11 @@ discard block |
||
57 | 57 | <?php |
58 | 58 | $rs = $modx->db->select('id, pagetitle, unpub_date', $modx->getFullTableName('site_content'), "unpub_date > " . time() . "", 'unpub_date ASC'); |
59 | 59 | $limit = $modx->db->getRecordCount($rs); |
60 | - if ($limit < 1) { |
|
60 | + if ($limit < 1) { |
|
61 | 61 | ?> |
62 | 62 | <p><?= $_lang["no_docs_pending_unpublishing"] ?></p> |
63 | 63 | <?php |
64 | - } else { |
|
64 | + } else { |
|
65 | 65 | ?> |
66 | 66 | <div class="table-responsive"> |
67 | 67 | <table class="grid sortabletable" id="table-2"> |
@@ -74,7 +74,7 @@ discard block |
||
74 | 74 | </thead> |
75 | 75 | <tbody> |
76 | 76 | <?php |
77 | - while ($row = $modx->db->getRow($rs)) { |
|
77 | + while ($row = $modx->db->getRow($rs)) { |
|
78 | 78 | ?> |
79 | 79 | <tr> |
80 | 80 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -95,11 +95,11 @@ discard block |
||
95 | 95 | <?php |
96 | 96 | $rs = $modx->db->select('id, pagetitle, pub_date, unpub_date', $modx->getFullTableName('site_content'), "pub_date > 0 OR unpub_date > 0", "pub_date DESC"); |
97 | 97 | $limit = $modx->db->getRecordCount($rs); |
98 | - if ($limit < 1) { |
|
98 | + if ($limit < 1) { |
|
99 | 99 | ?> |
100 | 100 | <p><?= $_lang["no_docs_pending_pubunpub"] ?></p> |
101 | 101 | <?php |
102 | - } else { |
|
102 | + } else { |
|
103 | 103 | ?> |
104 | 104 | <div class="table-responsive"> |
105 | 105 | <table class="grid sortabletable" id="table-3"> |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | </thead> |
114 | 114 | <tbody> |
115 | 115 | <?php |
116 | - while ($row = $modx->db->getRow($rs)) { |
|
116 | + while ($row = $modx->db->getRow($rs)) { |
|
117 | 117 | ?> |
118 | 118 | <tr> |
119 | 119 | <td class="text-right"><?= $row['id'] ?></td> |
@@ -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 | |
@@ -17,15 +17,15 @@ discard block |
||
17 | 17 | |
18 | 18 | // setup message info |
19 | 19 | if ($modx->hasPermission('messages')) { |
20 | - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
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); |
@@ -80,7 +80,7 @@ discard block |
||
80 | 80 | |
81 | 81 | // do some config checks |
82 | 82 | if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
83 | - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
83 | + include_once(MODX_MANAGER_PATH.'includes/config_check.inc.php'); |
|
84 | 84 | if ($config_check_results != $_lang['configcheck_ok']) { |
85 | 85 | $ph['config_check_results'] = $config_check_results; |
86 | 86 | $ph['config_display'] = 'block'; |
@@ -147,7 +147,7 @@ discard block |
||
147 | 147 | </tr> |
148 | 148 | </table>'; |
149 | 149 | |
150 | -$nrnewmessages = '<span class="text-danger">' . $_SESSION['nrnewmessages'] . '</span>'; |
|
150 | +$nrnewmessages = '<span class="text-danger">'.$_SESSION['nrnewmessages'].'</span>'; |
|
151 | 151 | |
152 | 152 | $ph['UserInfo'] = $modx->parseText($tpl, array( |
153 | 153 | 'username' => $modx->getLoginUserName(), |
@@ -165,7 +165,7 @@ discard block |
||
165 | 165 | if ($modx->db->getRecordCount($rs) < 1) { |
166 | 166 | $html = '<p>[%no_active_users_found%]</p>'; |
167 | 167 | } else { |
168 | - include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
|
168 | + include_once(MODX_MANAGER_PATH.'includes/actionlist.inc.php'); |
|
169 | 169 | $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
170 | 170 | $ph['now'] = strftime('%H:%M:%S', $now); |
171 | 171 | $timetocheck = ($now - (60 * 20)); //+$server_offset_time; |
@@ -210,7 +210,7 @@ discard block |
||
210 | 210 | } |
211 | 211 | foreach ($userList as $params) { |
212 | 212 | $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
213 | - $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); |
|
213 | + $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 | 214 | } |
215 | 215 | |
216 | 216 | $html .= ' |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | $ph['OnlineInfo'] = $html; |
223 | 223 | |
224 | 224 | // include rss feeds for important forum topics |
225 | -include_once(MODX_MANAGER_PATH . 'includes/rss.inc.php'); |
|
225 | +include_once(MODX_MANAGER_PATH.'includes/rss.inc.php'); |
|
226 | 226 | $ph['modx_security_notices_content'] = $feedData['modx_security_notices_content']; |
227 | 227 | $ph['modx_news_content'] = $feedData['modx_news_content']; |
228 | 228 | |
@@ -391,7 +391,7 @@ discard block |
||
391 | 391 | $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; |
392 | 392 | } |
393 | 393 | |
394 | -usort($widgets, function ($a, $b) { |
|
394 | +usort($widgets, function($a, $b){ |
|
395 | 395 | return $a['menuindex'] - $b['menuindex']; |
396 | 396 | }); |
397 | 397 | |
@@ -406,7 +406,7 @@ discard block |
||
406 | 406 | |
407 | 407 | // load template |
408 | 408 | if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
409 | - $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
|
409 | + $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH.'media/style/common/welcome.tpl'; |
|
410 | 410 | } |
411 | 411 | |
412 | 412 | $target = $modx->config['manager_welcome_tpl']; |
@@ -425,15 +425,15 @@ discard block |
||
425 | 425 | $chunk = $modx->getChunk($target); |
426 | 426 | if ($chunk !== false && !empty($chunk)) { |
427 | 427 | $content = $chunk; |
428 | - } elseif (is_file(MODX_BASE_PATH . $target)) { |
|
429 | - $content = file_get_contents(MODX_BASE_PATH . $target); |
|
430 | - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
431 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
|
432 | - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) { // ClipperCMS compatible |
|
428 | + } elseif (is_file(MODX_BASE_PATH.$target)) { |
|
429 | + $content = file_get_contents(MODX_BASE_PATH.$target); |
|
430 | + } elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl')) { |
|
431 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/welcome.tpl'); |
|
432 | + } elseif (is_file(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html')) { // ClipperCMS compatible |
|
433 | 433 | |
434 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
|
434 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/'.$modx->config['manager_theme'].'/html/welcome.html'); |
|
435 | 435 | } else { |
436 | - $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
|
436 | + $content = file_get_contents(MODX_MANAGER_PATH.'media/style/common/welcome.tpl'); |
|
437 | 437 | } |
438 | 438 | } |
439 | 439 |
@@ -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; |
@@ -32,46 +32,46 @@ discard block |
||
32 | 32 | } |
33 | 33 | |
34 | 34 | // setup icons |
35 | -if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
|
35 | +if ($modx->hasPermission('new_user') || $modx->hasPermission('edit_user')) { |
|
36 | 36 | $icon = '<i class="[&icons_security_large&]" alt="[%user_management_title%]"> </i>[%user_management_title%]'; |
37 | 37 | $ph['SecurityIcon'] = wrapIcon($icon, 75); |
38 | 38 | } |
39 | -if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
|
39 | +if ($modx->hasPermission('new_web_user') || $modx->hasPermission('edit_web_user')) { |
|
40 | 40 | $icon = '<i class="[&icons_webusers_large&]" alt="[%web_user_management_title%]"> </i>[%web_user_management_title%]'; |
41 | 41 | $ph['WebUserIcon'] = wrapIcon($icon, 99); |
42 | 42 | } |
43 | -if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
|
43 | +if ($modx->hasPermission('new_module') || $modx->hasPermission('edit_module')) { |
|
44 | 44 | $icon = '<i class="[&icons_modules_large&]" alt="[%manage_modules%]"> </i>[%modules%]'; |
45 | 45 | $ph['ModulesIcon'] = wrapIcon($icon, 106); |
46 | 46 | } |
47 | -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')) { |
|
47 | +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 | 48 | $icon = '<i class="[&icons_resources_large&]" alt="[%element_management%]"> </i>[%elements%]'; |
49 | 49 | $ph['ResourcesIcon'] = wrapIcon($icon, 76); |
50 | 50 | } |
51 | -if ($modx->hasPermission('bk_manager')) { |
|
51 | +if ($modx->hasPermission('bk_manager')) { |
|
52 | 52 | $icon = '<i class="[&icons_backup_large&]" alt="[%bk_manager%]"> </i>[%backup%]'; |
53 | 53 | $ph['BackupIcon'] = wrapIcon($icon, 93); |
54 | 54 | } |
55 | -if ($modx->hasPermission('help')) { |
|
55 | +if ($modx->hasPermission('help')) { |
|
56 | 56 | $icon = '<i class="[&icons_help_large&]" alt="[%help%]" /> </i>[%help%]'; |
57 | 57 | $ph['HelpIcon'] = wrapIcon($icon, 9); |
58 | 58 | } |
59 | 59 | |
60 | -if ($modx->hasPermission('new_document')) { |
|
60 | +if ($modx->hasPermission('new_document')) { |
|
61 | 61 | $icon = '<i class="[&icons_resource_large&]"></i>[%add_resource%]'; |
62 | 62 | $ph['ResourceIcon'] = wrapIcon($icon, 4); |
63 | 63 | $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
64 | 64 | $ph['WeblinkIcon'] = wrapIcon($icon, 72); |
65 | 65 | } |
66 | -if ($modx->hasPermission('assets_images')) { |
|
66 | +if ($modx->hasPermission('assets_images')) { |
|
67 | 67 | $icon = '<i class="[&icons_images_large&]"></i>[%images_management%]'; |
68 | 68 | $ph['ImagesIcon'] = wrapIcon($icon, 72); |
69 | 69 | } |
70 | -if ($modx->hasPermission('assets_files')) { |
|
70 | +if ($modx->hasPermission('assets_files')) { |
|
71 | 71 | $icon = '<i class="[&icons_files_large&]"></i>[%files_management%]'; |
72 | 72 | $ph['FilesIcon'] = wrapIcon($icon, 72); |
73 | 73 | } |
74 | -if ($modx->hasPermission('change_password')) { |
|
74 | +if ($modx->hasPermission('change_password')) { |
|
75 | 75 | $icon = '<i class="[&icons_password_large&]"></i>[%change_password%]'; |
76 | 76 | $ph['PasswordIcon'] = wrapIcon($icon, 28); |
77 | 77 | } |
@@ -79,21 +79,21 @@ discard block |
||
79 | 79 | $ph['LogoutIcon'] = wrapIcon($icon, 8); |
80 | 80 | |
81 | 81 | // do some config checks |
82 | -if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
|
82 | +if (($modx->config['warning_visibility'] == 0 && $_SESSION['mgrRole'] == 1) || $modx->config['warning_visibility'] == 1) { |
|
83 | 83 | include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
84 | - if ($config_check_results != $_lang['configcheck_ok']) { |
|
84 | + if ($config_check_results != $_lang['configcheck_ok']) { |
|
85 | 85 | $ph['config_check_results'] = $config_check_results; |
86 | 86 | $ph['config_display'] = 'block'; |
87 | - } else { |
|
87 | + } else { |
|
88 | 88 | $ph['config_display'] = 'none'; |
89 | 89 | } |
90 | -} else { |
|
90 | +} else { |
|
91 | 91 | $ph['config_display'] = 'none'; |
92 | 92 | } |
93 | 93 | |
94 | 94 | // Check logout-reminder |
95 | -if (isset($_SESSION['show_logout_reminder'])) { |
|
96 | - switch ($_SESSION['show_logout_reminder']['type']) { |
|
95 | +if (isset($_SESSION['show_logout_reminder'])) { |
|
96 | + switch ($_SESSION['show_logout_reminder']['type']) { |
|
97 | 97 | case 'logout_reminder': |
98 | 98 | $date = $modx->toDateFormat($_SESSION['show_logout_reminder']['lastHit'], 'dateOnly'); |
99 | 99 | $ph['logout_reminder_msg'] = str_replace('[+date+]', $date, $_lang['logout_reminder_msg']); |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | $ph['show_logout_reminder'] = 'block'; |
103 | 103 | unset($_SESSION['show_logout_reminder']); |
104 | -} else { |
|
104 | +} else { |
|
105 | 105 | $ph['show_logout_reminder'] = 'none'; |
106 | 106 | } |
107 | 107 | |
@@ -162,9 +162,9 @@ discard block |
||
162 | 162 | $from[] = " us LEFT JOIN [+prefix+]active_users au ON au.sid=us.sid WHERE au.action <> '8'"; |
163 | 163 | $rs = $modx->db->select('*', $from, '', 'username ASC, au.sid ASC'); |
164 | 164 | |
165 | -if ($modx->db->getRecordCount($rs) < 1) { |
|
165 | +if ($modx->db->getRecordCount($rs) < 1) { |
|
166 | 166 | $html = '<p>[%no_active_users_found%]</p>'; |
167 | -} else { |
|
167 | +} else { |
|
168 | 168 | include_once(MODX_MANAGER_PATH . 'includes/actionlist.inc.php'); |
169 | 169 | $now = $_SERVER['REQUEST_TIME'] + $server_offset_time; |
170 | 170 | $ph['now'] = strftime('%H:%M:%S', $now); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $userList = array(); |
191 | 191 | $userCount = array(); |
192 | 192 | // Create userlist with session-count first before output |
193 | - while ($activeusers = $modx->db->getRow($rs)) { |
|
193 | + while ($activeusers = $modx->db->getRow($rs)) { |
|
194 | 194 | $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
195 | 195 | |
196 | 196 | $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | $currentaction |
209 | 209 | ); |
210 | 210 | } |
211 | - foreach ($userList as $params) { |
|
211 | + foreach ($userList as $params) { |
|
212 | 212 | $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
213 | 213 | $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 | 214 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | |
254 | 254 | // invoke event OnManagerWelcomePrerender |
255 | 255 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); |
256 | -if (is_array($evtOut)) { |
|
256 | +if (is_array($evtOut)) { |
|
257 | 257 | $output = implode('', $evtOut); |
258 | 258 | $ph['OnManagerWelcomePrerender'] = $output; |
259 | 259 | } |
@@ -358,7 +358,7 @@ discard block |
||
358 | 358 | 'body' => '<div class="widget-stage">[+RecentInfo+]</div>', |
359 | 359 | 'hide'=>'0' |
360 | 360 | ); |
361 | -if ($modx->config['rss_url_news']) { |
|
361 | +if ($modx->config['rss_url_news']) { |
|
362 | 362 | $widgets['news'] = array( |
363 | 363 | 'menuindex' => '40', |
364 | 364 | 'id' => 'news', |
@@ -369,7 +369,7 @@ discard block |
||
369 | 369 | 'hide'=>'0' |
370 | 370 | ); |
371 | 371 | } |
372 | -if ($modx->config['rss_url_security']) { |
|
372 | +if ($modx->config['rss_url_security']) { |
|
373 | 373 | $widgets['security'] = array( |
374 | 374 | 'menuindex' => '50', |
375 | 375 | 'id' => 'security', |
@@ -383,29 +383,29 @@ discard block |
||
383 | 383 | |
384 | 384 | // invoke OnManagerWelcomeHome event |
385 | 385 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); |
386 | -if (is_array($sitewidgets)) { |
|
386 | +if (is_array($sitewidgets)) { |
|
387 | 387 | $newwidgets = array(); |
388 | - foreach ($sitewidgets as $widget) { |
|
388 | + foreach ($sitewidgets as $widget) { |
|
389 | 389 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
390 | 390 | } |
391 | 391 | $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; |
392 | 392 | } |
393 | 393 | |
394 | -usort($widgets, function ($a, $b) { |
|
394 | +usort($widgets, function ($a, $b){ |
|
395 | 395 | return $a['menuindex'] - $b['menuindex']; |
396 | 396 | }); |
397 | 397 | |
398 | 398 | $tpl = getTplWidget(); |
399 | 399 | $output = ''; |
400 | -foreach ($widgets as $widget) { |
|
401 | - if ($widget['hide'] != '1') { |
|
400 | +foreach ($widgets as $widget) { |
|
401 | + if ($widget['hide'] != '1') { |
|
402 | 402 | $output .= $modx->parseText($tpl, $widget); |
403 | 403 | } |
404 | 404 | } |
405 | 405 | $ph['widgets'] = $output; |
406 | 406 | |
407 | 407 | // load template |
408 | -if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
|
408 | +if (!isset($modx->config['manager_welcome_tpl']) || empty($modx->config['manager_welcome_tpl'])) { |
|
409 | 409 | $modx->config['manager_welcome_tpl'] = MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'; |
410 | 410 | } |
411 | 411 | |
@@ -413,26 +413,27 @@ discard block |
||
413 | 413 | $target = str_replace('[+base_path+]', MODX_BASE_PATH, $target); |
414 | 414 | $target = $modx->mergeSettingsContent($target); |
415 | 415 | |
416 | -if (substr($target, 0, 1) === '@') { |
|
417 | - if (substr($target, 0, 6) === '@CHUNK') { |
|
416 | +if (substr($target, 0, 1) === '@') { |
|
417 | + if (substr($target, 0, 6) === '@CHUNK') { |
|
418 | 418 | $content = $modx->getChunk(trim(substr($target, 7))); |
419 | - } elseif (substr($target, 0, 5) === '@FILE') { |
|
419 | + } elseif (substr($target, 0, 5) === '@FILE') { |
|
420 | 420 | $content = file_get_contents(trim(substr($target, 6))); |
421 | - } else { |
|
421 | + } else { |
|
422 | 422 | $content = ''; |
423 | 423 | } |
424 | -} else { |
|
424 | +} else { |
|
425 | 425 | $chunk = $modx->getChunk($target); |
426 | - if ($chunk !== false && !empty($chunk)) { |
|
426 | + if ($chunk !== false && !empty($chunk)) { |
|
427 | 427 | $content = $chunk; |
428 | - } elseif (is_file(MODX_BASE_PATH . $target)) { |
|
428 | + } elseif (is_file(MODX_BASE_PATH . $target)) { |
|
429 | 429 | $content = file_get_contents(MODX_BASE_PATH . $target); |
430 | - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
430 | + } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl')) { |
|
431 | 431 | $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/welcome.tpl'); |
432 | - } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) { // ClipperCMS compatible |
|
432 | + } elseif (is_file(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html')) { |
|
433 | +// ClipperCMS compatible |
|
433 | 434 | |
434 | 435 | $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/' . $modx->config['manager_theme'] . '/html/welcome.html'); |
435 | - } else { |
|
436 | + } else { |
|
436 | 437 | $content = file_get_contents(MODX_MANAGER_PATH . 'media/style/common/welcome.tpl'); |
437 | 438 | } |
438 | 439 | } |
@@ -441,7 +442,7 @@ discard block |
||
441 | 442 | $content = $modx->mergeConditionalTagsContent($content); |
442 | 443 | $content = $modx->mergeSettingsContent($content); |
443 | 444 | $content = $modx->parseText($content, $ph); |
444 | -if (strpos($content, '[+') !== false) { |
|
445 | +if (strpos($content, '[+') !== false) { |
|
445 | 446 | $modx->toPlaceholders($ph); |
446 | 447 | $content = $modx->mergePlaceholderContent($content); |
447 | 448 | } |
@@ -450,7 +451,7 @@ discard block |
||
450 | 451 | $content = $modx->parseText($content, $_style, '[&', '&]'); |
451 | 452 | $content = $modx->cleanUpMODXTags($content); //cleanup |
452 | 453 | |
453 | -if ($js = $modx->getRegisteredClientScripts()) { |
|
454 | +if ($js = $modx->getRegisteredClientScripts()) { |
|
454 | 455 | $content .= $js; |
455 | 456 | } |
456 | 457 | |
@@ -460,8 +461,9 @@ discard block |
||
460 | 461 | // <a href="javascript:;" class="setting"><i class="fa fa-cog"></i></a> |
461 | 462 | // <a href="javascript:;" class="closed"><i class="fa fa-close"></i></a> |
462 | 463 | //</span> |
463 | -function getTplWidget() |
|
464 | -{ // recent document info |
|
464 | +function getTplWidget() |
|
465 | +{ |
|
466 | +// recent document info |
|
465 | 467 | return ' |
466 | 468 | <div class="[+cols+]" id="[+id+]"> |
467 | 469 | <div class="card"[+cardAttr+]> |
@@ -472,8 +474,9 @@ discard block |
||
472 | 474 | '; |
473 | 475 | } |
474 | 476 | |
475 | -function getRecentInfo() |
|
476 | -{ // recent document info |
|
477 | +function getRecentInfo() |
|
478 | +{ |
|
479 | +// recent document info |
|
477 | 480 | $modx = evolutionCMS(); |
478 | 481 | |
479 | 482 | $modx->addSnippet('recentInfoList', 'getRecentInfoList'); |
@@ -499,13 +502,13 @@ discard block |
||
499 | 502 | return $html; |
500 | 503 | } |
501 | 504 | |
502 | -function getRecentInfoList() |
|
503 | -{ |
|
505 | +function getRecentInfoList() |
|
506 | +{ |
|
504 | 507 | $modx = evolutionCMS(); |
505 | 508 | |
506 | 509 | $rs = $modx->db->select('*', '[+prefix+]site_content', '', 'editedon DESC', 10); |
507 | 510 | |
508 | - if ($modx->db->getRecordCount($rs) < 1) { |
|
511 | + if ($modx->db->getRecordCount($rs) < 1) { |
|
509 | 512 | return '<tr><td>[%no_activity_message%]</td></tr>'; |
510 | 513 | } |
511 | 514 | |
@@ -515,22 +518,22 @@ discard block |
||
515 | 518 | $btntpl['preview_btn'] = '<a [+preview_disabled+]" title="[%preview_resource%]" target="_blank" href="../index.php?&id=[+id+]"><i class="fa fa-eye fa-fw"></i></a> '; |
516 | 519 | |
517 | 520 | $output = array(); |
518 | - while ($ph = $modx->db->getRow($rs)) { |
|
521 | + while ($ph = $modx->db->getRow($rs)) { |
|
519 | 522 | $docid = $ph['id']; |
520 | 523 | $_ = $modx->getUserInfo($ph['editedby']); |
521 | 524 | $ph['username'] = $_['username']; |
522 | 525 | |
523 | - if ($ph['deleted'] == 1) { |
|
526 | + if ($ph['deleted'] == 1) { |
|
524 | 527 | $ph['status'] = 'deleted text-danger'; |
525 | - } elseif ($ph['published'] == 0) { |
|
528 | + } elseif ($ph['published'] == 0) { |
|
526 | 529 | $ph['status'] = 'unpublished font-italic text-muted'; |
527 | - } else { |
|
530 | + } else { |
|
528 | 531 | $ph['status'] = 'published'; |
529 | 532 | } |
530 | 533 | |
531 | - if ($modx->hasPermission('edit_document')) { |
|
534 | + if ($modx->hasPermission('edit_document')) { |
|
532 | 535 | $ph['edit_btn'] = str_replace('[+id+]', $docid, $btntpl['edit']); |
533 | - } else { |
|
536 | + } else { |
|
534 | 537 | $ph['edit_btn'] = ''; |
535 | 538 | } |
536 | 539 | |
@@ -543,40 +546,40 @@ discard block |
||
543 | 546 | $preview_disabled |
544 | 547 | ), $btntpl['preview_btn']); |
545 | 548 | |
546 | - if ($modx->hasPermission('delete_document')) { |
|
547 | - if ($ph['deleted'] == 0) { |
|
549 | + if ($modx->hasPermission('delete_document')) { |
|
550 | + if ($ph['deleted'] == 0) { |
|
548 | 551 | $delete_btn = '<a onclick="return confirm(\'[%confirm_delete_record%]\')" title="[%delete_resource%]" href="index.php?a=6&id=[+id+]" target="main"><i class="fa fa-trash fa-fw"></i></a> '; |
549 | - } else { |
|
552 | + } else { |
|
550 | 553 | $delete_btn = '<a onclick="return confirm(\'[%confirm_undelete%]\')" title="[%undelete_resource%]" href="index.php?a=63&id=[+id+]" target="main"><i class="fa fa-arrow-circle-o-up fa-fw"></i></a> '; |
551 | 554 | } |
552 | 555 | $ph['delete_btn'] = str_replace('[+id+]', $docid, $delete_btn); |
553 | - } else { |
|
556 | + } else { |
|
554 | 557 | $ph['delete_btn'] = ''; |
555 | 558 | } |
556 | 559 | |
557 | - if ($ph['deleted'] == 1 && $ph['published'] == 0) { |
|
560 | + if ($ph['deleted'] == 1 && $ph['published'] == 0) { |
|
558 | 561 | $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> '; |
559 | - } elseif ($ph['deleted'] == 1 && $ph['published'] == 1) { |
|
562 | + } elseif ($ph['deleted'] == 1 && $ph['published'] == 1) { |
|
560 | 563 | $publish_btn = '<a class="disabled" title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> '; |
561 | - } elseif ($ph['deleted'] == 0 && $ph['published'] == 0) { |
|
564 | + } elseif ($ph['deleted'] == 0 && $ph['published'] == 0) { |
|
562 | 565 | $publish_btn = '<a title="[%publish_resource%]" href="index.php?a=61&id=[+id+]" target="main"><i class="fa fa-arrow-up fa-fw"></i></a> '; |
563 | - } else { |
|
566 | + } else { |
|
564 | 567 | $publish_btn = '<a title="[%unpublish_resource%]" href="index.php?a=62&id=[+id+]" target="main"><i class="fa fa-arrow-down fa-fw"></i></a> '; |
565 | 568 | } |
566 | 569 | $ph['publish_btn'] = str_replace('[+id+]', $docid, $publish_btn); |
567 | 570 | |
568 | 571 | $ph['info_btn'] = str_replace('[+id+]', $docid, '<a title="[%resource_overview%]" data-toggle="collapse" data-target=".collapse[+id+]"><i class="fa fa-info fa-fw"></i></a>'); |
569 | 572 | |
570 | - if ($ph['longtitle'] == '') { |
|
573 | + if ($ph['longtitle'] == '') { |
|
571 | 574 | $ph['longtitle'] = '(<i>[%not_set%]</i>)'; |
572 | 575 | } |
573 | - if ($ph['description'] == '') { |
|
576 | + if ($ph['description'] == '') { |
|
574 | 577 | $ph['description'] = '(<i>[%not_set%]</i>)'; |
575 | 578 | } |
576 | - if ($ph['introtext'] == '') { |
|
579 | + if ($ph['introtext'] == '') { |
|
577 | 580 | $ph['introtext'] = '(<i>[%not_set%]</i>)'; |
578 | 581 | } |
579 | - if ($ph['alias'] == '') { |
|
582 | + if ($ph['alias'] == '') { |
|
580 | 583 | $ph['alias'] = '(<i>[%not_set%]</i>)'; |
581 | 584 | } |
582 | 585 | |
@@ -585,8 +588,8 @@ discard block |
||
585 | 588 | return implode("\n", $output); |
586 | 589 | } |
587 | 590 | |
588 | -function getRecentInfoRowTpl() |
|
589 | -{ |
|
591 | +function getRecentInfoRowTpl() |
|
592 | +{ |
|
590 | 593 | $tpl = ' |
591 | 594 | <tr> |
592 | 595 | <td data-toggle="collapse" data-target=".collapse[+id+]" class="text-right"><span class="label label-info">[+id+]</span></td> |
@@ -615,13 +618,13 @@ discard block |
||
615 | 618 | } |
616 | 619 | |
617 | 620 | // setup icons |
618 | -function wrapIcon($i, $action) |
|
619 | -{ |
|
621 | +function wrapIcon($i, $action) |
|
622 | +{ |
|
620 | 623 | return sprintf('<a href="index.php?a=%s" target="main"><span class="wm_button" style="border:0">%s</span></a>', $action, $i); |
621 | 624 | } |
622 | 625 | |
623 | -function getStartUpScript() |
|
624 | -{ |
|
626 | +function getStartUpScript() |
|
627 | +{ |
|
625 | 628 | $script = ' |
626 | 629 | <script type="text/javascript"> |
627 | 630 | function hideConfigCheckWarning(key) { |
@@ -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->db->select('*', $modx->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->db->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->db->escape(trim($_REQUEST['searchfields'])); |
88 | 88 | $search_alias = $modx->db->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->db->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,13 +118,13 @@ discard block |
||
118 | 118 | $articul_query = "SELECT `contentid` FROM {$tbl_site_tmplvar_contentvalues} WHERE `value` LIKE '%{$searchfields}%'"; |
119 | 119 | $articul_result = $modx->db->query($articul_query); |
120 | 120 | $articul_id_array = $modx->db->makeArray($articul_result); |
121 | - if (count($articul_id_array)>0) { |
|
121 | + if (count($articul_id_array) > 0) { |
|
122 | 122 | $articul_id = ''; |
123 | 123 | $i = 1; |
124 | 124 | foreach ($articul_id_array as $articul) { |
125 | - $articul_id.=$articul['contentid']; |
|
125 | + $articul_id .= $articul['contentid']; |
|
126 | 126 | if ($i !== count($articul_id_array)) { |
127 | - $articul_id.=','; |
|
127 | + $articul_id .= ','; |
|
128 | 128 | } |
129 | 129 | $i++; |
130 | 130 | } |
@@ -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 | } |
@@ -156,7 +156,7 @@ discard block |
||
156 | 156 | $sqladd .= " OR sc.introtext LIKE '%{$searchlongtitle}%'"; |
157 | 157 | $sqladd .= " OR sc.menutitle LIKE '%{$searchlongtitle}%'"; |
158 | 158 | $sqladd .= " OR sc.alias LIKE '%{$search_alias}%'"; |
159 | - $sqladd .= $articul_id_query;//search by TV |
|
159 | + $sqladd .= $articul_id_query; //search by TV |
|
160 | 160 | $sqladd .= ")"; |
161 | 161 | } |
162 | 162 | } elseif ($idFromAlias) { |
@@ -180,8 +180,8 @@ discard block |
||
180 | 180 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
181 | 181 | $mgrRole = (isset($_SESSION['mgrRole']) && $_SESSION['mgrRole'] == 1) ? 1 : 0; |
182 | 182 | $docgrp_cond = $docgrp ? " OR dg.document_group IN ({$docgrp})" : ''; |
183 | - $fields .= ', MAX(IF(1=' . $mgrRole . ' OR sc.privatemgr=0' . $docgrp_cond . ',1,0)) AS hasAccess'; |
|
184 | - $sqladd = '(' . $sqladd . ") AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
183 | + $fields .= ', MAX(IF(1='.$mgrRole.' OR sc.privatemgr=0'.$docgrp_cond.',1,0)) AS hasAccess'; |
|
184 | + $sqladd = '('.$sqladd.") AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
185 | 185 | } |
186 | 186 | |
187 | 187 | if ($sqladd) { |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | $where = $sqladd; |
192 | 192 | |
193 | 193 | if ($where) { |
194 | - $rs = $modx->db->select($fields, $tbl_site_content . ' AS sc LEFT JOIN ' . $tbldg . ' AS dg ON dg.document=sc.id', $where, 'sc.id'); |
|
194 | + $rs = $modx->db->select($fields, $tbl_site_content.' AS sc LEFT JOIN '.$tbldg.' AS dg ON dg.document=sc.id', $where, 'sc.id'); |
|
195 | 195 | $limit = $modx->db->getRecordCount($rs); |
196 | 196 | } else { |
197 | 197 | $limit = 0; |
@@ -207,7 +207,7 @@ discard block |
||
207 | 207 | if ($limit < 1) { |
208 | 208 | echo $_lang['search_empty']; |
209 | 209 | } else { |
210 | - printf('<p>' . $_lang['search_results_returned_msg'] . '</p>', $limit); ?> |
|
210 | + printf('<p>'.$_lang['search_results_returned_msg'].'</p>', $limit); ?> |
|
211 | 211 | <script type="text/javascript" src="media/script/tablesort.js"></script> |
212 | 212 | <table class="grid sortabletable sortable-onload-2 rowstyle-even" id="table-1"> |
213 | 213 | <thead> |
@@ -265,14 +265,14 @@ discard block |
||
265 | 265 | if (function_exists('mb_strlen') && function_exists('mb_substr')) { |
266 | 266 | ?> |
267 | 267 | <td<?= $tdClass ?>> |
268 | - <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> |
|
268 | + <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> |
|
269 | 269 | </td> |
270 | - <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset) . "..." : $row['description'] ?></td> |
|
270 | + <td<?= $tdClass ?>><?= mb_strlen($row['description'], $modx_manager_charset) > 70 ? mb_substr($row['description'], 0, 70, $modx_manager_charset)."..." : $row['description'] ?></td> |
|
271 | 271 | <?php |
272 | 272 | } else { |
273 | 273 | ?> |
274 | - <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20) . '...' : $row['pagetitle'] ?></td> |
|
275 | - <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35) . '...' : $row['description'] ?></td> |
|
274 | + <td<?= $tdClass ?>><?= strlen($row['pagetitle']) > 20 ? substr($row['pagetitle'], 0, 20).'...' : $row['pagetitle'] ?></td> |
|
275 | + <td<?= $tdClass ?>><?= strlen($row['description']) > 35 ? substr($row['description'], 0, 35).'...' : $row['description'] ?></td> |
|
276 | 276 | <?php |
277 | 277 | } ?> |
278 | 278 | </tr> |
@@ -289,115 +289,115 @@ discard block |
||
289 | 289 | if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
290 | 290 | $docscounts = $modx->db->getRecordCount($rs); |
291 | 291 | if ($docscounts > 0) { |
292 | - $output .= '<li><b><i class="fa fa-sitemap"></i> ' . $_lang["manage_documents"] . ' (' . $docscounts . ')</b></li>'; |
|
292 | + $output .= '<li><b><i class="fa fa-sitemap"></i> '.$_lang["manage_documents"].' ('.$docscounts.')</b></li>'; |
|
293 | 293 | while ($row = $modx->db->getRow($rs)) { |
294 | - $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>'; |
|
294 | + $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>'; |
|
295 | 295 | } |
296 | 296 | } |
297 | 297 | } |
298 | 298 | |
299 | 299 | //templates |
300 | 300 | if ($modx->hasPermission('edit_template')) { |
301 | - $rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%" . $searchfields . "%' |
|
302 | - OR `templatename` like '%" . $searchfields . "%' |
|
303 | - OR `description` like '%" . $searchfields . "%' |
|
304 | - OR `content` like '%" . $searchfields . "%'"); |
|
301 | + $rs = $modx->db->select("id,templatename,locked", $modx->getFullTableName('site_templates'), "`id` like '%".$searchfields."%' |
|
302 | + OR `templatename` like '%" . $searchfields."%' |
|
303 | + OR `description` like '%" . $searchfields."%' |
|
304 | + OR `content` like '%" . $searchfields."%'"); |
|
305 | 305 | $templatecounts = $modx->db->getRecordCount($rs); |
306 | 306 | if ($templatecounts > 0) { |
307 | - $output .= '<li><b><i class="fa fa-newspaper-o"></i> ' . $_lang["manage_templates"] . ' (' . $templatecounts . ')</b></li>'; |
|
307 | + $output .= '<li><b><i class="fa fa-newspaper-o"></i> '.$_lang["manage_templates"].' ('.$templatecounts.')</b></li>'; |
|
308 | 308 | while ($row = $modx->db->getRow($rs)) { |
309 | - $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>'; |
|
309 | + $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>'; |
|
310 | 310 | } |
311 | 311 | } |
312 | 312 | } |
313 | 313 | |
314 | 314 | //tvs |
315 | 315 | if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
316 | - $rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%" . $searchfields . "%' |
|
317 | - OR `name` like '%" . $searchfields . "%' |
|
318 | - OR `description` like '%" . $searchfields . "%' |
|
319 | - OR `type` like '%" . $searchfields . "%' |
|
320 | - OR `elements` like '%" . $searchfields . "%' |
|
321 | - OR `display` like '%" . $searchfields . "%' |
|
322 | - OR `display_params` like '%" . $searchfields . "%' |
|
323 | - OR `default_text` like '%" . $searchfields . "%'"); |
|
316 | + $rs = $modx->db->select("id,name,locked", $modx->getFullTableName('site_tmplvars'), "`id` like '%".$searchfields."%' |
|
317 | + OR `name` like '%" . $searchfields."%' |
|
318 | + OR `description` like '%" . $searchfields."%' |
|
319 | + OR `type` like '%" . $searchfields."%' |
|
320 | + OR `elements` like '%" . $searchfields."%' |
|
321 | + OR `display` like '%" . $searchfields."%' |
|
322 | + OR `display_params` like '%" . $searchfields."%' |
|
323 | + OR `default_text` like '%" . $searchfields."%'"); |
|
324 | 324 | $tvscounts = $modx->db->getRecordCount($rs); |
325 | 325 | if ($tvscounts > 0) { |
326 | - $output .= '<li><b><i class="fa fa-list-alt"></i> ' . $_lang["settings_templvars"] . ' (' . $tvscounts . ')</b></li>'; |
|
326 | + $output .= '<li><b><i class="fa fa-list-alt"></i> '.$_lang["settings_templvars"].' ('.$tvscounts.')</b></li>'; |
|
327 | 327 | while ($row = $modx->db->getRow($rs)) { |
328 | - $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>'; |
|
328 | + $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>'; |
|
329 | 329 | } |
330 | 330 | } |
331 | 331 | } |
332 | 332 | |
333 | 333 | //Chunks |
334 | 334 | if ($modx->hasPermission('edit_chunk')) { |
335 | - $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%" . $searchfields . "%' |
|
336 | - OR `name` like '%" . $searchfields . "%' |
|
337 | - OR `description` like '%" . $searchfields . "%' |
|
338 | - OR `snippet` like '%" . $searchfields . "%'"); |
|
335 | + $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_htmlsnippets'), "`id` like '%".$searchfields."%' |
|
336 | + OR `name` like '%" . $searchfields."%' |
|
337 | + OR `description` like '%" . $searchfields."%' |
|
338 | + OR `snippet` like '%" . $searchfields."%'"); |
|
339 | 339 | $chunkscounts = $modx->db->getRecordCount($rs); |
340 | 340 | if ($chunkscounts > 0) { |
341 | - $output .= '<li><b><i class="fa fa-th-large"></i> ' . $_lang["manage_htmlsnippets"] . ' (' . $chunkscounts . ')</b></li>'; |
|
341 | + $output .= '<li><b><i class="fa fa-th-large"></i> '.$_lang["manage_htmlsnippets"].' ('.$chunkscounts.')</b></li>'; |
|
342 | 342 | while ($row = $modx->db->getRow($rs)) { |
343 | - $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>'; |
|
343 | + $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>'; |
|
344 | 344 | } |
345 | 345 | } |
346 | 346 | } |
347 | 347 | |
348 | 348 | //Snippets |
349 | 349 | if ($modx->hasPermission('edit_snippet')) { |
350 | - $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%" . $searchfields . "%' |
|
351 | - OR `name` like '%" . $searchfields . "%' |
|
352 | - OR `description` like '%" . $searchfields . "%' |
|
353 | - OR `snippet` like '%" . $searchfields . "%' |
|
354 | - OR `properties` like '%" . $searchfields . "%' |
|
355 | - OR `moduleguid` like '%" . $searchfields . "%'"); |
|
350 | + $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_snippets'), "`id` like '%".$searchfields."%' |
|
351 | + OR `name` like '%" . $searchfields."%' |
|
352 | + OR `description` like '%" . $searchfields."%' |
|
353 | + OR `snippet` like '%" . $searchfields."%' |
|
354 | + OR `properties` like '%" . $searchfields."%' |
|
355 | + OR `moduleguid` like '%" . $searchfields."%'"); |
|
356 | 356 | $snippetscounts = $modx->db->getRecordCount($rs); |
357 | 357 | if ($snippetscounts > 0) { |
358 | - $output .= '<li><b><i class="fa fa-code"></i> ' . $_lang["manage_snippets"] . ' (' . $snippetscounts . ')</b></li>'; |
|
358 | + $output .= '<li><b><i class="fa fa-code"></i> '.$_lang["manage_snippets"].' ('.$snippetscounts.')</b></li>'; |
|
359 | 359 | while ($row = $modx->db->getRow($rs)) { |
360 | - $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>'; |
|
360 | + $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>'; |
|
361 | 361 | } |
362 | 362 | } |
363 | 363 | } |
364 | 364 | |
365 | 365 | //plugins |
366 | 366 | if ($modx->hasPermission('edit_plugin')) { |
367 | - $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%" . $searchfields . "%' |
|
368 | - OR `name` like '%" . $searchfields . "%' |
|
369 | - OR `description` like '%" . $searchfields . "%' |
|
370 | - OR `plugincode` like '%" . $searchfields . "%' |
|
371 | - OR `properties` like '%" . $searchfields . "%' |
|
372 | - OR `moduleguid` like '%" . $searchfields . "%'"); |
|
367 | + $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_plugins'), "`id` like '%".$searchfields."%' |
|
368 | + OR `name` like '%" . $searchfields."%' |
|
369 | + OR `description` like '%" . $searchfields."%' |
|
370 | + OR `plugincode` like '%" . $searchfields."%' |
|
371 | + OR `properties` like '%" . $searchfields."%' |
|
372 | + OR `moduleguid` like '%" . $searchfields."%'"); |
|
373 | 373 | $pluginscounts = $modx->db->getRecordCount($rs); |
374 | 374 | if ($pluginscounts > 0) { |
375 | - $output .= '<li><b><i class="fa fa-plug"></i> ' . $_lang["manage_plugins"] . ' (' . $pluginscounts . ')</b></li>'; |
|
375 | + $output .= '<li><b><i class="fa fa-plug"></i> '.$_lang["manage_plugins"].' ('.$pluginscounts.')</b></li>'; |
|
376 | 376 | while ($row = $modx->db->getRow($rs)) { |
377 | - $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>'; |
|
377 | + $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>'; |
|
378 | 378 | } |
379 | 379 | } |
380 | 380 | } |
381 | 381 | |
382 | 382 | //modules |
383 | 383 | if ($modx->hasPermission('edit_module')) { |
384 | - $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%" . $searchfields . "%' |
|
385 | - OR `name` like '%" . $searchfields . "%' |
|
386 | - OR `description` like '%" . $searchfields . "%' |
|
387 | - OR `modulecode` like '%" . $searchfields . "%' |
|
388 | - OR `properties` like '%" . $searchfields . "%' |
|
389 | - OR `guid` like '%" . $searchfields . "%' |
|
390 | - OR `resourcefile` like '%" . $searchfields . "%'"); |
|
384 | + $rs = $modx->db->select("id,name,locked,disabled", $modx->getFullTableName('site_modules'), "`id` like '%".$searchfields."%' |
|
385 | + OR `name` like '%" . $searchfields."%' |
|
386 | + OR `description` like '%" . $searchfields."%' |
|
387 | + OR `modulecode` like '%" . $searchfields."%' |
|
388 | + OR `properties` like '%" . $searchfields."%' |
|
389 | + OR `guid` like '%" . $searchfields."%' |
|
390 | + OR `resourcefile` like '%" . $searchfields."%'"); |
|
391 | 391 | $modulescounts = $modx->db->getRecordCount($rs); |
392 | 392 | if ($modulescounts > 0) { |
393 | - $output .= '<li><b><i class="fa fa-cogs"></i> ' . $_lang["modules"] . ' (' . $modulescounts . ')</b></li>'; |
|
393 | + $output .= '<li><b><i class="fa fa-cogs"></i> '.$_lang["modules"].' ('.$modulescounts.')</b></li>'; |
|
394 | 394 | while ($row = $modx->db->getRow($rs)) { |
395 | - $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>'; |
|
395 | + $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>'; |
|
396 | 396 | } |
397 | 397 | } |
398 | 398 | } |
399 | 399 | |
400 | - echo $output ? '<div class="ajaxSearchResults"><ul>' . $output . '</ul></div>' : '1'; |
|
400 | + echo $output ? '<div class="ajaxSearchResults"><ul>'.$output.'</ul></div>' : '1'; |
|
401 | 401 | } ?> |
402 | 402 | </div> |
403 | 403 | </div> |
@@ -411,13 +411,13 @@ discard block |
||
411 | 411 | */ |
412 | 412 | function highlightingCoincidence($text, $search) |
413 | 413 | { |
414 | - $regexp = '!(' . str_replace(array( |
|
414 | + $regexp = '!('.str_replace(array( |
|
415 | 415 | '(', |
416 | 416 | ')' |
417 | 417 | ), array( |
418 | 418 | '\(', |
419 | 419 | '\)' |
420 | - ), trim($search)) . ')!isu'; |
|
420 | + ), trim($search)).')!isu'; |
|
421 | 421 | return preg_replace($regexp, '<span class="text-danger">$1</span>', $text); |
422 | 422 | } |
423 | 423 | |
@@ -440,7 +440,7 @@ discard block |
||
440 | 440 | $class .= ' deleted'; |
441 | 441 | } |
442 | 442 | if ($class) { |
443 | - $class = ' class="' . trim($class) . '"'; |
|
443 | + $class = ' class="'.trim($class).'"'; |
|
444 | 444 | } |
445 | 445 | return $class; |
446 | 446 | } |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if (!$modx->hasPermission('edit_module')) { |
@@ -63,7 +63,7 @@ discard block |
||
63 | 63 | |
64 | 64 | } |
65 | 65 | |
66 | -include_once MODX_MANAGER_PATH . "includes/header.inc.php"; |
|
66 | +include_once MODX_MANAGER_PATH."includes/header.inc.php"; |
|
67 | 67 | ?> |
68 | 68 | <script language="JavaScript" type="text/javascript"> |
69 | 69 | function saveSelection() |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | </script> |
139 | 139 | |
140 | 140 | <h1> |
141 | - <?= $title . " - " . $_lang['element_selector_title'] ?><i class="fa fa-question-circle help"></i> |
|
141 | + <?= $title." - ".$_lang['element_selector_title'] ?><i class="fa fa-question-circle help"></i> |
|
142 | 142 | </h1> |
143 | 143 | |
144 | 144 | <div id="actions"> |
@@ -177,15 +177,15 @@ discard block |
||
177 | 177 | <div class="row"> |
178 | 178 | <div class="table-responsive"> |
179 | 179 | <?php |
180 | - include_once MODX_MANAGER_PATH . "includes/controls/datagrid.class.php"; |
|
180 | + include_once MODX_MANAGER_PATH."includes/controls/datagrid.class.php"; |
|
181 | 181 | $grd = new DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items |
182 | 182 | $grd->noRecordMsg = $_lang["no_records_found"]; |
183 | 183 | $grd->cssClass = "table data nowrap"; |
184 | 184 | $grd->columnHeaderClass = "tableHeader"; |
185 | 185 | $grd->itemClass = "tableItem"; |
186 | 186 | $grd->altItemClass = "tableAltItem"; |
187 | - $grd->columns = $_lang["name"] . " ," . $_lang["description"]; |
|
188 | - $grd->colTypes = "template:<input type='" . ($sm == 'm' ? 'checkbox' : 'radio') . "' name='id[]' value='[+id+]' onclick='setCheckbox(this);'> [+value+]"; |
|
187 | + $grd->columns = $_lang["name"]." ,".$_lang["description"]; |
|
188 | + $grd->colTypes = "template:<input type='".($sm == 'm' ? 'checkbox' : 'radio')."' name='id[]' value='[+id+]' onclick='setCheckbox(this);'> [+value+]"; |
|
189 | 189 | $grd->colWidths = "45%"; |
190 | 190 | $grd->fields = "name,description"; |
191 | 191 | if ($_REQUEST['listmode'] == '1') { |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (! defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
2 | +if (!defined('IN_MANAGER_MODE') || IN_MANAGER_MODE !== true) { |
|
3 | 3 | die("<b>INCLUDE_ORDERING_ERROR</b><br /><br />Please use the EVO Content Manager instead of accessing this file directly."); |
4 | 4 | } |
5 | 5 | if (!$modx->hasPermission('save_password')) { |
@@ -10,11 +10,11 @@ discard block |
||
10 | 10 | $pass1 = $_POST['pass1']; |
11 | 11 | $pass2 = $_POST['pass2']; |
12 | 12 | |
13 | -if ($pass1!=$pass2) { |
|
13 | +if ($pass1 != $pass2) { |
|
14 | 14 | $modx->webAlertAndQuit("Passwords don't match!"); |
15 | 15 | } |
16 | 16 | |
17 | -if (strlen($pass1)<6) { |
|
17 | +if (strlen($pass1) < 6) { |
|
18 | 18 | $modx->webAlertAndQuit("Password is too short. Please specify a password of at least 6 characters."); |
19 | 19 | } |
20 | 20 | |
@@ -32,5 +32,5 @@ discard block |
||
32 | 32 | 'userpassword' => $pass1 |
33 | 33 | )); |
34 | 34 | |
35 | -$header="Location: index.php?a=2"; |
|
35 | +$header = "Location: index.php?a=2"; |
|
36 | 36 | header($header); |
@@ -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 | |
@@ -15,8 +15,8 @@ discard block |
||
15 | 15 | header($header); |
16 | 16 | } else { |
17 | 17 | // Remove single locks via AJAX / window.onbeforeunload |
18 | - $type = (int)$_GET['type']; |
|
19 | - $id = (int)$_GET['id']; |
|
18 | + $type = (int) $_GET['type']; |
|
19 | + $id = (int) $_GET['id']; |
|
20 | 20 | $includeAllUsers = $modx->hasPermission('remove_locks'); // Enables usage of "unlock"-ajax-button |
21 | 21 | if ($type && $id) { |
22 | 22 | $modx->unlockElement($type, $id, $includeAllUsers); |
@@ -276,19 +276,19 @@ |
||
276 | 276 | |
277 | 277 | // invoke OnBeforeDocFormSave event |
278 | 278 | switch ($modx->config['docid_incrmnt_method']) { |
279 | - case '1': |
|
280 | - $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
|
281 | - $where = "T1.id IS NULL"; |
|
282 | - $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL"); |
|
283 | - $id = $modx->db->getValue($rs); |
|
279 | + case '1': |
|
280 | + $from = "{$tbl_site_content} AS T0 LEFT JOIN {$tbl_site_content} AS T1 ON T0.id + 1 = T1.id"; |
|
281 | + $where = "T1.id IS NULL"; |
|
282 | + $rs = $modx->db->select('MIN(T0.id)+1', $from, "T1.id IS NULL"); |
|
283 | + $id = $modx->db->getValue($rs); |
|
284 | + break; |
|
285 | + case '2': |
|
286 | + $rs = $modx->db->select('MAX(id)+1', $tbl_site_content); |
|
287 | + $id = $modx->db->getValue($rs); |
|
284 | 288 | break; |
285 | - case '2': |
|
286 | - $rs = $modx->db->select('MAX(id)+1', $tbl_site_content); |
|
287 | - $id = $modx->db->getValue($rs); |
|
288 | - break; |
|
289 | 289 | |
290 | - default: |
|
291 | - $id = ''; |
|
290 | + default: |
|
291 | + $id = ''; |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | $modx->invokeEvent("OnBeforeDocFormSave", array( |
@@ -36,10 +36,10 @@ discard block |
||
36 | 36 | $aliasvisible = $_POST['alias_visible']; |
37 | 37 | |
38 | 38 | /************* webber ********/ |
39 | -$sd = isset($_POST['dir']) ? '&dir=' . $_POST['dir'] : '&dir=DESC'; |
|
40 | -$sb = isset($_POST['sort']) ? '&sort=' . $_POST['sort'] : '&sort=pub_date'; |
|
41 | -$pg = isset($_POST['page']) ? '&page=' . (int) $_POST['page'] : ''; |
|
42 | -$add_path = $sd . $sb . $pg; |
|
39 | +$sd = isset($_POST['dir']) ? '&dir='.$_POST['dir'] : '&dir=DESC'; |
|
40 | +$sb = isset($_POST['sort']) ? '&sort='.$_POST['sort'] : '&sort=pub_date'; |
|
41 | +$pg = isset($_POST['page']) ? '&page='.(int) $_POST['page'] : ''; |
|
42 | +$add_path = $sd.$sb.$pg; |
|
43 | 43 | |
44 | 44 | |
45 | 45 | |
@@ -193,15 +193,15 @@ discard block |
||
193 | 193 | INNER JOIN {$tbl_site_tmplvar_templates} AS tvtpl ON tvtpl.tmplvarid = tv.id |
194 | 194 | LEFT JOIN {$tbl_site_tmplvar_contentvalues} AS tvc ON tvc.tmplvarid=tv.id AND tvc.contentid = '{$id}' |
195 | 195 | LEFT JOIN {$tbl_site_tmplvar_access} AS tva ON tva.tmplvarid=tv.id", |
196 | - "tvtpl.templateid = '{$template}' AND (1='{$_SESSION['mgrRole']}' OR ISNULL(tva.documentgroup)" . ((!$docgrp) ? "" : " OR tva.documentgroup IN ($docgrp)") . ")", |
|
196 | + "tvtpl.templateid = '{$template}' AND (1='{$_SESSION['mgrRole']}' OR ISNULL(tva.documentgroup)".((!$docgrp) ? "" : " OR tva.documentgroup IN ($docgrp)").")", |
|
197 | 197 | "tv.rank" |
198 | 198 | ); |
199 | 199 | while ($row = $modx->db->getRow($rs)) { |
200 | 200 | $tmplvar = ''; |
201 | 201 | switch ($row['type']) { |
202 | 202 | case 'url': |
203 | - $tmplvar = $_POST["tv" . $row['id']]; |
|
204 | - if ($_POST["tv" . $row['id'] . '_prefix'] != '--') { |
|
203 | + $tmplvar = $_POST["tv".$row['id']]; |
|
204 | + if ($_POST["tv".$row['id'].'_prefix'] != '--') { |
|
205 | 205 | $tmplvar = str_replace(array( |
206 | 206 | "feed://", |
207 | 207 | "ftp://", |
@@ -209,23 +209,23 @@ discard block |
||
209 | 209 | "https://", |
210 | 210 | "mailto:" |
211 | 211 | ), "", $tmplvar); |
212 | - $tmplvar = $_POST["tv" . $row['id'] . '_prefix'] . $tmplvar; |
|
212 | + $tmplvar = $_POST["tv".$row['id'].'_prefix'].$tmplvar; |
|
213 | 213 | } |
214 | 214 | break; |
215 | 215 | case 'file': |
216 | - $tmplvar = $_POST["tv" . $row['id']]; |
|
216 | + $tmplvar = $_POST["tv".$row['id']]; |
|
217 | 217 | break; |
218 | 218 | default: |
219 | - if (is_array($_POST["tv" . $row['id']])) { |
|
219 | + if (is_array($_POST["tv".$row['id']])) { |
|
220 | 220 | // handles checkboxes & multiple selects elements |
221 | 221 | $feature_insert = array(); |
222 | - $lst = $_POST["tv" . $row['id']]; |
|
222 | + $lst = $_POST["tv".$row['id']]; |
|
223 | 223 | while (list($featureValue, $feature_item) = each($lst)) { |
224 | 224 | $feature_insert[count($feature_insert)] = $feature_item; |
225 | 225 | } |
226 | 226 | $tmplvar = implode("||", $feature_insert); |
227 | 227 | } else { |
228 | - $tmplvar = $_POST["tv" . $row['id']]; |
|
228 | + $tmplvar = $_POST["tv".$row['id']]; |
|
229 | 229 | } |
230 | 230 | break; |
231 | 231 | } |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | // check to see if the user is allowed to save the document in the place he wants to save it in |
254 | 254 | if ($use_udperms == 1) { |
255 | 255 | if ($existingDocument['parent'] != $parent) { |
256 | - include_once MODX_MANAGER_PATH . "processors/user_documents_permissions.class.php"; |
|
256 | + include_once MODX_MANAGER_PATH."processors/user_documents_permissions.class.php"; |
|
257 | 257 | $udperms = new udperms(); |
258 | 258 | $udperms->user = $modx->getLoginUserID(); |
259 | 259 | $udperms->document = $parent; |
@@ -369,11 +369,11 @@ discard block |
||
369 | 369 | foreach ($document_groups as $value_pair) { |
370 | 370 | // first, split the pair (this is a new document, so ignore the second value |
371 | 371 | list($group) = explode(',', $value_pair); // @see actions/mutate_content.dynamic.php @ line 1138 (permissions list) |
372 | - $new_groups[] = '(' . (int) $group . ',' . $key . ')'; |
|
372 | + $new_groups[] = '('.(int) $group.','.$key.')'; |
|
373 | 373 | } |
374 | 374 | $saved = true; |
375 | 375 | if (!empty($new_groups)) { |
376 | - $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',', $new_groups)); |
|
376 | + $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $new_groups)); |
|
377 | 377 | } |
378 | 378 | } else { |
379 | 379 | $isManager = $modx->hasPermission('access_permissions'); |
@@ -403,11 +403,11 @@ discard block |
||
403 | 403 | )); |
404 | 404 | |
405 | 405 | // secure web documents - flag as private |
406 | - include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; |
|
406 | + include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
|
407 | 407 | secureWebDocument($key); |
408 | 408 | |
409 | 409 | // secure manager documents - flag as private |
410 | - include MODX_MANAGER_PATH . "includes/secure_mgr_documents.inc.php"; |
|
410 | + include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
|
411 | 411 | secureMgrDocument($key); |
412 | 412 | |
413 | 413 | // Set the item name for logger |
@@ -428,7 +428,7 @@ discard block |
||
428 | 428 | if ($_POST['mode'] == "4") { |
429 | 429 | $a = ($_POST['stay'] == '2') ? "27&id=$key" : "4&pid=$parent"; |
430 | 430 | } |
431 | - $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay']; |
|
431 | + $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay']; |
|
432 | 432 | } else { |
433 | 433 | $header = "Location: index.php?a=3&id=$key&r=1"; |
434 | 434 | } |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | if (!$was_published && $published) { |
489 | 489 | $publishedon = $currentdate; |
490 | 490 | $publishedby = $modx->getLoginUserID(); |
491 | - } elseif ((!empty($pub_date)&& $pub_date<=$currentdate && $published)) { |
|
491 | + } elseif ((!empty($pub_date) && $pub_date <= $currentdate && $published)) { |
|
492 | 492 | $publishedon = $pub_date; |
493 | 493 | $publishedby = $modx->getLoginUserID(); |
494 | 494 | } elseif ($was_published && !$published) { |
@@ -525,7 +525,7 @@ discard block |
||
525 | 525 | . "menuindex={$menuindex}, " |
526 | 526 | . "searchable={$searchable}, " |
527 | 527 | . "cacheable={$cacheable}, " |
528 | - . "editedby=" . $modx->getLoginUserID() . ", " |
|
528 | + . "editedby=".$modx->getLoginUserID().", " |
|
529 | 529 | . "editedon={$currentdate}, " |
530 | 530 | . "publishedon={$publishedon}, " |
531 | 531 | . "publishedby={$publishedby}, " |
@@ -562,7 +562,7 @@ discard block |
||
562 | 562 | } |
563 | 563 | |
564 | 564 | if (!empty($tvDeletions)) { |
565 | - $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN(' . implode(',', $tvDeletions) . ')'); |
|
565 | + $modx->db->delete($tbl_site_tmplvar_contentvalues, 'id IN('.implode(',', $tvDeletions).')'); |
|
566 | 566 | } |
567 | 567 | |
568 | 568 | if (!empty($tvAdded)) { |
@@ -593,7 +593,7 @@ discard block |
||
593 | 593 | 'groups.id, groups.document_group', |
594 | 594 | "{$tbl_document_groups} AS groups |
595 | 595 | LEFT JOIN {$tbl_documentgroup_names} AS dgn ON dgn.id = groups.document_group", |
596 | - "((1=" . (int)$isManager . " AND dgn.private_memgroup) OR (1=" . (int)$isWeb . " AND dgn.private_webgroup)) AND groups.document = '{$id}'" |
|
596 | + "((1=".(int) $isManager." AND dgn.private_memgroup) OR (1=".(int) $isWeb." AND dgn.private_webgroup)) AND groups.document = '{$id}'" |
|
597 | 597 | ); |
598 | 598 | $old_groups = array(); |
599 | 599 | while ($row = $modx->db->getRow($rs)) { |
@@ -607,14 +607,14 @@ discard block |
||
607 | 607 | unset($old_groups[$group]); |
608 | 608 | continue; |
609 | 609 | } elseif ($link_id == 'new') { |
610 | - $insertions[] = '(' . (int)$group . ',' . $id . ')'; |
|
610 | + $insertions[] = '('.(int) $group.','.$id.')'; |
|
611 | 611 | } |
612 | 612 | } |
613 | 613 | if (!empty($insertions)) { |
614 | - $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES " . implode(',', $insertions)); |
|
614 | + $modx->db->query("INSERT INTO {$tbl_document_groups} (document_group, document) VALUES ".implode(',', $insertions)); |
|
615 | 615 | } |
616 | 616 | if (!empty($old_groups)) { |
617 | - $modx->db->delete($tbl_document_groups, "id IN (" . implode(',', $old_groups) . ")"); |
|
617 | + $modx->db->delete($tbl_document_groups, "id IN (".implode(',', $old_groups).")"); |
|
618 | 618 | } |
619 | 619 | // necessary to remove all permissions as document is public |
620 | 620 | if ((isset($_POST['chkalldocs']) && $_POST['chkalldocs'] == 'on')) { |
@@ -645,11 +645,11 @@ discard block |
||
645 | 645 | )); |
646 | 646 | |
647 | 647 | // secure web documents - flag as private |
648 | - include MODX_MANAGER_PATH . "includes/secure_web_documents.inc.php"; |
|
648 | + include MODX_MANAGER_PATH."includes/secure_web_documents.inc.php"; |
|
649 | 649 | secureWebDocument($id); |
650 | 650 | |
651 | 651 | // secure manager documents - flag as private |
652 | - include MODX_MANAGER_PATH . "includes/secure_mgr_documents.inc.php"; |
|
652 | + include MODX_MANAGER_PATH."includes/secure_mgr_documents.inc.php"; |
|
653 | 653 | secureMgrDocument($id); |
654 | 654 | |
655 | 655 | // Set the item name for logger |
@@ -661,7 +661,7 @@ discard block |
||
661 | 661 | } |
662 | 662 | |
663 | 663 | if ($_POST['refresh_preview'] == '1') { |
664 | - $header = "Location: " . MODX_SITE_URL . "index.php?id=$id&z=manprev"; |
|
664 | + $header = "Location: ".MODX_SITE_URL."index.php?id=$id&z=manprev"; |
|
665 | 665 | } else { |
666 | 666 | if ($_POST['stay'] != '2' && $id > 0) { |
667 | 667 | $modx->unlockElement(7, $id); |
@@ -675,9 +675,9 @@ discard block |
||
675 | 675 | // document |
676 | 676 | $a = ($_POST['stay'] == '2') ? "27&id=$id" : "4&pid=$parent"; |
677 | 677 | } |
678 | - $header = "Location: index.php?a=" . $a . "&r=1&stay=" . $_POST['stay'] . $add_path; |
|
678 | + $header = "Location: index.php?a=".$a."&r=1&stay=".$_POST['stay'].$add_path; |
|
679 | 679 | } else { |
680 | - $header = "Location: index.php?a=3&id=$id&r=1" . $add_path; |
|
680 | + $header = "Location: index.php?a=3&id=$id&r=1".$add_path; |
|
681 | 681 | } |
682 | 682 | } |
683 | 683 | if (headers_sent()) { |