@@ -3,13 +3,13 @@ discard block |
||
3 | 3 | @section('content') |
4 | 4 | <?php /*include_once evolutionCMS()->get('ManagerTheme')->getFileProcessor("actions/document_data.static.php"); */?> |
5 | 5 | <?php |
6 | - if(isset($_REQUEST['id'])) { |
|
6 | + if (isset($_REQUEST['id'])) { |
|
7 | 7 | $id = (int) $_REQUEST['id']; |
8 | 8 | } else { |
9 | 9 | $id = 0; |
10 | 10 | } |
11 | 11 | |
12 | - if(isset($_GET['opened'])) { |
|
12 | + if (isset($_GET['opened'])) { |
|
13 | 13 | $_SESSION['openedArray'] = $_GET['opened']; |
14 | 14 | } |
15 | 15 | |
@@ -20,16 +20,16 @@ discard block |
||
20 | 20 | $tbl_site_templates = $modx->getDatabase()->getFullTableName('site_templates'); |
21 | 21 | |
22 | 22 | // Get access permissions |
23 | - if($_SESSION['mgrDocgroups']) { |
|
23 | + if ($_SESSION['mgrDocgroups']) { |
|
24 | 24 | $docgrp = implode(",", $_SESSION['mgrDocgroups']); |
25 | 25 | } |
26 | - $access = "1='" . $_SESSION['mgrRole'] . "' OR sc.privatemgr=0" . (!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
26 | + $access = "1='".$_SESSION['mgrRole']."' OR sc.privatemgr=0".(!$docgrp ? "" : " OR dg.document_group IN ($docgrp)"); |
|
27 | 27 | |
28 | 28 | // |
29 | - if($_SESSION['tree_show_only_folders']) { |
|
30 | - $parent = $id ? ($modx->getDatabase()->getValue("SELECT parent FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1")) : 0; |
|
31 | - $isfolder = $modx->getDatabase()->getValue("SELECT isfolder FROM " . $tbl_site_content . " WHERE id=$id LIMIT 1"); |
|
32 | - if(!$isfolder && $parent != 0) { |
|
29 | + if ($_SESSION['tree_show_only_folders']) { |
|
30 | + $parent = $id ? ($modx->getDatabase()->getValue("SELECT parent FROM ".$tbl_site_content." WHERE id=$id LIMIT 1")) : 0; |
|
31 | + $isfolder = $modx->getDatabase()->getValue("SELECT isfolder FROM ".$tbl_site_content." WHERE id=$id LIMIT 1"); |
|
32 | + if (!$isfolder && $parent != 0) { |
|
33 | 33 | $id = $_REQUEST['id'] = $parent; |
34 | 34 | } |
35 | 35 | } |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $rs = $modx->getDatabase()->select('DISTINCT sc.*', "{$tbl_site_content} AS sc |
39 | 39 | LEFT JOIN {$tbl_document_groups} AS dg ON dg.document = sc.id", "sc.id ='{$id}' AND ({$access})"); |
40 | 40 | $content = $modx->getDatabase()->getRow($rs); |
41 | - if(!$content) { |
|
41 | + if (!$content) { |
|
42 | 42 | $modx->webAlertAndQuit($_lang["access_permission_denied"]); |
43 | 43 | } |
44 | 44 | |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | ); |
81 | 81 | $filter_sort = ''; |
82 | 82 | $filter_dir = ''; |
83 | - if($numRecords > 0) { |
|
84 | - $filter_sort = '<select size="1" name="sort" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&dir=' . $dir . '&sort=\'+this.options[this.selectedIndex].value">' . '<option value="createdon"' . (($sort == 'createdon') ? ' selected' : '') . '>' . $_lang['createdon'] . '</option>' . '<option value="pub_date"' . (($sort == 'pub_date') ? ' selected' : '') . '>' . $_lang["page_data_publishdate"] . '</option>' . '<option value="pagetitle"' . (($sort == 'pagetitle') ? ' selected' : '') . '>' . $_lang['pagetitle'] . '</option>' . '<option value="menuindex"' . (($sort == 'menuindex') ? ' selected' : '') . '>' . $_lang['resource_opt_menu_index'] . '</option>' . //******** resource_opt_is_published - // |
|
85 | - '<option value="published"' . (($sort == 'published') ? ' selected' : '') . '>' . $_lang['resource_opt_is_published'] . '</option>' . //********// |
|
83 | + if ($numRecords > 0) { |
|
84 | + $filter_sort = '<select size="1" name="sort" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id='.$id.'&dir='.$dir.'&sort=\'+this.options[this.selectedIndex].value">'.'<option value="createdon"'.(($sort == 'createdon') ? ' selected' : '').'>'.$_lang['createdon'].'</option>'.'<option value="pub_date"'.(($sort == 'pub_date') ? ' selected' : '').'>'.$_lang["page_data_publishdate"].'</option>'.'<option value="pagetitle"'.(($sort == 'pagetitle') ? ' selected' : '').'>'.$_lang['pagetitle'].'</option>'.'<option value="menuindex"'.(($sort == 'menuindex') ? ' selected' : '').'>'.$_lang['resource_opt_menu_index'].'</option>'.//******** resource_opt_is_published - // |
|
85 | + '<option value="published"'.(($sort == 'published') ? ' selected' : '').'>'.$_lang['resource_opt_is_published'].'</option>'.//********// |
|
86 | 86 | '</select>'; |
87 | - $filter_dir = '<select size="1" name="dir" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id=' . $id . '&sort=' . $sort . '&dir=\'+this.options[this.selectedIndex].value">' . '<option value="DESC"' . (($dir == 'DESC') ? ' selected' : '') . '>' . $_lang['sort_desc'] . '</option>' . '<option value="ASC"' . (($dir == 'ASC') ? ' selected' : '') . '>' . $_lang['sort_asc'] . '</option>' . '</select>'; |
|
87 | + $filter_dir = '<select size="1" name="dir" class="form-control form-control-sm" onchange="document.location=\'index.php?a=3&id='.$id.'&sort='.$sort.'&dir=\'+this.options[this.selectedIndex].value">'.'<option value="DESC"'.(($dir == 'DESC') ? ' selected' : '').'>'.$_lang['sort_desc'].'</option>'.'<option value="ASC"'.(($dir == 'ASC') ? ' selected' : '').'>'.$_lang['sort_asc'].'</option>'.'</select>'; |
|
88 | 88 | $resource = $modx->getDatabase()->makeArray($rs); |
89 | 89 | |
90 | 90 | // CSS style for table |
@@ -128,10 +128,10 @@ discard block |
||
128 | 128 | ); |
129 | 129 | $modx->getMakeTable()->setColumnWidths($tbWidth); |
130 | 130 | |
131 | - $sd = isset($_REQUEST['dir']) ? '&dir=' . $_REQUEST['dir'] : '&dir=DESC'; |
|
132 | - $sb = isset($_REQUEST['sort']) ? '&sort=' . $_REQUEST['sort'] : '&sort=createdon'; |
|
133 | - $pg = isset($_REQUEST['page']) ? '&page=' . (int) $_REQUEST['page'] : ''; |
|
134 | - $add_path = $sd . $sb . $pg; |
|
131 | + $sd = isset($_REQUEST['dir']) ? '&dir='.$_REQUEST['dir'] : '&dir=DESC'; |
|
132 | + $sb = isset($_REQUEST['sort']) ? '&sort='.$_REQUEST['sort'] : '&sort=createdon'; |
|
133 | + $pg = isset($_REQUEST['page']) ? '&page='.(int) $_REQUEST['page'] : ''; |
|
134 | + $add_path = $sd.$sb.$pg; |
|
135 | 135 | |
136 | 136 | $icons = array( |
137 | 137 | 'text/html' => $_style['tree_page_html'], |
@@ -149,9 +149,9 @@ discard block |
||
149 | 149 | ); |
150 | 150 | |
151 | 151 | $listDocs = array(); |
152 | - foreach($resource as $k => $children) { |
|
152 | + foreach ($resource as $k => $children) { |
|
153 | 153 | |
154 | - switch($children['id']) { |
|
154 | + switch ($children['id']) { |
|
155 | 155 | case $modx->getConfig('site_start') : |
156 | 156 | $icon = $_style['tree_page_home']; |
157 | 157 | break; |
@@ -165,10 +165,10 @@ discard block |
||
165 | 165 | $icon = $_style['tree_page_info']; |
166 | 166 | break; |
167 | 167 | default: |
168 | - if($children['isfolder']) { |
|
168 | + if ($children['isfolder']) { |
|
169 | 169 | $icon = $_style['tree_folder_new']; |
170 | 170 | } else { |
171 | - if(isset($icons[$children['contentType']])) { |
|
171 | + if (isset($icons[$children['contentType']])) { |
|
172 | 172 | $icon = $icons[$children['contentType']]; |
173 | 173 | } else { |
174 | 174 | $icon = $_style['tree_page']; |
@@ -183,32 +183,32 @@ discard block |
||
183 | 183 | $class = ($children['deleted'] ? 'text-danger text-decoration-through' : (!$children['published'] ? ' font-italic text-muted' : ' publish')); |
184 | 184 | //$class .= ($children['hidemenu'] ? ' text-muted' : ' text-primary'); |
185 | 185 | //$class .= ($children['isfolder'] ? ' font-weight-bold' : ''); |
186 | - if($modx->hasPermission('edit_document')) { |
|
187 | - $title = '<span class="doc-item' . $private . '">' . $icon . '<a href="index.php?a=27&id=' . $children['id'] . $add_path . '">' . '<span class="' . $class . '">' . entities($children['pagetitle'], $modx->getConfig('modx_charset')) . '</span></a></span>'; |
|
186 | + if ($modx->hasPermission('edit_document')) { |
|
187 | + $title = '<span class="doc-item'.$private.'">'.$icon.'<a href="index.php?a=27&id='.$children['id'].$add_path.'">'.'<span class="'.$class.'">'.entities($children['pagetitle'], $modx->getConfig('modx_charset')).'</span></a></span>'; |
|
188 | 188 | } else { |
189 | - $title = '<span class="doc-item' . $private . '">' . $icon . '<span class="' . $class . '">' . entities($children['pagetitle'], $modx->getConfig('modx_charset')) . '</span></span>'; |
|
189 | + $title = '<span class="doc-item'.$private.'">'.$icon.'<span class="'.$class.'">'.entities($children['pagetitle'], $modx->getConfig('modx_charset')).'</span></span>'; |
|
190 | 190 | } |
191 | 191 | |
192 | - $icon_pub_unpub = (!$children['published']) ? '<a href="index.php?a=61&id=' . $children['id'] . $add_path . '" title="' . $_lang["publish_resource"] . '"><i class="' . $_style["icons_publish_document"] . '"></i></a>' : '<a href="index.php?a=62&id=' . $children['id'] . $add_path . '" title="' . $_lang["unpublish_resource"] . '"><i class="' . $_style["icons_unpublish_resource"] . '" ></i></a>'; |
|
192 | + $icon_pub_unpub = (!$children['published']) ? '<a href="index.php?a=61&id='.$children['id'].$add_path.'" title="'.$_lang["publish_resource"].'"><i class="'.$_style["icons_publish_document"].'"></i></a>' : '<a href="index.php?a=62&id='.$children['id'].$add_path.'" title="'.$_lang["unpublish_resource"].'"><i class="'.$_style["icons_unpublish_resource"].'" ></i></a>'; |
|
193 | 193 | |
194 | - $icon_del_undel = (!$children['deleted']) ? '<a onclick="return confirm(\'' . $_lang["confirm_delete_resource"] . '\')" href="index.php?a=6&id=' . $children['id'] . $add_path . '" title="' . $_lang['delete_resource'] . '"><i class="' . $_style["icons_delete_resource"] . '"></i></a>' : '<a onclick="return confirm(\'' . $_lang["confirm_undelete"] . '\')" href="index.php?a=63&id=' . $children['id'] . $add_path . '" title="' . $_lang['undelete_resource'] . '"><i class="' . $_style["icons_undelete_resource"] . '"></i></a>'; |
|
194 | + $icon_del_undel = (!$children['deleted']) ? '<a onclick="return confirm(\''.$_lang["confirm_delete_resource"].'\')" href="index.php?a=6&id='.$children['id'].$add_path.'" title="'.$_lang['delete_resource'].'"><i class="'.$_style["icons_delete_resource"].'"></i></a>' : '<a onclick="return confirm(\''.$_lang["confirm_undelete"].'\')" href="index.php?a=63&id='.$children['id'].$add_path.'" title="'.$_lang['undelete_resource'].'"><i class="'.$_style["icons_undelete_resource"].'"></i></a>'; |
|
195 | 195 | |
196 | 196 | $listDocs[] = array( |
197 | - 'docid' => '<div class="text-right">' . $children['id'] . '</div>', |
|
197 | + 'docid' => '<div class="text-right">'.$children['id'].'</div>', |
|
198 | 198 | 'title' => $title, |
199 | - 'createdon' => '<div class="text-right">' . ($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')) . '</div>', |
|
200 | - 'pub_date' => '<div class="text-right">' . ($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '') . '</div>', |
|
201 | - 'status' => '<div class="text-nowrap">' . ($children['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publishedDoc">' . $_lang['page_data_published'] . '</span>') . '</div>', |
|
202 | - 'edit' => '<div class="actions text-center text-nowrap">' . ($modx->hasPermission('edit_document') ? '<a href="index.php?a=27&id=' . $children['id'] . $add_path . '" title="' . $_lang['edit'] . '"><i class="' . $_style["icons_edit_resource"] . '"></i></a><a href="index.php?a=51&id=' . $children['id'] . $add_path . '" title="' . $_lang['move'] . '"><i |
|
203 | - class="' . $_style["icons_move_document"] . '"></i></a>' . $icon_pub_unpub : '') . ($modx->hasPermission('delete_document') ? $icon_del_undel : '') . '</div>' |
|
199 | + 'createdon' => '<div class="text-right">'.($modx->toDateFormat($children['createdon'] + $server_offset_time, 'dateOnly')).'</div>', |
|
200 | + 'pub_date' => '<div class="text-right">'.($children['pub_date'] ? ($modx->toDateFormat($children['pub_date'] + $server_offset_time, 'dateOnly')) : '').'</div>', |
|
201 | + 'status' => '<div class="text-nowrap">'.($children['published'] == 0 ? '<span class="unpublishedDoc">'.$_lang['page_data_unpublished'].'</span>' : '<span class="publishedDoc">'.$_lang['page_data_published'].'</span>').'</div>', |
|
202 | + 'edit' => '<div class="actions text-center text-nowrap">'.($modx->hasPermission('edit_document') ? '<a href="index.php?a=27&id='.$children['id'].$add_path.'" title="'.$_lang['edit'].'"><i class="'.$_style["icons_edit_resource"].'"></i></a><a href="index.php?a=51&id='.$children['id'].$add_path.'" title="'.$_lang['move'].'"><i |
|
203 | + class="' . $_style["icons_move_document"].'"></i></a>'.$icon_pub_unpub : '').($modx->hasPermission('delete_document') ? $icon_del_undel : '').'</div>' |
|
204 | 204 | ); |
205 | 205 | } |
206 | 206 | |
207 | - $modx->getMakeTable()->createPagingNavigation($numRecords, 'a=3&id=' . $content['id'] . '&dir=' . $dir . '&sort=' . $sort); |
|
208 | - $children_output = $modx->getMakeTable()->create($listDocs, $listTableHeader, 'index.php?a=3&id=' . $content['id']); |
|
207 | + $modx->getMakeTable()->createPagingNavigation($numRecords, 'a=3&id='.$content['id'].'&dir='.$dir.'&sort='.$sort); |
|
208 | + $children_output = $modx->getMakeTable()->create($listDocs, $listTableHeader, 'index.php?a=3&id='.$content['id']); |
|
209 | 209 | } else { |
210 | 210 | // No Child documents |
211 | - $children_output = '<div class="container"><p>' . $_lang['resources_in_container_no'] . '</p></div>'; |
|
211 | + $children_output = '<div class="container"><p>'.$_lang['resources_in_container_no'].'</p></div>'; |
|
212 | 212 | } |
213 | 213 | ?> |
214 | 214 | <script type="text/javascript"> |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | }, |
235 | 235 | cancel: function() { |
236 | 236 | documentDirty = false; |
237 | - document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id=' . $id . $add_path) ?>'; |
|
237 | + document.location.href = 'index.php?<?=($id == 0 ? 'a=2' : 'a=3&r=1&id='.$id.$add_path) ?>'; |
|
238 | 238 | }, |
239 | 239 | move: function() { |
240 | 240 | document.location.href = "index.php?id=<?= $_REQUEST['id'] ?>&a=51"; |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | } |
246 | 246 | }, |
247 | 247 | view: function() { |
248 | - window.open('<?= ($modx->getConfig('friendly_urls')) ? UrlProcessor::makeUrl($id) : MODX_SITE_URL . 'index.php?id=' . $id ?>', 'previeWin'); |
|
248 | + window.open('<?= ($modx->getConfig('friendly_urls')) ? UrlProcessor::makeUrl($id) : MODX_SITE_URL.'index.php?id='.$id ?>', 'previeWin'); |
|
249 | 249 | } |
250 | 250 | }; |
251 | 251 | |
@@ -253,7 +253,7 @@ discard block |
||
253 | 253 | <script type="text/javascript" src="media/script/tablesort.js"></script> |
254 | 254 | |
255 | 255 | <h1> |
256 | - <i class="fa fa-info"></i><?= entities(iconv_substr($content['pagetitle'], 0, 50, $modx->getConfig('modx_charset')), $modx->getConfig('modx_charset')) . (iconv_strlen($content['pagetitle'], $modx->getConfig('modx_charset')) > 50 ? '...' : '') . ' <small>(' . (int)$_REQUEST['id'] . ')</small>' ?> |
|
256 | + <i class="fa fa-info"></i><?= entities(iconv_substr($content['pagetitle'], 0, 50, $modx->getConfig('modx_charset')), $modx->getConfig('modx_charset')).(iconv_strlen($content['pagetitle'], $modx->getConfig('modx_charset')) > 50 ? '...' : '').' <small>('.(int) $_REQUEST['id'].')</small>' ?> |
|
257 | 257 | </h1> |
258 | 258 | |
259 | 259 | <?= $_style['actionbuttons']['static']['document'] ?> |
@@ -280,16 +280,16 @@ discard block |
||
280 | 280 | <tr> |
281 | 281 | <td width="200" valign="top">{{ ManagerTheme::getLexicon('long_title') }}:</td> |
282 | 282 | <td> |
283 | - <small><?= $content['longtitle'] != '' ? entities($content['longtitle'], $modx->getConfig('modx_charset')) : "(<i>" . $_lang['not_set'] . "</i>)" ?></small> |
|
283 | + <small><?= $content['longtitle'] != '' ? entities($content['longtitle'], $modx->getConfig('modx_charset')) : "(<i>".$_lang['not_set']."</i>)" ?></small> |
|
284 | 284 | </td> |
285 | 285 | </tr> |
286 | 286 | <tr> |
287 | 287 | <td valign="top">{{ ManagerTheme::getLexicon('resource_description') }}:</td> |
288 | - <td><?= $content['description'] != '' ? entities($content['description'], $modx->getConfig('modx_charset')) : "(<i>" . $_lang['not_set'] . "</i>)" ?></td> |
|
288 | + <td><?= $content['description'] != '' ? entities($content['description'], $modx->getConfig('modx_charset')) : "(<i>".$_lang['not_set']."</i>)" ?></td> |
|
289 | 289 | </tr> |
290 | 290 | <tr> |
291 | 291 | <td valign="top">{{ ManagerTheme::getLexicon('resource_summary') }}:</td> |
292 | - <td><?= $content['introtext'] != '' ? entities($content['introtext'], $modx->getConfig('modx_charset')) : "(<i>" . $_lang['not_set'] . "</i>)" ?></td> |
|
292 | + <td><?= $content['introtext'] != '' ? entities($content['introtext'], $modx->getConfig('modx_charset')) : "(<i>".$_lang['not_set']."</i>)" ?></td> |
|
293 | 293 | </tr> |
294 | 294 | <tr> |
295 | 295 | <td valign="top">{{ ManagerTheme::getLexicon('type') }}:</td> |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | </tr> |
298 | 298 | <tr> |
299 | 299 | <td valign="top">{{ ManagerTheme::getLexicon('resource_alias') }}:</td> |
300 | - <td><?= $content['alias'] != '' ? entities($content['alias'], $modx->getConfig('modx_charset')) : "(<i>" . $_lang['not_set'] . "</i>)" ?></td> |
|
300 | + <td><?= $content['alias'] != '' ? entities($content['alias'], $modx->getConfig('modx_charset')) : "(<i>".$_lang['not_set']."</i>)" ?></td> |
|
301 | 301 | </tr> |
302 | 302 | <tr> |
303 | 303 | <td colspan="2"> </td> |
@@ -310,7 +310,7 @@ discard block |
||
310 | 310 | <td><?= $modx->toDateFormat($content['createdon'] + $server_offset_time) ?> (<b><?= entities($createdbyname, $modx->getConfig('modx_charset')) ?></b>) |
311 | 311 | </td> |
312 | 312 | </tr> |
313 | - <?php if($editedbyname != '') { ?> |
|
313 | + <?php if ($editedbyname != '') { ?> |
|
314 | 314 | <tr> |
315 | 315 | <td>{{ ManagerTheme::getLexicon('page_data_edited') }}:</td> |
316 | 316 | <td><?= $modx->toDateFormat($content['editedon'] + $server_offset_time) ?> (<b><?= entities($editedbyname, $modx->getConfig('modx_charset')) ?></b>) |
@@ -325,15 +325,15 @@ discard block |
||
325 | 325 | </tr> |
326 | 326 | <tr> |
327 | 327 | <td>{{ ManagerTheme::getLexicon('page_data_status') }}:</td> |
328 | - <td><?= $content['published'] == 0 ? '<span class="unpublishedDoc">' . $_lang['page_data_unpublished'] . '</span>' : '<span class="publisheddoc">' . $_lang['page_data_published'] . '</span>' ?></td> |
|
328 | + <td><?= $content['published'] == 0 ? '<span class="unpublishedDoc">'.$_lang['page_data_unpublished'].'</span>' : '<span class="publisheddoc">'.$_lang['page_data_published'].'</span>' ?></td> |
|
329 | 329 | </tr> |
330 | 330 | <tr> |
331 | 331 | <td>{{ ManagerTheme::getLexicon('page_data_publishdate') }}:</td> |
332 | - <td><?= $content['pub_date'] == 0 ? "(<i>" . $_lang['not_set'] . "</i>)" : $modx->toDateFormat($content['pub_date']) ?></td> |
|
332 | + <td><?= $content['pub_date'] == 0 ? "(<i>".$_lang['not_set']."</i>)" : $modx->toDateFormat($content['pub_date']) ?></td> |
|
333 | 333 | </tr> |
334 | 334 | <tr> |
335 | 335 | <td>{{ ManagerTheme::getLexicon('page_data_unpublishdate') }}:</td> |
336 | - <td><?= $content['unpub_date'] == 0 ? "(<i>" . $_lang['not_set'] . "</i>)" : $modx->toDateFormat($content['unpub_date']) ?></td> |
|
336 | + <td><?= $content['unpub_date'] == 0 ? "(<i>".$_lang['not_set']."</i>)" : $modx->toDateFormat($content['unpub_date']) ?></td> |
|
337 | 337 | </tr> |
338 | 338 | <tr> |
339 | 339 | <td>{{ ManagerTheme::getLexicon('page_data_cacheable') }}:</td> |
@@ -353,11 +353,11 @@ discard block |
||
353 | 353 | </tr> |
354 | 354 | <tr> |
355 | 355 | <td>{{ ManagerTheme::getLexicon('page_data_web_access') }}:</td> |
356 | - <td><?= $content['privateweb'] == 0 ? $_lang['public'] : '<b style="color: #821517">' . $_lang['private'] . '</b> ' . $_style["icons_secured"] ?></td> |
|
356 | + <td><?= $content['privateweb'] == 0 ? $_lang['public'] : '<b style="color: #821517">'.$_lang['private'].'</b> '.$_style["icons_secured"] ?></td> |
|
357 | 357 | </tr> |
358 | 358 | <tr> |
359 | 359 | <td>{{ ManagerTheme::getLexicon('page_data_mgr_access') }}:</td> |
360 | - <td><?= $content['privatemgr'] == 0 ? $_lang['public'] : '<b style="color: #821517">' . $_lang['private'] . '</b> ' . $_style["icons_secured"] ?></td> |
|
360 | + <td><?= $content['privatemgr'] == 0 ? $_lang['public'] : '<b style="color: #821517">'.$_lang['private'].'</b> '.$_style["icons_secured"] ?></td> |
|
361 | 361 | </tr> |
362 | 362 | <tr> |
363 | 363 | <td colspan="2"> </td> |
@@ -387,13 +387,13 @@ discard block |
||
387 | 387 | <script type="text/javascript">docSettings.addTabPage(document.getElementById("tabChildren"));</script> |
388 | 388 | <div class="container container-body"> |
389 | 389 | <div class="form-group clearfix"> |
390 | - <?php if($numRecords > 0) : ?> |
|
390 | + <?php if ($numRecords > 0) : ?> |
|
391 | 391 | <div class="float-xs-left"> |
392 | - <span class="publishedDoc"><?= $numRecords . ' ' . $_lang['resources_in_container'] ?> (<strong><?= entities($content['pagetitle'], $modx->getConfig('modx_charset')) ?></strong>)</span> |
|
392 | + <span class="publishedDoc"><?= $numRecords.' '.$_lang['resources_in_container'] ?> (<strong><?= entities($content['pagetitle'], $modx->getConfig('modx_charset')) ?></strong>)</span> |
|
393 | 393 | </div> |
394 | 394 | <?php endif; ?> |
395 | 395 | <div class="float-xs-right"> |
396 | - <?= $filter_sort . ' ' . $filter_dir ?> |
|
396 | + <?= $filter_sort.' '.$filter_dir ?> |
|
397 | 397 | </div> |
398 | 398 | |
399 | 399 | </div> |
@@ -410,16 +410,16 @@ discard block |
||
410 | 410 | <script type="text/javascript">docSettings.addTabPage(document.getElementById("tabSource"));</script> |
411 | 411 | <?php |
412 | 412 | $buffer = ""; |
413 | - $filename = MODX_BASE_PATH . "assets/cache/docid_" . $id . ".pageCache.php"; |
|
413 | + $filename = MODX_BASE_PATH."assets/cache/docid_".$id.".pageCache.php"; |
|
414 | 414 | $handle = @fopen($filename, "r"); |
415 | - if(!$handle) { |
|
416 | - $buffer = '<div class="container container-body">' . $_lang['page_data_notcached'] . '</div>'; |
|
415 | + if (!$handle) { |
|
416 | + $buffer = '<div class="container container-body">'.$_lang['page_data_notcached'].'</div>'; |
|
417 | 417 | } else { |
418 | - while(!feof($handle)) { |
|
418 | + while (!feof($handle)) { |
|
419 | 419 | $buffer .= fgets($handle, 4096); |
420 | 420 | } |
421 | 421 | fclose($handle); |
422 | - $buffer = '<div class="navbar navbar-editor">' . $_lang['page_data_cached'] . '</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">' . $modx->getPhpCompat()->htmlspecialchars($buffer) . "</textarea></div>\n"; |
|
422 | + $buffer = '<div class="navbar navbar-editor">'.$_lang['page_data_cached'].'</div><div class="section-editor clearfix"><textarea rows="20" wrap="soft">'.$modx->getPhpCompat()->htmlspecialchars($buffer)."</textarea></div>\n"; |
|
423 | 423 | } |
424 | 424 | echo $buffer; |
425 | 425 | ?> |
@@ -636,7 +636,7 @@ discard block |
||
636 | 636 | echoEventRows($evtnames); |
637 | 637 | } |
638 | 638 | echo '<hr class="clear">'; |
639 | - echo '<div class="form-group"><b>' . $services[$srv - 1] . '</b></div>'; |
|
639 | + echo '<div class="form-group"><b>'.$services[$srv - 1].'</b></div>'; |
|
640 | 640 | } |
641 | 641 | // display group name |
642 | 642 | if ($grp != $row['groupname']) { |
@@ -645,9 +645,9 @@ discard block |
||
645 | 645 | echoEventRows($evtnames); |
646 | 646 | } |
647 | 647 | echo '<hr class="clear">'; |
648 | - echo '<div class="form-group"><b>' . $row['groupname'] . '</b></div>'; |
|
648 | + echo '<div class="form-group"><b>'.$row['groupname'].'</b></div>'; |
|
649 | 649 | } |
650 | - $evtnames[] = '<input name="sysevents[]" id="' . $row['name'] . '" type="checkbox" ' . (in_array($row['id'], $evts) ? ' checked="checked" ' : '') . 'class="inputBox" value="' . $row['id'] . '" /> <label for="' . $row['name'] . '" ' . bold(in_array($row['id'], $evts)) . '> ' . $row['name'] . '</label>' . "\n"; |
|
650 | + $evtnames[] = '<input name="sysevents[]" id="'.$row['name'].'" type="checkbox" '.(in_array($row['id'], $evts) ? ' checked="checked" ' : '').'class="inputBox" value="'.$row['id'].'" /> <label for="'.$row['name'].'" '.bold(in_array($row['id'], $evts)).'> '.$row['name'].'</label>'."\n"; |
|
651 | 651 | if (count($evtnames) == 2) { |
652 | 652 | echoEventRows($evtnames); |
653 | 653 | } |
@@ -4,7 +4,7 @@ discard block |
||
4 | 4 | <?php |
5 | 5 | unset($_SESSION['itemname']); // clear this, because it's only set for logging purposes |
6 | 6 | |
7 | - if($modx->hasPermission('settings') && $modx->getConfig('settings_version') !== $modx->getVersionData('version')) { |
|
7 | + if ($modx->hasPermission('settings') && $modx->getConfig('settings_version') !== $modx->getVersionData('version')) { |
|
8 | 8 | // seems to be a new install - send the user to the configuration page |
9 | 9 | exit('<script type="text/javascript">document.location.href="index.php?a=17";</script>'); |
10 | 10 | } |
@@ -15,16 +15,16 @@ discard block |
||
15 | 15 | $_SESSION['nrnewmessages'] = 0; |
16 | 16 | |
17 | 17 | // setup message info |
18 | - if($modx->hasPermission('messages')) { |
|
19 | - include_once(MODX_MANAGER_PATH . 'includes/messageCount.inc.php'); |
|
18 | + if ($modx->hasPermission('messages')) { |
|
19 | + include_once(MODX_MANAGER_PATH.'includes/messageCount.inc.php'); |
|
20 | 20 | $_SESSION['nrtotalmessages'] = $nrtotalmessages; |
21 | 21 | $_SESSION['nrnewmessages'] = $nrnewmessages; |
22 | 22 | |
23 | 23 | $msg = array(); |
24 | 24 | $msg[] = sprintf('<a href="index.php?a=10" target="main"><img src="%s" /></a>', $_style['icons_mail_large']); |
25 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">' . $_SESSION['nrnewmessages'] . '</span>)' : ''; |
|
25 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? ' (<span style="color:red">'.$_SESSION['nrnewmessages'].'</span>)' : ''; |
|
26 | 26 | $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); |
27 | - $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">' . $_SESSION['nrnewmessages'] . '</span>' : '0'; |
|
27 | + $nrnewmessages = $_SESSION['nrnewmessages'] > 0 ? '<span style="color:red;">'.$_SESSION['nrnewmessages'].'</span>' : '0'; |
|
28 | 28 | $welcome_messages = sprintf($_lang['welcome_messages'], $_SESSION['nrtotalmessages'], $nrnewmessages); |
29 | 29 | $msg[] = sprintf('<span class="comment">%s</span>', $welcome_messages); |
30 | 30 | $ph['MessageInfo'] = implode("\n", $msg); |
@@ -32,56 +32,56 @@ discard block |
||
32 | 32 | |
33 | 33 | $iconTpl = $modx->getChunk('manager#welcome\WrapIcon'); |
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 | - $ph['SecurityIcon'] = sprintf($iconTpl,$icon, 75); |
|
37 | + $ph['SecurityIcon'] = sprintf($iconTpl, $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 | - $ph['WebUserIcon'] = sprintf($iconTpl,$icon, 99); |
|
41 | + $ph['WebUserIcon'] = sprintf($iconTpl, $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 | - $ph['ModulesIcon'] = sprintf($iconTpl,$icon, 106); |
|
45 | + $ph['ModulesIcon'] = sprintf($iconTpl, $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 | - $ph['ResourcesIcon'] = sprintf($iconTpl,$icon, 76); |
|
49 | + $ph['ResourcesIcon'] = sprintf($iconTpl, $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 | - $ph['BackupIcon'] = sprintf($iconTpl,$icon, 93); |
|
53 | + $ph['BackupIcon'] = sprintf($iconTpl, $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 | - $ph['HelpIcon'] = sprintf($iconTpl,$icon, 9); |
|
57 | + $ph['HelpIcon'] = sprintf($iconTpl, $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 | - $ph['ResourceIcon'] = sprintf($iconTpl,$icon, 4); |
|
62 | + $ph['ResourceIcon'] = sprintf($iconTpl, $icon, 4); |
|
63 | 63 | $icon = '<i class="[&icons_weblink_large&]"></i>[%add_weblink%]'; |
64 | - $ph['WeblinkIcon'] = sprintf($iconTpl,$icon, 72); |
|
64 | + $ph['WeblinkIcon'] = sprintf($iconTpl, $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 | - $ph['ImagesIcon'] = sprintf($iconTpl,$icon, 72); |
|
68 | + $ph['ImagesIcon'] = sprintf($iconTpl, $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 | - $ph['FilesIcon'] = sprintf($iconTpl,$icon, 72); |
|
72 | + $ph['FilesIcon'] = sprintf($iconTpl, $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 | - $ph['PasswordIcon'] = sprintf($iconTpl,$icon, 28); |
|
76 | + $ph['PasswordIcon'] = sprintf($iconTpl, $icon, 28); |
|
77 | 77 | } |
78 | 78 | $icon = '<i class="[&icons_logout_large&]"></i>[%logout%]'; |
79 | - $ph['LogoutIcon'] = sprintf($iconTpl,$icon, 8); |
|
79 | + $ph['LogoutIcon'] = sprintf($iconTpl, $icon, 8); |
|
80 | 80 | |
81 | 81 | // do some config checks |
82 | - if($modx->getConfig('warning_visibility') || $_SESSION['mgrRole'] == 1) { |
|
83 | - include_once(MODX_MANAGER_PATH . 'includes/config_check.inc.php'); |
|
84 | - if($config_check_results != $_lang['configcheck_ok']) { |
|
82 | + if ($modx->getConfig('warning_visibility') || $_SESSION['mgrRole'] == 1) { |
|
83 | + include_once(MODX_MANAGER_PATH.'includes/config_check.inc.php'); |
|
84 | + if ($config_check_results != $_lang['configcheck_ok']) { |
|
85 | 85 | $ph['config_check_results'] = $config_check_results; |
86 | 86 | $ph['config_display'] = 'block'; |
87 | 87 | } else { |
@@ -92,8 +92,8 @@ discard block |
||
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']); |
@@ -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(), |
@@ -159,10 +159,10 @@ discard block |
||
159 | 159 | |
160 | 160 | $from = array(); |
161 | 161 | $from[] = $modx->getDatabase()->getFullTableName('active_user_sessions'); |
162 | - $from[] = " us LEFT JOIN " . $modx->getDatabase()->getFullTableName('active_users') . " au ON au.sid=us.sid WHERE au.action <> '8'"; |
|
162 | + $from[] = " us LEFT JOIN ".$modx->getDatabase()->getFullTableName('active_users')." au ON au.sid=us.sid WHERE au.action <> '8'"; |
|
163 | 163 | $rs = $modx->getDatabase()->select('*', $from, '', 'username ASC, au.sid ASC'); |
164 | 164 | |
165 | - if($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
165 | + if ($modx->getDatabase()->getRecordCount($rs) < 1) { |
|
166 | 166 | $html = '<p>[%no_active_users_found%]</p>'; |
167 | 167 | } else { |
168 | 168 | $now = $modx->timestamp($_SERVER['REQUEST_TIME']); |
@@ -189,7 +189,7 @@ discard block |
||
189 | 189 | $userList = array(); |
190 | 190 | $userCount = array(); |
191 | 191 | // Create userlist with session-count first before output |
192 | - while($activeusers = $modx->getDatabase()->getRow($rs)) { |
|
192 | + while ($activeusers = $modx->getDatabase()->getRow($rs)) { |
|
193 | 193 | $userCount[$activeusers['internalKey']] = isset($userCount[$activeusers['internalKey']]) ? $userCount[$activeusers['internalKey']] + 1 : 1; |
194 | 194 | |
195 | 195 | $idle = $activeusers['lasthit'] < $timetocheck ? ' class="userIdle"' : ''; |
@@ -207,9 +207,9 @@ discard block |
||
207 | 207 | $currentaction |
208 | 208 | ); |
209 | 209 | } |
210 | - foreach($userList as $params) { |
|
210 | + foreach ($userList as $params) { |
|
211 | 211 | $params[1] = $userCount[$params[4]] > 1 ? ' class="userMultipleSessions"' : ''; |
212 | - $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); |
|
212 | + $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 | 213 | } |
214 | 214 | |
215 | 215 | $html .= ' |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | $output = ''; |
237 | 237 | $items = fetchRssChannelItems($url); |
238 | 238 | if (empty($items)) { |
239 | - $feedData[$section] = 'Failed to retrieve ' . $url; |
|
239 | + $feedData[$section] = 'Failed to retrieve '.$url; |
|
240 | 240 | continue; |
241 | 241 | } |
242 | 242 | $output .= '<ul>'; |
@@ -250,9 +250,9 @@ discard block |
||
250 | 250 | $description = strip_tags($item['description']); |
251 | 251 | if (strlen($description) > 199) { |
252 | 252 | $description = substr($description, 0, 200); |
253 | - $description .= '...<br />Read <a href="' . $href . '" target="_blank">more</a>.'; |
|
253 | + $description .= '...<br />Read <a href="'.$href.'" target="_blank">more</a>.'; |
|
254 | 254 | } |
255 | - $output .= '<li><a href="' . $href . '" target="_blank">' . $title . '</a> - <b>' . $pubdate . '</b><br />' . $description . '</li>'; |
|
255 | + $output .= '<li><a href="'.$href.'" target="_blank">'.$title.'</a> - <b>'.$pubdate.'</b><br />'.$description.'</li>'; |
|
256 | 256 | } |
257 | 257 | |
258 | 258 | $output .= '</ul>'; |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | |
289 | 289 | // invoke event OnManagerWelcomePrerender |
290 | 290 | $evtOut = $modx->invokeEvent('OnManagerWelcomePrerender'); |
291 | - if(is_array($evtOut)) { |
|
291 | + if (is_array($evtOut)) { |
|
292 | 292 | $output = implode('', $evtOut); |
293 | 293 | $ph['OnManagerWelcomePrerender'] = $output; |
294 | 294 | } |
@@ -314,7 +314,7 @@ discard block |
||
314 | 314 | <span>[%add_weblink%]</span> |
315 | 315 | </a> |
316 | 316 | </span> |
317 | - ' : '') . |
|
317 | + ' : ''). |
|
318 | 318 | ($modx->hasPermission("assets_images") ? ' |
319 | 319 | <span class="wm_button"> |
320 | 320 | <a target="main" href="media/browser/mcpuk/browse.php?filemanager=media/browser/mcpuk/browse.php&type=images"> |
@@ -322,7 +322,7 @@ discard block |
||
322 | 322 | <span>[%images_management%]</span> |
323 | 323 | </a> |
324 | 324 | </span> |
325 | - ' : '') . |
|
325 | + ' : ''). |
|
326 | 326 | ($modx->hasPermission("assets_files") ? ' |
327 | 327 | <span class="wm_button"> |
328 | 328 | <a target="main" href="media/browser/mcpuk/browse.php?filemanager=media/browser/mcpuk/browse.php&type=files"> |
@@ -330,7 +330,7 @@ discard block |
||
330 | 330 | <span>[%files_management%]</span> |
331 | 331 | </a> |
332 | 332 | </span> |
333 | - ' : '') . |
|
333 | + ' : ''). |
|
334 | 334 | ($modx->hasPermission("change_password") ? ' |
335 | 335 | <span class="wm_button"> |
336 | 336 | <a target="main" href="index.php?a=28"> |
@@ -338,7 +338,7 @@ discard block |
||
338 | 338 | <span>[%change_password%]</span> |
339 | 339 | </a> |
340 | 340 | </span> |
341 | - ' : '') . ' |
|
341 | + ' : '').' |
|
342 | 342 | <span class="wm_button"> |
343 | 343 | <a target="_top" href="index.php?a=8"> |
344 | 344 | <i class="[&icons_logout_large&]"></i> |
@@ -350,7 +350,7 @@ discard block |
||
350 | 350 | <table> |
351 | 351 | <tr> |
352 | 352 | <td width="150">[%yourinfo_username%]</td> |
353 | - <td><b>' . $modx->getLoginUserName() . '</b></td> |
|
353 | + <td><b>' . $modx->getLoginUserName().'</b></td> |
|
354 | 354 | </tr> |
355 | 355 | <tr> |
356 | 356 | <td>[%yourinfo_role%]</td> |
@@ -367,9 +367,9 @@ discard block |
||
367 | 367 | ($modx->hasPermission("change_password") ? ' |
368 | 368 | <tr> |
369 | 369 | <td>[%inbox%]</td> |
370 | - <td><a href="index.php?a=10" target="main"><b>' . ($_SESSION["nrtotalmessages"] ? sprintf($_lang["welcome_messages"], $_SESSION["nrtotalmessages"], '<span style="color:red;">' . $_SESSION["nrnewmessages"] . "</span>") : $_lang["messages_no_messages"]) . '</b></a></td> |
|
370 | + <td><a href="index.php?a=10" target="main"><b>' . ($_SESSION["nrtotalmessages"] ? sprintf($_lang["welcome_messages"], $_SESSION["nrtotalmessages"], '<span style="color:red;">'.$_SESSION["nrnewmessages"]."</span>") : $_lang["messages_no_messages"]).'</b></a></td> |
|
371 | 371 | </tr> |
372 | - ' : '') . ' |
|
372 | + ' : '').' |
|
373 | 373 | </table> |
374 | 374 | </div> |
375 | 375 | ', |
@@ -418,22 +418,22 @@ discard block |
||
418 | 418 | |
419 | 419 | // invoke OnManagerWelcomeHome event |
420 | 420 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); |
421 | - if(is_array($sitewidgets)) { |
|
421 | + if (is_array($sitewidgets)) { |
|
422 | 422 | $newwidgets = array(); |
423 | - foreach($sitewidgets as $widget){ |
|
423 | + foreach ($sitewidgets as $widget) { |
|
424 | 424 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
425 | 425 | } |
426 | 426 | $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; |
427 | 427 | } |
428 | 428 | |
429 | - usort($widgets, function ($a, $b) { |
|
429 | + usort($widgets, function($a, $b){ |
|
430 | 430 | return $a['menuindex'] - $b['menuindex']; |
431 | 431 | }); |
432 | 432 | |
433 | 433 | $tpl = $modx->getChunk('manager#welcome\Widget'); |
434 | 434 | $output = ''; |
435 | - foreach($widgets as $widget) { |
|
436 | - if ($widget['hide'] != '1'){ |
|
435 | + foreach ($widgets as $widget) { |
|
436 | + if ($widget['hide'] != '1') { |
|
437 | 437 | $output .= $modx->parseText($tpl, $widget); |
438 | 438 | } |
439 | 439 | } |
@@ -420,20 +420,20 @@ |
||
420 | 420 | $sitewidgets = $modx->invokeEvent("OnManagerWelcomeHome", array('widgets' => $widgets)); |
421 | 421 | if(is_array($sitewidgets)) { |
422 | 422 | $newwidgets = array(); |
423 | - foreach($sitewidgets as $widget){ |
|
423 | + foreach($sitewidgets as $widget) { |
|
424 | 424 | $newwidgets = array_merge($newwidgets, unserialize($widget)); |
425 | 425 | } |
426 | 426 | $widgets = (count($newwidgets) > 0) ? $newwidgets : $widgets; |
427 | 427 | } |
428 | 428 | |
429 | - usort($widgets, function ($a, $b) { |
|
429 | + usort($widgets, function ($a, $b){ |
|
430 | 430 | return $a['menuindex'] - $b['menuindex']; |
431 | 431 | }); |
432 | 432 | |
433 | 433 | $tpl = $modx->getChunk('manager#welcome\Widget'); |
434 | 434 | $output = ''; |
435 | 435 | foreach($widgets as $widget) { |
436 | - if ($widget['hide'] != '1'){ |
|
436 | + if ($widget['hide'] != '1') { |
|
437 | 437 | $output .= $modx->parseText($tpl, $widget); |
438 | 438 | } |
439 | 439 | } |
@@ -132,7 +132,7 @@ discard block |
||
132 | 132 | <?php |
133 | 133 | $ds = $modx->getDatabase()->select("el.id, ELT(el.type , 'text-info fa fa-info-circle' , 'text-warning fa fa-exclamation-triangle' , 'text-danger fa fa-times-circle' ) as icon, el.createdon, el.source, el.eventid,IFNULL(wu.username,mu.username) as username", "{$tbl_event_log} AS el |
134 | 134 | LEFT JOIN {$tbl_manager_users} AS mu ON mu.id=el.user AND el.usertype=0 |
135 | - LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "" . (is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '') . "(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC"); |
|
135 | + LEFT JOIN {$tbl_web_users} AS wu ON wu.id=el.user AND el.usertype=1", ($sqlQuery ? "".(is_numeric($sqlQuery) ? "(eventid='{$sqlQuery}') OR " : '')."(source LIKE '%{$sqlQuery}%') OR (description LIKE '%{$sqlQuery}%')" : ""), "createdon DESC"); |
|
136 | 136 | $grd = new \EvolutionCMS\Support\DataGrid('', $ds, $number_of_results); // set page size to 0 t show all items |
137 | 137 | $grd->pagerClass = ''; |
138 | 138 | $grd->pageClass = 'page-item'; |
@@ -143,10 +143,10 @@ discard block |
||
143 | 143 | $grd->itemClass = "tableItem"; |
144 | 144 | $grd->altItemClass = "tableAltItem"; |
145 | 145 | $grd->fields = "type,source,createdon,eventid,username"; |
146 | - $grd->columns = ManagerTheme::getLexicon('type') . " ," . ManagerTheme::getLexicon('source') . " ," . ManagerTheme::getLexicon('date') . " ," . ManagerTheme::getLexicon('event_id') . " ," . ManagerTheme::getLexicon('sysinfo_userid'); |
|
146 | + $grd->columns = ManagerTheme::getLexicon('type')." ,".ManagerTheme::getLexicon('source')." ,".ManagerTheme::getLexicon('date')." ,".ManagerTheme::getLexicon('event_id')." ,".ManagerTheme::getLexicon('sysinfo_userid'); |
|
147 | 147 | $grd->colWidths = "1%,,1%,1%,1%"; |
148 | 148 | $grd->colAligns = "center,,,center,center"; |
149 | - $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='" . ManagerTheme::getLexicon('click_to_context') . "'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='" . ManagerTheme::getLexicon('click_to_view_details') . "'>[+source+]</a>||date: " . $modx->toDateFormat(null, 'formatOnly') . ' %I:%M %p'; |
|
149 | + $grd->colTypes = "template:<a class='gridRowIcon' href='javascript:;' onclick='return showContentMenu([+id+],event);' title='".ManagerTheme::getLexicon('click_to_context')."'><i class='[+icon+]'></i></a>||template:<a href='index.php?a=115&id=[+id+]' title='".ManagerTheme::getLexicon('click_to_view_details')."'>[+source+]</a>||date: ".$modx->toDateFormat(null, 'formatOnly').' %I:%M %p'; |
|
150 | 150 | if ($listmode == '1') { |
151 | 151 | $grd->pageSize = 0; |
152 | 152 | } |
@@ -52,7 +52,7 @@ discard block |
||
52 | 52 | } |
53 | 53 | $mstart = memory_get_usage(); |
54 | 54 | |
55 | -if(mb_strtoupper($_SERVER['REQUEST_METHOD']) === 'GET' && count($_GET) === 1 && !empty($_GET['time'])) { |
|
55 | +if (mb_strtoupper($_SERVER['REQUEST_METHOD']) === 'GET' && count($_GET) === 1 && !empty($_GET['time'])) { |
|
56 | 56 | die(); |
57 | 57 | } |
58 | 58 | // we use this to make sure files are accessed through |
@@ -61,32 +61,32 @@ discard block |
||
61 | 61 | define('IN_MANAGER_MODE', true); |
62 | 62 | } |
63 | 63 | |
64 | -if (file_exists(__DIR__ . '/config.php')) { |
|
65 | - $config = require __DIR__ . '/config.php'; |
|
66 | -} elseif (file_exists(dirname(__DIR__) . '/config.php')) { |
|
67 | - $config = require dirname(__DIR__) . '/config.php'; |
|
64 | +if (file_exists(__DIR__.'/config.php')) { |
|
65 | + $config = require __DIR__.'/config.php'; |
|
66 | +} elseif (file_exists(dirname(__DIR__).'/config.php')) { |
|
67 | + $config = require dirname(__DIR__).'/config.php'; |
|
68 | 68 | } else { |
69 | 69 | $config = [ |
70 | - 'core' => dirname(__DIR__) . '/core' |
|
70 | + 'core' => dirname(__DIR__).'/core' |
|
71 | 71 | ]; |
72 | 72 | } |
73 | 73 | |
74 | -if (!empty($config['core']) && file_exists($config['core'] . '/bootstrap.php')) { |
|
75 | - require_once $config['core'] . '/bootstrap.php'; |
|
74 | +if (!empty($config['core']) && file_exists($config['core'].'/bootstrap.php')) { |
|
75 | + require_once $config['core'].'/bootstrap.php'; |
|
76 | 76 | } else { |
77 | 77 | echo "<h3>Unable to load configuration settings</h3>"; |
78 | 78 | echo "Please run the EVO <a href='../install'>install utility</a>"; |
79 | 79 | exit; |
80 | 80 | } |
81 | 81 | |
82 | -if (! isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
|
82 | +if (!isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) { |
|
83 | 83 | header('HTTP/1.0 404 Not Found'); |
84 | 84 | exit; |
85 | 85 | } |
86 | 86 | |
87 | 87 | // send anti caching headers |
88 | 88 | header('Expires: Mon, 26 Jul 1997 05:00:00 GMT'); |
89 | -header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); |
|
89 | +header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT'); |
|
90 | 90 | header('Cache-Control: no-store, no-cache, must-revalidate'); |
91 | 91 | header('Cache-Control: post-check=0, pre-check=0', false); |
92 | 92 | header('Pragma: no-cache'); |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | $_SERVER['PATH_INFO'], |
114 | 114 | "", |
115 | 115 | preg_replace("/\\\\/", "/", $_SERVER['PATH_TRANSLATED']) |
116 | - ) . "/"; |
|
116 | + )."/"; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | // initiate the content manager class |
@@ -125,12 +125,12 @@ discard block |
||
125 | 125 | //extract($settings, EXTR_OVERWRITE); |
126 | 126 | |
127 | 127 | // attempt to foil some simple types of CSRF attacks |
128 | -if ((int)$modx->getConfig('validate_referer') !== 0) { |
|
128 | +if ((int) $modx->getConfig('validate_referer') !== 0) { |
|
129 | 129 | if (isset($_SERVER['HTTP_REFERER'])) { |
130 | 130 | $referer = $_SERVER['HTTP_REFERER']; |
131 | 131 | |
132 | 132 | if (!empty($referer)) { |
133 | - if (!preg_match('/^' . preg_quote(MODX_SITE_URL, '/') . '/i', $referer)) { |
|
133 | + if (!preg_match('/^'.preg_quote(MODX_SITE_URL, '/').'/i', $referer)) { |
|
134 | 134 | $modx->webAlertAndQuit( |
135 | 135 | "A possible CSRF attempt was detected from referer: {$referer}.", |
136 | 136 | "index.php" |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | $_lang = ManagerTheme::getLexicon(); |
160 | 160 | |
161 | 161 | // send the charset header |
162 | -header('Content-Type: text/html; charset=' . ManagerTheme::getCharset()); |
|
162 | +header('Content-Type: text/html; charset='.ManagerTheme::getCharset()); |
|
163 | 163 | |
164 | 164 | // Update last action in table active_users |
165 | 165 | $action = ManagerTheme::getActionId(); |
@@ -190,7 +190,7 @@ discard block |
||
190 | 190 | $output = ManagerTheme::handle(1, ['frame' => 1]); |
191 | 191 | } else { |
192 | 192 | if ($modx->hasPermission('messages')) { |
193 | - include_once __DIR__ . '/includes/messageCount.inc.php'; |
|
193 | + include_once __DIR__.'/includes/messageCount.inc.php'; |
|
194 | 194 | } |
195 | 195 | } |
196 | 196 | } else { |
@@ -8,7 +8,7 @@ |
||
8 | 8 | |
9 | 9 | $load_script = file_get_contents(__DIR__.'/datepicker.tpl'); |
10 | 10 | if(!isset($modx->config['lang_code'])) $modx->config['lang_code'] = $this->getLangCode(); |
11 | - $modx->config['datetime_format_lc'] = isset($modx->config['datetime_format']) ? strtolower($modx->config['datetime_format']) : 'dd-mm-yyyy'; |
|
11 | + $modx->config['datetime_format_lc'] = isset($modx->config['datetime_format']) ? strtolower($modx->config['datetime_format']) : 'dd-mm-yyyy'; |
|
12 | 12 | return $modx->mergeSettingsContent($load_script); |
13 | 13 | } |
14 | 14 |
@@ -1,13 +1,13 @@ discard block |
||
1 | 1 | <?php |
2 | -class DATEPICKER { |
|
2 | +class DATEPICKER{ |
|
3 | 3 | /** |
4 | 4 | * @return string |
5 | 5 | */ |
6 | - public function getDP() { |
|
6 | + public function getDP(){ |
|
7 | 7 | $modx = evolutionCMS(); |
8 | 8 | |
9 | 9 | $load_script = file_get_contents(__DIR__.'/datepicker.tpl'); |
10 | - if(!isset($modx->config['lang_code'])) $modx->config['lang_code'] = $this->getLangCode(); |
|
10 | + if (!isset($modx->config['lang_code'])) $modx->config['lang_code'] = $this->getLangCode(); |
|
11 | 11 | $modx->config['datetime_format_lc'] = isset($modx->config['datetime_format']) ? strtolower($modx->config['datetime_format']) : 'dd-mm-yyyy'; |
12 | 12 | return $modx->mergeSettingsContent($load_script); |
13 | 13 | } |
@@ -15,7 +15,7 @@ discard block |
||
15 | 15 | /** |
16 | 16 | * @return string |
17 | 17 | */ |
18 | - public function getLangCode() { |
|
18 | + public function getLangCode(){ |
|
19 | 19 | $lang = evolutionCMS()->get('ManagerTheme')->getLang(); |
20 | 20 | |
21 | 21 | if ($lang === 'uk') { |
@@ -1,13 +1,17 @@ discard block |
||
1 | 1 | <?php |
2 | -class DATEPICKER { |
|
2 | +class DATEPICKER |
|
3 | +{ |
|
3 | 4 | /** |
4 | 5 | * @return string |
5 | 6 | */ |
6 | - public function getDP() { |
|
7 | + public function getDP() |
|
8 | + { |
|
7 | 9 | $modx = evolutionCMS(); |
8 | 10 | |
9 | 11 | $load_script = file_get_contents(__DIR__.'/datepicker.tpl'); |
10 | - if(!isset($modx->config['lang_code'])) $modx->config['lang_code'] = $this->getLangCode(); |
|
12 | + if(!isset($modx->config['lang_code'])) { |
|
13 | + $modx->config['lang_code'] = $this->getLangCode(); |
|
14 | + } |
|
11 | 15 | $modx->config['datetime_format_lc'] = isset($modx->config['datetime_format']) ? strtolower($modx->config['datetime_format']) : 'dd-mm-yyyy'; |
12 | 16 | return $modx->mergeSettingsContent($load_script); |
13 | 17 | } |
@@ -15,7 +19,8 @@ discard block |
||
15 | 19 | /** |
16 | 20 | * @return string |
17 | 21 | */ |
18 | - public function getLangCode() { |
|
22 | + public function getLangCode() |
|
23 | + { |
|
19 | 24 | $lang = evolutionCMS()->get('ManagerTheme')->getLang(); |
20 | 25 | |
21 | 26 | if ($lang === 'uk') { |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | 3 | class DATEPICKER { |
4 | - function __construct() { |
|
5 | - } |
|
4 | + function __construct() { |
|
5 | + } |
|
6 | 6 | |
7 | - function getDP() { |
|
8 | - $modx = evolutionCMS(); global $_lang; |
|
7 | + function getDP() { |
|
8 | + $modx = evolutionCMS(); global $_lang; |
|
9 | 9 | |
10 | - $tpl = file_get_contents(__DIR__ . '/datepicker.tpl'); |
|
11 | - return $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
12 | - } |
|
10 | + $tpl = file_get_contents(__DIR__ . '/datepicker.tpl'); |
|
11 | + return $modx->parseText($tpl, $_lang, '[%', '%]'); |
|
12 | + } |
|
13 | 13 | } |
@@ -1,13 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class DATEPICKER { |
|
4 | - function __construct() { |
|
3 | +class DATEPICKER{ |
|
4 | + function __construct(){ |
|
5 | 5 | } |
6 | 6 | |
7 | - function getDP() { |
|
7 | + function getDP(){ |
|
8 | 8 | $modx = evolutionCMS(); global $_lang; |
9 | 9 | |
10 | - $tpl = file_get_contents(__DIR__ . '/datepicker.tpl'); |
|
10 | + $tpl = file_get_contents(__DIR__.'/datepicker.tpl'); |
|
11 | 11 | return $modx->parseText($tpl, $_lang, '[%', '%]'); |
12 | 12 | } |
13 | 13 | } |
@@ -1,10 +1,13 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -class DATEPICKER { |
|
4 | - function __construct() { |
|
3 | +class DATEPICKER |
|
4 | +{ |
|
5 | + function __construct() |
|
6 | + { |
|
5 | 7 | } |
6 | 8 | |
7 | - function getDP() { |
|
9 | + function getDP() |
|
10 | + { |
|
8 | 11 | $modx = evolutionCMS(); global $_lang; |
9 | 12 | |
10 | 13 | $tpl = file_get_contents(__DIR__ . '/datepicker.tpl'); |
@@ -1,19 +1,19 @@ discard block |
||
1 | 1 | <?php |
2 | -define('IN_MANAGER_MODE', true); // we use this to make sure files are accessed through |
|
2 | +define('IN_MANAGER_MODE', true); // we use this to make sure files are accessed through |
|
3 | 3 | define('MODX_API_MODE', true); |
4 | 4 | |
5 | -if (file_exists(dirname(__DIR__, 3) . '/config.php')) { |
|
6 | - $config = require dirname(__DIR__) . '/config.php'; |
|
7 | -} elseif (file_exists(dirname(__DIR__, 4) . '/config.php')) { |
|
8 | - $config = require dirname(__DIR__, 4) . '/config.php'; |
|
5 | +if (file_exists(dirname(__DIR__, 3).'/config.php')) { |
|
6 | + $config = require dirname(__DIR__).'/config.php'; |
|
7 | +} elseif (file_exists(dirname(__DIR__, 4).'/config.php')) { |
|
8 | + $config = require dirname(__DIR__, 4).'/config.php'; |
|
9 | 9 | } else { |
10 | 10 | $config = [ |
11 | 11 | 'root' => dirname(__DIR__, 4) |
12 | 12 | ]; |
13 | 13 | } |
14 | 14 | |
15 | -if (!empty($config['root']) && file_exists($config['root']. '/index.php')) { |
|
16 | - require_once $config['root'] . '/index.php'; |
|
15 | +if (!empty($config['root']) && file_exists($config['root'].'/index.php')) { |
|
16 | + require_once $config['root'].'/index.php'; |
|
17 | 17 | } else { |
18 | 18 | echo "<h3>Unable to load configuration settings</h3>"; |
19 | 19 | echo "Please run the EVO <a href='../install'>install utility</a>"; |
@@ -53,9 +53,9 @@ discard block |
||
53 | 53 | exit('send some data'); |
54 | 54 | } //?? |
55 | 55 | |
56 | - $indent = (int)$_REQUEST['indent']; |
|
57 | - $parent = (int)$_REQUEST['parent']; |
|
58 | - $expandAll = (int)$_REQUEST['expandAll']; |
|
56 | + $indent = (int) $_REQUEST['indent']; |
|
57 | + $parent = (int) $_REQUEST['parent']; |
|
58 | + $expandAll = (int) $_REQUEST['expandAll']; |
|
59 | 59 | $output = ''; |
60 | 60 | $hereid = isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) ? $_REQUEST['id'] : ''; |
61 | 61 | |
@@ -114,21 +114,21 @@ discard block |
||
114 | 114 | $sql = ''; |
115 | 115 | $a = ''; |
116 | 116 | $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '%*_') : ''; |
117 | - $sqlLike = $filter ? 'WHERE t1.name LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : ''; |
|
118 | - $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
|
117 | + $sqlLike = $filter ? 'WHERE t1.name LIKE "'.$modx->getDatabase()->escape($filter).'%"' : ''; |
|
118 | + $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit; |
|
119 | 119 | |
120 | 120 | switch ($elements) { |
121 | 121 | case 'element_templates': |
122 | 122 | $a = 16; |
123 | - $sqlLike = $filter ? 'WHERE t1.templatename LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : ''; |
|
123 | + $sqlLike = $filter ? 'WHERE t1.templatename LIKE "'.$modx->getDatabase()->escape($filter).'%"' : ''; |
|
124 | 124 | $sql = $modx->getDatabase()->query('SELECT t1.id, t1.templatename AS name, t1.locked, 0 AS disabled |
125 | - FROM ' . $modx->getFullTableName('site_templates') . ' AS t1 |
|
126 | - ' . $sqlLike . ' |
|
125 | + FROM ' . $modx->getFullTableName('site_templates').' AS t1 |
|
126 | + ' . $sqlLike.' |
|
127 | 127 | ORDER BY t1.templatename ASC |
128 | 128 | ' . $sqlLimit); |
129 | 129 | |
130 | 130 | if ($modx->hasPermission('new_template')) { |
131 | - $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>' . $_lang['new_template'] . '</a></li>'; |
|
131 | + $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>'.$_lang['new_template'].'</a></li>'; |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | break; |
@@ -136,15 +136,15 @@ discard block |
||
136 | 136 | case 'element_tplvars': |
137 | 137 | $a = 301; |
138 | 138 | $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, IF(MIN(t2.tmplvarid),0,1) AS disabled |
139 | - FROM ' . $modx->getFullTableName('site_tmplvars') . ' AS t1 |
|
140 | - LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates') . ' AS t2 ON t1.id=t2.tmplvarid |
|
141 | - ' . $sqlLike . ' |
|
139 | + FROM ' . $modx->getFullTableName('site_tmplvars').' AS t1 |
|
140 | + LEFT JOIN ' . $modx->getFullTableName('site_tmplvar_templates').' AS t2 ON t1.id=t2.tmplvarid |
|
141 | + ' . $sqlLike.' |
|
142 | 142 | GROUP BY t1.id |
143 | 143 | ORDER BY t1.name ASC |
144 | 144 | ' . $sqlLimit); |
145 | 145 | |
146 | 146 | if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
147 | - $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>' . $_lang['new_tmplvars'] . '</a></li>'; |
|
147 | + $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>'.$_lang['new_tmplvars'].'</a></li>'; |
|
148 | 148 | } |
149 | 149 | |
150 | 150 | break; |
@@ -152,13 +152,13 @@ discard block |
||
152 | 152 | case 'element_htmlsnippets': |
153 | 153 | $a = 78; |
154 | 154 | $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, t1.disabled |
155 | - FROM ' . $modx->getFullTableName('site_htmlsnippets') . ' AS t1 |
|
156 | - ' . $sqlLike . ' |
|
155 | + FROM ' . $modx->getFullTableName('site_htmlsnippets').' AS t1 |
|
156 | + ' . $sqlLike.' |
|
157 | 157 | ORDER BY t1.name ASC |
158 | 158 | ' . $sqlLimit); |
159 | 159 | |
160 | 160 | if ($modx->hasPermission('new_chunk')) { |
161 | - $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>' . $_lang['new_htmlsnippet'] . '</a></li>'; |
|
161 | + $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>'.$_lang['new_htmlsnippet'].'</a></li>'; |
|
162 | 162 | } |
163 | 163 | |
164 | 164 | break; |
@@ -166,13 +166,13 @@ discard block |
||
166 | 166 | case 'element_snippets': |
167 | 167 | $a = 22; |
168 | 168 | $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, t1.disabled |
169 | - FROM ' . $modx->getFullTableName('site_snippets') . ' AS t1 |
|
170 | - ' . $sqlLike . ' |
|
169 | + FROM ' . $modx->getFullTableName('site_snippets').' AS t1 |
|
170 | + ' . $sqlLike.' |
|
171 | 171 | ORDER BY t1.name ASC |
172 | 172 | ' . $sqlLimit); |
173 | 173 | |
174 | 174 | if ($modx->hasPermission('new_snippet')) { |
175 | - $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>' . $_lang['new_snippet'] . '</a></li>'; |
|
175 | + $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>'.$_lang['new_snippet'].'</a></li>'; |
|
176 | 176 | } |
177 | 177 | |
178 | 178 | break; |
@@ -180,13 +180,13 @@ discard block |
||
180 | 180 | case 'element_plugins': |
181 | 181 | $a = 102; |
182 | 182 | $sql = $modx->getDatabase()->query('SELECT t1.id, t1.name, t1.locked, t1.disabled |
183 | - FROM ' . $modx->getFullTableName('site_plugins') . ' AS t1 |
|
184 | - ' . $sqlLike . ' |
|
183 | + FROM ' . $modx->getFullTableName('site_plugins').' AS t1 |
|
184 | + ' . $sqlLike.' |
|
185 | 185 | ORDER BY t1.name ASC |
186 | 186 | ' . $sqlLimit); |
187 | 187 | |
188 | 188 | if ($modx->hasPermission('new_plugin')) { |
189 | - $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>' . $_lang['new_plugin'] . '</a></li>'; |
|
189 | + $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>'.$_lang['new_plugin'].'</a></li>'; |
|
190 | 190 | } |
191 | 191 | |
192 | 192 | break; |
@@ -201,7 +201,7 @@ discard block |
||
201 | 201 | continue; |
202 | 202 | } |
203 | 203 | |
204 | - $items .= '<li class="item ' . ($row['disabled'] ? 'disabled' : '') . ($row['locked'] ? ' locked' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main" data-parent-id="a_76__elements_' . $elements . '">' . entities($row['name'], $modx->getConfig('modx_charset')) . ' <small>(' . $row['id'] . ')</small></a></li>' . "\n"; |
|
204 | + $items .= '<li class="item '.($row['disabled'] ? 'disabled' : '').($row['locked'] ? ' locked' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main" data-parent-id="a_76__elements_'.$elements.'">'.entities($row['name'], $modx->getConfig('modx_charset')).' <small>('.$row['id'].')</small></a></li>'."\n"; |
|
205 | 205 | } |
206 | 206 | } |
207 | 207 | |
@@ -222,23 +222,23 @@ discard block |
||
222 | 222 | $output = ''; |
223 | 223 | $items = ''; |
224 | 224 | $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '\%*_') : ''; |
225 | - $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : ''; |
|
226 | - $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
|
225 | + $sqlLike = $filter ? 'WHERE t1.username LIKE "'.$modx->getDatabase()->escape($filter).'%"' : ''; |
|
226 | + $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit; |
|
227 | 227 | |
228 | - if(!$modx->hasPermission('save_role')) { |
|
228 | + if (!$modx->hasPermission('save_role')) { |
|
229 | 229 | $sqlLike .= $sqlLike ? ' AND ' : 'WHERE '; |
230 | 230 | $sqlLike .= 't2.role != 1'; |
231 | 231 | } |
232 | 232 | |
233 | 233 | $sql = $modx->getDatabase()->query('SELECT t1.*, t1.username AS name, t2.blocked |
234 | - FROM ' . $modx->getFullTableName('manager_users') . ' AS t1 |
|
235 | - LEFT JOIN ' . $modx->getFullTableName('user_attributes') . ' AS t2 ON t1.id=t2.internalKey |
|
236 | - ' . $sqlLike . ' |
|
234 | + FROM ' . $modx->getFullTableName('manager_users').' AS t1 |
|
235 | + LEFT JOIN ' . $modx->getFullTableName('user_attributes').' AS t2 ON t1.id=t2.internalKey |
|
236 | + ' . $sqlLike.' |
|
237 | 237 | ORDER BY t1.username ASC |
238 | 238 | ' . $sqlLimit); |
239 | 239 | |
240 | 240 | if ($modx->hasPermission('new_user')) { |
241 | - $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>' . $_lang['new_user'] . '</a></li>'; |
|
241 | + $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>'.$_lang['new_user'].'</a></li>'; |
|
242 | 242 | } |
243 | 243 | |
244 | 244 | if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
@@ -246,7 +246,7 @@ discard block |
||
246 | 246 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
247 | 247 | } |
248 | 248 | while ($row = $modx->getDatabase()->getRow($sql)) { |
249 | - $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . entities($row['name'], $modx->getConfig('modx_charset')) . ' <small>(' . $row['id'] . ')</small></a></li>'; |
|
249 | + $items .= '<li class="item '.($row['blocked'] ? 'disabled' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main">'.entities($row['name'], $modx->getConfig('modx_charset')).' <small>('.$row['id'].')</small></a></li>'; |
|
250 | 250 | } |
251 | 251 | } |
252 | 252 | |
@@ -266,18 +266,18 @@ discard block |
||
266 | 266 | $output = ''; |
267 | 267 | $items = ''; |
268 | 268 | $filter = !empty($_REQUEST['filter']) && is_scalar($_REQUEST['filter']) ? addcslashes(trim($_REQUEST['filter']), '\%*_') : ''; |
269 | - $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : ''; |
|
270 | - $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
|
269 | + $sqlLike = $filter ? 'WHERE t1.username LIKE "'.$modx->getDatabase()->escape($filter).'%"' : ''; |
|
270 | + $sqlLimit = $sqlLike ? '' : 'LIMIT '.$limit; |
|
271 | 271 | |
272 | 272 | $sql = $modx->getDatabase()->query('SELECT t1.*, t1.username AS name, t2.blocked |
273 | - FROM ' . $modx->getFullTableName('web_users') . ' AS t1 |
|
274 | - LEFT JOIN ' . $modx->getFullTableName('web_user_attributes') . ' AS t2 ON t1.id=t2.internalKey |
|
275 | - ' . $sqlLike . ' |
|
273 | + FROM ' . $modx->getFullTableName('web_users').' AS t1 |
|
274 | + LEFT JOIN ' . $modx->getFullTableName('web_user_attributes').' AS t2 ON t1.id=t2.internalKey |
|
275 | + ' . $sqlLike.' |
|
276 | 276 | ORDER BY t1.username ASC |
277 | 277 | ' . $sqlLimit); |
278 | 278 | |
279 | 279 | if ($modx->hasPermission('new_web_user')) { |
280 | - $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>' . $_lang['new_web_user'] . '</a></li>'; |
|
280 | + $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>'.$_lang['new_web_user'].'</a></li>'; |
|
281 | 281 | } |
282 | 282 | |
283 | 283 | if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
286 | 286 | } |
287 | 287 | while ($row = $modx->getDatabase()->getRow($sql)) { |
288 | - $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . entities($row['name'], $modx->getConfig('modx_charset')) . ' <small>(' . $row['id'] . ')</small></a></li>'; |
|
288 | + $items .= '<li class="item '.($row['blocked'] ? 'disabled' : '').'"><a id="a_'.$a.'__id_'.$row['id'].'" href="index.php?a='.$a.'&id='.$row['id'].'" target="main">'.entities($row['name'], $modx->getConfig('modx_charset')).' <small>('.$row['id'].')</small></a></li>'; |
|
289 | 289 | } |
290 | 290 | } |
291 | 291 | |
@@ -311,35 +311,35 @@ discard block |
||
311 | 311 | case 'SnippetNoCache': { |
312 | 312 | |
313 | 313 | $sql = $modx->getDatabase()->query('SELECT * |
314 | - FROM ' . $modx->getFullTableName('site_snippets') . ' |
|
315 | - WHERE name="' . $name . '" |
|
314 | + FROM ' . $modx->getFullTableName('site_snippets').' |
|
315 | + WHERE name="' . $name.'" |
|
316 | 316 | LIMIT 1'); |
317 | 317 | |
318 | 318 | if ($modx->getDatabase()->getRecordCount($sql)) { |
319 | 319 | $row = $modx->getDatabase()->getRow($sql); |
320 | 320 | $contextmenu = array( |
321 | 321 | 'header' => array( |
322 | - 'innerHTML' => '<i class="fa fa-code"></i> ' . entities($row['name'], $modx->getConfig('modx_charset')) |
|
322 | + 'innerHTML' => '<i class="fa fa-code"></i> '.entities($row['name'], $modx->getConfig('modx_charset')) |
|
323 | 323 | ), |
324 | 324 | 'item' => array( |
325 | - 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'], |
|
326 | - 'url' => "index.php?a=22&id=" . $row['id'] |
|
325 | + 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'], |
|
326 | + 'url' => "index.php?a=22&id=".$row['id'] |
|
327 | 327 | ) |
328 | 328 | ); |
329 | 329 | if (!empty($row['description'])) { |
330 | 330 | $contextmenu['seperator'] = ''; |
331 | 331 | $contextmenu['description'] = array( |
332 | - 'innerHTML' => '<i class="fa fa-info"></i> ' . entities($row['description'], $modx->getConfig('modx_charset')) |
|
332 | + 'innerHTML' => '<i class="fa fa-info"></i> '.entities($row['description'], $modx->getConfig('modx_charset')) |
|
333 | 333 | ); |
334 | 334 | } |
335 | 335 | } else { |
336 | 336 | $contextmenu = array( |
337 | 337 | 'header' => array( |
338 | - 'innerHTML' => '<i class="fa fa-code"></i> ' . entities($name, $modx->getConfig('modx_charset')) |
|
338 | + 'innerHTML' => '<i class="fa fa-code"></i> '.entities($name, $modx->getConfig('modx_charset')) |
|
339 | 339 | ), |
340 | 340 | 'item' => array( |
341 | - 'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_snippet'], |
|
342 | - 'url' => "index.php?a=23&itemname=" . entities($name, $modx->getConfig('modx_charset')) |
|
341 | + 'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_snippet'], |
|
342 | + 'url' => "index.php?a=23&itemname=".entities($name, $modx->getConfig('modx_charset')) |
|
343 | 343 | ) |
344 | 344 | ); |
345 | 345 | } |
@@ -349,35 +349,35 @@ discard block |
||
349 | 349 | case 'Chunk' : { |
350 | 350 | |
351 | 351 | $sql = $modx->getDatabase()->query('SELECT * |
352 | - FROM ' . $modx->getFullTableName('site_htmlsnippets') . ' |
|
353 | - WHERE name="' . $name . '" |
|
352 | + FROM ' . $modx->getFullTableName('site_htmlsnippets').' |
|
353 | + WHERE name="' . $name.'" |
|
354 | 354 | LIMIT 1'); |
355 | 355 | |
356 | 356 | if ($modx->getDatabase()->getRecordCount($sql)) { |
357 | 357 | $row = $modx->getDatabase()->getRow($sql); |
358 | 358 | $contextmenu = array( |
359 | 359 | 'header' => array( |
360 | - 'innerHTML' => '<i class="fa fa-th-large"></i> ' . entities($row['name'], $modx->getConfig('modx_charset')) |
|
360 | + 'innerHTML' => '<i class="fa fa-th-large"></i> '.entities($row['name'], $modx->getConfig('modx_charset')) |
|
361 | 361 | ), |
362 | 362 | 'item' => array( |
363 | - 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'], |
|
364 | - 'url' => "index.php?a=78&id=" . $row['id'] |
|
363 | + 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'], |
|
364 | + 'url' => "index.php?a=78&id=".$row['id'] |
|
365 | 365 | ) |
366 | 366 | ); |
367 | 367 | if (!empty($row['description'])) { |
368 | 368 | $contextmenu['seperator'] = ''; |
369 | 369 | $contextmenu['description'] = array( |
370 | - 'innerHTML' => '<i class="fa fa-info"></i> ' . entities($row['description'], $modx->getConfig('modx_charset')) |
|
370 | + 'innerHTML' => '<i class="fa fa-info"></i> '.entities($row['description'], $modx->getConfig('modx_charset')) |
|
371 | 371 | ); |
372 | 372 | } |
373 | 373 | } else { |
374 | 374 | $contextmenu = array( |
375 | 375 | 'header' => array( |
376 | - 'innerHTML' => '<i class="fa fa-th-large"></i> ' . entities($name, $modx->getConfig('modx_charset')) |
|
376 | + 'innerHTML' => '<i class="fa fa-th-large"></i> '.entities($name, $modx->getConfig('modx_charset')) |
|
377 | 377 | ), |
378 | 378 | 'item' => array( |
379 | - 'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_htmlsnippet'], |
|
380 | - 'url' => "index.php?a=77&itemname=" . entities($name, $modx->getConfig('modx_charset')) |
|
379 | + 'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_htmlsnippet'], |
|
380 | + 'url' => "index.php?a=77&itemname=".entities($name, $modx->getConfig('modx_charset')) |
|
381 | 381 | ) |
382 | 382 | ); |
383 | 383 | } |
@@ -386,8 +386,8 @@ discard block |
||
386 | 386 | } |
387 | 387 | case 'AttributeValue': { |
388 | 388 | $sql = $modx->getDatabase()->query('SELECT * |
389 | - FROM ' . $modx->getFullTableName('site_htmlsnippets') . ' |
|
390 | - WHERE name="' . $name . '" |
|
389 | + FROM ' . $modx->getFullTableName('site_htmlsnippets').' |
|
390 | + WHERE name="' . $name.'" |
|
391 | 391 | LIMIT 1'); |
392 | 392 | |
393 | 393 | if ($modx->getDatabase()->getRecordCount($sql)) { |
@@ -397,52 +397,52 @@ discard block |
||
397 | 397 | 'innerText' => entities($row['name'], $modx->getConfig('modx_charset')) |
398 | 398 | ), |
399 | 399 | 'item' => array( |
400 | - 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'], |
|
401 | - 'url' => "index.php?a=78&id=" . $row['id'] |
|
400 | + 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'], |
|
401 | + 'url' => "index.php?a=78&id=".$row['id'] |
|
402 | 402 | ) |
403 | 403 | ); |
404 | 404 | if (!empty($row['description'])) { |
405 | 405 | $contextmenu['seperator'] = ''; |
406 | 406 | $contextmenu['description'] = array( |
407 | - 'innerHTML' => '<i class="fa fa-info"></i> ' . entities($row['description'], $modx->getConfig('modx_charset')) |
|
407 | + 'innerHTML' => '<i class="fa fa-info"></i> '.entities($row['description'], $modx->getConfig('modx_charset')) |
|
408 | 408 | ); |
409 | 409 | } |
410 | 410 | } else { |
411 | 411 | |
412 | 412 | $sql = $modx->getDatabase()->query('SELECT * |
413 | - FROM ' . $modx->getFullTableName('site_snippets') . ' |
|
414 | - WHERE name="' . $name . '" |
|
413 | + FROM ' . $modx->getFullTableName('site_snippets').' |
|
414 | + WHERE name="' . $name.'" |
|
415 | 415 | LIMIT 1'); |
416 | 416 | |
417 | 417 | if ($modx->getDatabase()->getRecordCount($sql)) { |
418 | 418 | $row = $modx->getDatabase()->getRow($sql); |
419 | 419 | $contextmenu = array( |
420 | 420 | 'header' => array( |
421 | - 'innerHTML' => '<i class="fa fa-code"></i> ' . entities($row['name'], $modx->getConfig('modx_charset')) |
|
421 | + 'innerHTML' => '<i class="fa fa-code"></i> '.entities($row['name'], $modx->getConfig('modx_charset')) |
|
422 | 422 | ), |
423 | 423 | 'item' => array( |
424 | - 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'], |
|
425 | - 'url' => "index.php?a=22&id=" . $row['id'] |
|
424 | + 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'], |
|
425 | + 'url' => "index.php?a=22&id=".$row['id'] |
|
426 | 426 | ) |
427 | 427 | ); |
428 | 428 | if (!empty($row['description'])) { |
429 | 429 | $contextmenu['seperator'] = ''; |
430 | 430 | $contextmenu['description'] = array( |
431 | - 'innerHTML' => '<i class="fa fa-info"></i> ' . entities($row['description'], $modx->getConfig('modx_charset')) |
|
431 | + 'innerHTML' => '<i class="fa fa-info"></i> '.entities($row['description'], $modx->getConfig('modx_charset')) |
|
432 | 432 | ); |
433 | 433 | } |
434 | 434 | } else { |
435 | 435 | $contextmenu = array( |
436 | 436 | 'header' => array( |
437 | - 'innerHTML' => '<i class="fa fa-code"></i> ' . entities($name, $modx->getConfig('modx_charset')) |
|
437 | + 'innerHTML' => '<i class="fa fa-code"></i> '.entities($name, $modx->getConfig('modx_charset')) |
|
438 | 438 | ), |
439 | 439 | 'item' => array( |
440 | - 'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_htmlsnippet'], |
|
441 | - 'url' => "index.php?a=77&itemname=" . entities($name, $modx->getConfig('modx_charset')) |
|
440 | + 'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_htmlsnippet'], |
|
441 | + 'url' => "index.php?a=77&itemname=".entities($name, $modx->getConfig('modx_charset')) |
|
442 | 442 | ), |
443 | 443 | 'item2' => array( |
444 | - 'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_snippet'], |
|
445 | - 'url' => "index.php?a=23&itemname=" . entities($name, $modx->getConfig('modx_charset')) |
|
444 | + 'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_snippet'], |
|
445 | + 'url' => "index.php?a=23&itemname=".entities($name, $modx->getConfig('modx_charset')) |
|
446 | 446 | ) |
447 | 447 | ); |
448 | 448 | } |
@@ -498,35 +498,35 @@ discard block |
||
498 | 498 | } |
499 | 499 | |
500 | 500 | $sql = $modx->getDatabase()->query('SELECT * |
501 | - FROM ' . $modx->getFullTableName('site_tmplvars') . ' |
|
502 | - WHERE name="' . $name . '" |
|
501 | + FROM ' . $modx->getFullTableName('site_tmplvars').' |
|
502 | + WHERE name="' . $name.'" |
|
503 | 503 | LIMIT 1'); |
504 | 504 | |
505 | 505 | if ($modx->getDatabase()->getRecordCount($sql)) { |
506 | 506 | $row = $modx->getDatabase()->getRow($sql); |
507 | 507 | $contextmenu = array( |
508 | 508 | 'header' => array( |
509 | - 'innerHTML' => '<i class="fa fa-list-alt"></i> ' . entities($row['name'], $modx->getConfig('modx_charset')) |
|
509 | + 'innerHTML' => '<i class="fa fa-list-alt"></i> '.entities($row['name'], $modx->getConfig('modx_charset')) |
|
510 | 510 | ), |
511 | 511 | 'item' => array( |
512 | - 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> ' . $_lang['edit'], |
|
513 | - 'url' => "index.php?a=301&id=" . $row['id'] |
|
512 | + 'innerHTML' => '<i class="fa fa-pencil-square-o"></i> '.$_lang['edit'], |
|
513 | + 'url' => "index.php?a=301&id=".$row['id'] |
|
514 | 514 | ) |
515 | 515 | ); |
516 | 516 | if (!empty($row['description'])) { |
517 | 517 | $contextmenu['seperator'] = ''; |
518 | 518 | $contextmenu['description'] = array( |
519 | - 'innerHTML' => '<i class="fa fa-info"></i> ' . entities($row['description'], $modx->getConfig('modx_charset')) |
|
519 | + 'innerHTML' => '<i class="fa fa-info"></i> '.entities($row['description'], $modx->getConfig('modx_charset')) |
|
520 | 520 | ); |
521 | 521 | } |
522 | 522 | } else { |
523 | 523 | $contextmenu = array( |
524 | 524 | 'header' => array( |
525 | - 'innerHTML' => '<i class="fa fa-list-alt"></i> ' . entities($name, $modx->getConfig('modx_charset')) |
|
525 | + 'innerHTML' => '<i class="fa fa-list-alt"></i> '.entities($name, $modx->getConfig('modx_charset')) |
|
526 | 526 | ), |
527 | 527 | 'item' => array( |
528 | - 'innerHTML' => '<i class="fa fa-plus"></i> ' . $_lang['new_tmplvars'], |
|
529 | - 'url' => "index.php?a=300&itemname=" . entities($name, $modx->getConfig('modx_charset')) |
|
528 | + 'innerHTML' => '<i class="fa fa-plus"></i> '.$_lang['new_tmplvars'], |
|
529 | + 'url' => "index.php?a=300&itemname=".entities($name, $modx->getConfig('modx_charset')) |
|
530 | 530 | ) |
531 | 531 | ); |
532 | 532 | } |
@@ -545,15 +545,15 @@ discard block |
||
545 | 545 | $json = array(); |
546 | 546 | |
547 | 547 | if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
548 | - $id = !empty($_REQUEST['id']) ? (int)$_REQUEST['id'] : ''; |
|
549 | - $parent = isset($_REQUEST['parent']) ? (int)$_REQUEST['parent'] : 0; |
|
548 | + $id = !empty($_REQUEST['id']) ? (int) $_REQUEST['id'] : ''; |
|
549 | + $parent = isset($_REQUEST['parent']) ? (int) $_REQUEST['parent'] : 0; |
|
550 | 550 | $menuindex = isset($_REQUEST['menuindex']) && is_scalar($_REQUEST['menuindex']) ? $_REQUEST['menuindex'] : 0; |
551 | 551 | |
552 | 552 | // set parent |
553 | 553 | if ($id && $parent >= 0) { |
554 | 554 | |
555 | 555 | // find older parent |
556 | - $parentOld = $modx->getDatabase()->getValue($modx->getDatabase()->select('parent', $modx->getFullTableName('site_content'), 'id=' . $id)); |
|
556 | + $parentOld = $modx->getDatabase()->getValue($modx->getDatabase()->select('parent', $modx->getFullTableName('site_content'), 'id='.$id)); |
|
557 | 557 | |
558 | 558 | $eventOut = $modx->invokeEvent('onBeforeMoveDocument', [ |
559 | 559 | 'id_document' => $id, |
@@ -574,7 +574,7 @@ discard block |
||
574 | 574 | if (empty($json['errors'])) { |
575 | 575 | // check privileges user for move docs |
576 | 576 | if (!empty($modx->config['tree_show_protected']) && $role != 1) { |
577 | - $sql = $modx->getDatabase()->select('*', $modx->getFullTableName('document_groups'), 'document IN(' . $id . ',' . $parent . ',' . $parentOld . ')'); |
|
577 | + $sql = $modx->getDatabase()->select('*', $modx->getFullTableName('document_groups'), 'document IN('.$id.','.$parent.','.$parentOld.')'); |
|
578 | 578 | if ($modx->getDatabase()->getRecordCount($sql)) { |
579 | 579 | $document_groups = array(); |
580 | 580 | while ($row = $modx->getDatabase()->getRow($sql)) { |
@@ -599,22 +599,22 @@ discard block |
||
599 | 599 | // set new parent |
600 | 600 | $modx->getDatabase()->update(array( |
601 | 601 | 'parent' => $parent |
602 | - ), $modx->getFullTableName('site_content'), 'id=' . $id); |
|
602 | + ), $modx->getFullTableName('site_content'), 'id='.$id); |
|
603 | 603 | // set parent isfolder = 1 |
604 | 604 | $modx->getDatabase()->update(array( |
605 | 605 | 'isfolder' => 1 |
606 | - ), $modx->getFullTableName('site_content'), 'id=' . $parent); |
|
606 | + ), $modx->getFullTableName('site_content'), 'id='.$parent); |
|
607 | 607 | |
608 | 608 | if ($parent != $parentOld) { |
609 | 609 | // check children docs and set parent isfolder |
610 | - if ($modx->getDatabase()->getRecordCount($modx->getDatabase()->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) { |
|
610 | + if ($modx->getDatabase()->getRecordCount($modx->getDatabase()->select('id', $modx->getFullTableName('site_content'), 'parent='.$parentOld))) { |
|
611 | 611 | $modx->getDatabase()->update(array( |
612 | 612 | 'isfolder' => 1 |
613 | - ), $modx->getFullTableName('site_content'), 'id=' . $parentOld); |
|
613 | + ), $modx->getFullTableName('site_content'), 'id='.$parentOld); |
|
614 | 614 | } else { |
615 | 615 | $modx->getDatabase()->update(array( |
616 | 616 | 'isfolder' => 0 |
617 | - ), $modx->getFullTableName('site_content'), 'id=' . $parentOld); |
|
617 | + ), $modx->getFullTableName('site_content'), 'id='.$parentOld); |
|
618 | 618 | } |
619 | 619 | } |
620 | 620 | |
@@ -622,7 +622,7 @@ discard block |
||
622 | 622 | if (!empty($menuindex)) { |
623 | 623 | $menuindex = explode(',', $menuindex); |
624 | 624 | foreach ($menuindex as $key => $value) { |
625 | - $modx->getDatabase()->query('UPDATE ' . $modx->getFullTableName('site_content') . ' SET menuindex=' . $key . ' WHERE id=' . $value); |
|
625 | + $modx->getDatabase()->query('UPDATE '.$modx->getFullTableName('site_content').' SET menuindex='.$key.' WHERE id='.$value); |
|
626 | 626 | } |
627 | 627 | } else { |
628 | 628 | // TODO: max(*) menuindex |
@@ -651,19 +651,19 @@ discard block |
||
651 | 651 | } |
652 | 652 | |
653 | 653 | case 'getLockedElements': { |
654 | - $type = isset($_REQUEST['type']) ? (int)$_REQUEST['type'] : 0; |
|
655 | - $id = isset($_REQUEST['id']) ? (int)$_REQUEST['id'] : 0; |
|
654 | + $type = isset($_REQUEST['type']) ? (int) $_REQUEST['type'] : 0; |
|
655 | + $id = isset($_REQUEST['id']) ? (int) $_REQUEST['id'] : 0; |
|
656 | 656 | |
657 | 657 | $output = !!$modx->elementIsLocked($type, $id, true); |
658 | 658 | |
659 | 659 | if (!$output) { |
660 | 660 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
661 | - $docgrp_cond = $docgrp ? ' OR dg.document_group IN (' . $docgrp . ')' : ''; |
|
661 | + $docgrp_cond = $docgrp ? ' OR dg.document_group IN ('.$docgrp.')' : ''; |
|
662 | 662 | $sql = ' |
663 | - SELECT MAX(IF(1=' . $role . ' OR sc.privatemgr=0' . $docgrp_cond . ', 0, 1)) AS locked |
|
664 | - FROM ' . $modx->getFullTableName('site_content') . ' AS sc |
|
665 | - LEFT JOIN ' . $modx->getFullTableName('document_groups') . ' dg ON dg.document=sc.id |
|
666 | - WHERE sc.id=' . $id . ' GROUP BY sc.id'; |
|
663 | + SELECT MAX(IF(1=' . $role.' OR sc.privatemgr=0'.$docgrp_cond.', 0, 1)) AS locked |
|
664 | + FROM ' . $modx->getFullTableName('site_content').' AS sc |
|
665 | + LEFT JOIN ' . $modx->getFullTableName('document_groups').' dg ON dg.document=sc.id |
|
666 | + WHERE sc.id=' . $id.' GROUP BY sc.id'; |
|
667 | 667 | $sql = $modx->getDatabase()->query($sql); |
668 | 668 | if ($modx->getDatabase()->getRecordCount($sql)) { |
669 | 669 | $row = $modx->getDatabase()->getRow($sql); |
@@ -2,19 +2,19 @@ discard block |
||
2 | 2 | define('IN_MANAGER_MODE', true); // we use this to make sure files are accessed through |
3 | 3 | define('MODX_API_MODE', true); |
4 | 4 | |
5 | -if (file_exists(dirname(__DIR__, 3) . '/config.php')) { |
|
5 | +if (file_exists(dirname(__DIR__, 3) . '/config.php')) { |
|
6 | 6 | $config = require dirname(__DIR__) . '/config.php'; |
7 | -} elseif (file_exists(dirname(__DIR__, 4) . '/config.php')) { |
|
7 | +} elseif (file_exists(dirname(__DIR__, 4) . '/config.php')) { |
|
8 | 8 | $config = require dirname(__DIR__, 4) . '/config.php'; |
9 | -} else { |
|
9 | +} else { |
|
10 | 10 | $config = [ |
11 | 11 | 'root' => dirname(__DIR__, 4) |
12 | 12 | ]; |
13 | 13 | } |
14 | 14 | |
15 | -if (!empty($config['root']) && file_exists($config['root']. '/index.php')) { |
|
15 | +if (!empty($config['root']) && file_exists($config['root']. '/index.php')) { |
|
16 | 16 | require_once $config['root'] . '/index.php'; |
17 | -} else { |
|
17 | +} else { |
|
18 | 18 | echo "<h3>Unable to load configuration settings</h3>"; |
19 | 19 | echo "Please run the EVO <a href='../install'>install utility</a>"; |
20 | 20 | exit; |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | |
23 | 23 | $modx->getSettings(); |
24 | 24 | |
25 | -if (!isset($_SESSION['mgrValidated']) || !isset($_SERVER['HTTP_X_REQUESTED_WITH']) || (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') || ($_SERVER['REQUEST_METHOD'] != 'POST')) { |
|
25 | +if (!isset($_SESSION['mgrValidated']) || !isset($_SERVER['HTTP_X_REQUESTED_WITH']) || (strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) != 'xmlhttprequest') || ($_SERVER['REQUEST_METHOD'] != 'POST')) { |
|
26 | 26 | $modx->sendErrorPage(); |
27 | 27 | } |
28 | 28 | |
@@ -40,16 +40,16 @@ discard block |
||
40 | 40 | $limit = $modx->getConfig('number_of_results', 100); |
41 | 41 | header('Content-Type: text/html; charset='.$modx->getConfig('modx_charset'), true); |
42 | 42 | |
43 | -if (isset($action)) { |
|
44 | - switch ($action) { |
|
43 | +if (isset($action)) { |
|
44 | + switch ($action) { |
|
45 | 45 | case '1': { |
46 | - switch ($frame) { |
|
46 | + switch ($frame) { |
|
47 | 47 | case 'nodes': |
48 | 48 | // save folderstate |
49 | - if (isset($_REQUEST['opened'])) { |
|
49 | + if (isset($_REQUEST['opened'])) { |
|
50 | 50 | $_SESSION['openedArray'] = $_REQUEST['opened']; |
51 | 51 | } |
52 | - if (isset($_REQUEST['savestateonly'])) { |
|
52 | + if (isset($_REQUEST['savestateonly'])) { |
|
53 | 53 | exit('send some data'); |
54 | 54 | } //?? |
55 | 55 | |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | $output = ''; |
60 | 60 | $hereid = isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) ? $_REQUEST['id'] : ''; |
61 | 61 | |
62 | - if (isset($_REQUEST['showonlyfolders'])) { |
|
62 | + if (isset($_REQUEST['showonlyfolders'])) { |
|
63 | 63 | $_SESSION['tree_show_only_folders'] = $_REQUEST['showonlyfolders']; |
64 | 64 | } |
65 | 65 | |
@@ -69,8 +69,8 @@ discard block |
||
69 | 69 | 'tree_sortdir', |
70 | 70 | 'tree_nodename' |
71 | 71 | ); |
72 | - foreach ($sortParams as $param) { |
|
73 | - if (isset($_REQUEST[$param])) { |
|
72 | + foreach ($sortParams as $param) { |
|
73 | + if (isset($_REQUEST[$param])) { |
|
74 | 74 | $_SESSION[$param] = $_REQUEST[$param]; |
75 | 75 | $modx->getManagerApi()->saveLastUserSetting($param, $_REQUEST[$param]); |
76 | 76 | } |
@@ -79,9 +79,9 @@ discard block |
||
79 | 79 | // icons by content type |
80 | 80 | $icons = getIconInfo($_style); |
81 | 81 | |
82 | - if (isset($_SESSION['openedArray'])) { |
|
82 | + if (isset($_SESSION['openedArray'])) { |
|
83 | 83 | $opened = array_filter(array_map('intval', explode('|', $_SESSION['openedArray']))); |
84 | - } else { |
|
84 | + } else { |
|
85 | 85 | $opened = array(); |
86 | 86 | } |
87 | 87 | |
@@ -92,9 +92,9 @@ discard block |
||
92 | 92 | echo makeHTML($indent, $parent, $expandAll, $hereid); |
93 | 93 | |
94 | 94 | // check for deleted documents on reload |
95 | - if ($expandAll == 2) { |
|
95 | + if ($expandAll == 2) { |
|
96 | 96 | $rs = $modx->getDatabase()->select('id', $modx->getDatabase()->getFullTableName('site_content'), 'deleted=1 LIMIT 1'); |
97 | - if ($modx->getDatabase()->getRecordCount($rs)) { |
|
97 | + if ($modx->getDatabase()->getRecordCount($rs)) { |
|
98 | 98 | echo '<span id="binFull"></span>'; // add a special element to let system now that the bin is full |
99 | 99 | } |
100 | 100 | } |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | $elements = isset($_REQUEST['elements']) && is_scalar($_REQUEST['elements']) ? htmlentities($_REQUEST['elements']) : ''; |
110 | 110 | |
111 | - if ($elements) { |
|
111 | + if ($elements) { |
|
112 | 112 | $output = ''; |
113 | 113 | $items = ''; |
114 | 114 | $sql = ''; |
@@ -117,7 +117,7 @@ discard block |
||
117 | 117 | $sqlLike = $filter ? 'WHERE t1.name LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : ''; |
118 | 118 | $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
119 | 119 | |
120 | - switch ($elements) { |
|
120 | + switch ($elements) { |
|
121 | 121 | case 'element_templates': |
122 | 122 | $a = 16; |
123 | 123 | $sqlLike = $filter ? 'WHERE t1.templatename LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : ''; |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | ORDER BY t1.templatename ASC |
128 | 128 | ' . $sqlLimit); |
129 | 129 | |
130 | - if ($modx->hasPermission('new_template')) { |
|
130 | + if ($modx->hasPermission('new_template')) { |
|
131 | 131 | $output .= '<li><a id="a_19" href="index.php?a=19" target="main"><i class="fa fa-plus"></i>' . $_lang['new_template'] . '</a></li>'; |
132 | 132 | } |
133 | 133 | |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | ORDER BY t1.name ASC |
144 | 144 | ' . $sqlLimit); |
145 | 145 | |
146 | - if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
146 | + if ($modx->hasPermission('edit_template') && $modx->hasPermission('edit_snippet') && $modx->hasPermission('edit_chunk') && $modx->hasPermission('edit_plugin')) { |
|
147 | 147 | $output .= '<li><a id="a_300" href="index.php?a=300" target="main"><i class="fa fa-plus"></i>' . $_lang['new_tmplvars'] . '</a></li>'; |
148 | 148 | } |
149 | 149 | |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | ORDER BY t1.name ASC |
158 | 158 | ' . $sqlLimit); |
159 | 159 | |
160 | - if ($modx->hasPermission('new_chunk')) { |
|
160 | + if ($modx->hasPermission('new_chunk')) { |
|
161 | 161 | $output .= '<li><a id="a_77" href="index.php?a=77" target="main"><i class="fa fa-plus"></i>' . $_lang['new_htmlsnippet'] . '</a></li>'; |
162 | 162 | } |
163 | 163 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | ORDER BY t1.name ASC |
172 | 172 | ' . $sqlLimit); |
173 | 173 | |
174 | - if ($modx->hasPermission('new_snippet')) { |
|
174 | + if ($modx->hasPermission('new_snippet')) { |
|
175 | 175 | $output .= '<li><a id="a_23" href="index.php?a=23" target="main"><i class="fa fa-plus"></i>' . $_lang['new_snippet'] . '</a></li>'; |
176 | 176 | } |
177 | 177 | |
@@ -185,19 +185,19 @@ discard block |
||
185 | 185 | ORDER BY t1.name ASC |
186 | 186 | ' . $sqlLimit); |
187 | 187 | |
188 | - if ($modx->hasPermission('new_plugin')) { |
|
188 | + if ($modx->hasPermission('new_plugin')) { |
|
189 | 189 | $output .= '<li><a id="a_101" href="index.php?a=101" target="main"><i class="fa fa-plus"></i>' . $_lang['new_plugin'] . '</a></li>'; |
190 | 190 | } |
191 | 191 | |
192 | 192 | break; |
193 | 193 | } |
194 | 194 | |
195 | - if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
|
196 | - if ($count == $limit) { |
|
195 | + if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
|
196 | + if ($count == $limit) { |
|
197 | 197 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
198 | 198 | } |
199 | - while ($row = $modx->getDatabase()->getRow($sql)) { |
|
200 | - if (($row['disabled'] || $row['locked']) && $role != 1) { |
|
199 | + while ($row = $modx->getDatabase()->getRow($sql)) { |
|
200 | + if (($row['disabled'] || $row['locked']) && $role != 1) { |
|
201 | 201 | continue; |
202 | 202 | } |
203 | 203 | |
@@ -205,9 +205,9 @@ discard block |
||
205 | 205 | } |
206 | 206 | } |
207 | 207 | |
208 | - if (isset($_REQUEST['filter'])) { |
|
208 | + if (isset($_REQUEST['filter'])) { |
|
209 | 209 | $output = $items; |
210 | - } else { |
|
210 | + } else { |
|
211 | 211 | $output .= $items; |
212 | 212 | } |
213 | 213 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | $sqlLike = $filter ? 'WHERE t1.username LIKE "' . $modx->getDatabase()->escape($filter) . '%"' : ''; |
226 | 226 | $sqlLimit = $sqlLike ? '' : 'LIMIT ' . $limit; |
227 | 227 | |
228 | - if(!$modx->hasPermission('save_role')) { |
|
228 | + if(!$modx->hasPermission('save_role')) { |
|
229 | 229 | $sqlLike .= $sqlLike ? ' AND ' : 'WHERE '; |
230 | 230 | $sqlLike .= 't2.role != 1'; |
231 | 231 | } |
@@ -237,22 +237,22 @@ discard block |
||
237 | 237 | ORDER BY t1.username ASC |
238 | 238 | ' . $sqlLimit); |
239 | 239 | |
240 | - if ($modx->hasPermission('new_user')) { |
|
240 | + if ($modx->hasPermission('new_user')) { |
|
241 | 241 | $output .= '<li><a id="a_11" href="index.php?a=11" target="main"><i class="fa fa-plus"></i>' . $_lang['new_user'] . '</a></li>'; |
242 | 242 | } |
243 | 243 | |
244 | - if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
|
245 | - if ($count == $limit) { |
|
244 | + if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
|
245 | + if ($count == $limit) { |
|
246 | 246 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
247 | 247 | } |
248 | - while ($row = $modx->getDatabase()->getRow($sql)) { |
|
248 | + while ($row = $modx->getDatabase()->getRow($sql)) { |
|
249 | 249 | $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . entities($row['name'], $modx->getConfig('modx_charset')) . ' <small>(' . $row['id'] . ')</small></a></li>'; |
250 | 250 | } |
251 | 251 | } |
252 | 252 | |
253 | - if (isset($_REQUEST['filter'])) { |
|
253 | + if (isset($_REQUEST['filter'])) { |
|
254 | 254 | $output = $items; |
255 | - } else { |
|
255 | + } else { |
|
256 | 256 | $output .= $items; |
257 | 257 | } |
258 | 258 | |
@@ -276,22 +276,22 @@ discard block |
||
276 | 276 | ORDER BY t1.username ASC |
277 | 277 | ' . $sqlLimit); |
278 | 278 | |
279 | - if ($modx->hasPermission('new_web_user')) { |
|
279 | + if ($modx->hasPermission('new_web_user')) { |
|
280 | 280 | $output .= '<li><a id="a_87" href="index.php?a=87" target="main"><i class="fa fa-plus"></i>' . $_lang['new_web_user'] . '</a></li>'; |
281 | 281 | } |
282 | 282 | |
283 | - if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
|
284 | - if ($count == $limit) { |
|
283 | + if ($count = $modx->getDatabase()->getRecordCount($sql)) { |
|
284 | + if ($count == $limit) { |
|
285 | 285 | $output .= '<li class="item-input"><input type="text" name="filter" class="dropdown-item form-control form-control-sm" autocomplete="off" /></li>'; |
286 | 286 | } |
287 | - while ($row = $modx->getDatabase()->getRow($sql)) { |
|
287 | + while ($row = $modx->getDatabase()->getRow($sql)) { |
|
288 | 288 | $items .= '<li class="item ' . ($row['blocked'] ? 'disabled' : '') . '"><a id="a_' . $a . '__id_' . $row['id'] . '" href="index.php?a=' . $a . '&id=' . $row['id'] . '" target="main">' . entities($row['name'], $modx->getConfig('modx_charset')) . ' <small>(' . $row['id'] . ')</small></a></li>'; |
289 | 289 | } |
290 | 290 | } |
291 | 291 | |
292 | - if (isset($_REQUEST['filter'])) { |
|
292 | + if (isset($_REQUEST['filter'])) { |
|
293 | 293 | $output = $items; |
294 | - } else { |
|
294 | + } else { |
|
295 | 295 | $output .= $items; |
296 | 296 | } |
297 | 297 | |
@@ -305,8 +305,8 @@ discard block |
||
305 | 305 | $type = isset($_REQUEST['type']) && is_scalar($_REQUEST['type']) ? $modx->getDatabase()->escape($_REQUEST['type']) : false; |
306 | 306 | $contextmenu = ''; |
307 | 307 | |
308 | - if ($role && $name && $type) { |
|
309 | - switch ($type) { |
|
308 | + if ($role && $name && $type) { |
|
309 | + switch ($type) { |
|
310 | 310 | case 'Snippet': |
311 | 311 | case 'SnippetNoCache': { |
312 | 312 | |
@@ -315,7 +315,7 @@ discard block |
||
315 | 315 | WHERE name="' . $name . '" |
316 | 316 | LIMIT 1'); |
317 | 317 | |
318 | - if ($modx->getDatabase()->getRecordCount($sql)) { |
|
318 | + if ($modx->getDatabase()->getRecordCount($sql)) { |
|
319 | 319 | $row = $modx->getDatabase()->getRow($sql); |
320 | 320 | $contextmenu = array( |
321 | 321 | 'header' => array( |
@@ -326,13 +326,13 @@ discard block |
||
326 | 326 | 'url' => "index.php?a=22&id=" . $row['id'] |
327 | 327 | ) |
328 | 328 | ); |
329 | - if (!empty($row['description'])) { |
|
329 | + if (!empty($row['description'])) { |
|
330 | 330 | $contextmenu['seperator'] = ''; |
331 | 331 | $contextmenu['description'] = array( |
332 | 332 | 'innerHTML' => '<i class="fa fa-info"></i> ' . entities($row['description'], $modx->getConfig('modx_charset')) |
333 | 333 | ); |
334 | 334 | } |
335 | - } else { |
|
335 | + } else { |
|
336 | 336 | $contextmenu = array( |
337 | 337 | 'header' => array( |
338 | 338 | 'innerHTML' => '<i class="fa fa-code"></i> ' . entities($name, $modx->getConfig('modx_charset')) |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | WHERE name="' . $name . '" |
354 | 354 | LIMIT 1'); |
355 | 355 | |
356 | - if ($modx->getDatabase()->getRecordCount($sql)) { |
|
356 | + if ($modx->getDatabase()->getRecordCount($sql)) { |
|
357 | 357 | $row = $modx->getDatabase()->getRow($sql); |
358 | 358 | $contextmenu = array( |
359 | 359 | 'header' => array( |
@@ -364,13 +364,13 @@ discard block |
||
364 | 364 | 'url' => "index.php?a=78&id=" . $row['id'] |
365 | 365 | ) |
366 | 366 | ); |
367 | - if (!empty($row['description'])) { |
|
367 | + if (!empty($row['description'])) { |
|
368 | 368 | $contextmenu['seperator'] = ''; |
369 | 369 | $contextmenu['description'] = array( |
370 | 370 | 'innerHTML' => '<i class="fa fa-info"></i> ' . entities($row['description'], $modx->getConfig('modx_charset')) |
371 | 371 | ); |
372 | 372 | } |
373 | - } else { |
|
373 | + } else { |
|
374 | 374 | $contextmenu = array( |
375 | 375 | 'header' => array( |
376 | 376 | 'innerHTML' => '<i class="fa fa-th-large"></i> ' . entities($name, $modx->getConfig('modx_charset')) |
@@ -390,7 +390,7 @@ discard block |
||
390 | 390 | WHERE name="' . $name . '" |
391 | 391 | LIMIT 1'); |
392 | 392 | |
393 | - if ($modx->getDatabase()->getRecordCount($sql)) { |
|
393 | + if ($modx->getDatabase()->getRecordCount($sql)) { |
|
394 | 394 | $row = $modx->getDatabase()->getRow($sql); |
395 | 395 | $contextmenu = array( |
396 | 396 | 'header' => array( |
@@ -401,20 +401,20 @@ discard block |
||
401 | 401 | 'url' => "index.php?a=78&id=" . $row['id'] |
402 | 402 | ) |
403 | 403 | ); |
404 | - if (!empty($row['description'])) { |
|
404 | + if (!empty($row['description'])) { |
|
405 | 405 | $contextmenu['seperator'] = ''; |
406 | 406 | $contextmenu['description'] = array( |
407 | 407 | 'innerHTML' => '<i class="fa fa-info"></i> ' . entities($row['description'], $modx->getConfig('modx_charset')) |
408 | 408 | ); |
409 | 409 | } |
410 | - } else { |
|
410 | + } else { |
|
411 | 411 | |
412 | 412 | $sql = $modx->getDatabase()->query('SELECT * |
413 | 413 | FROM ' . $modx->getFullTableName('site_snippets') . ' |
414 | 414 | WHERE name="' . $name . '" |
415 | 415 | LIMIT 1'); |
416 | 416 | |
417 | - if ($modx->getDatabase()->getRecordCount($sql)) { |
|
417 | + if ($modx->getDatabase()->getRecordCount($sql)) { |
|
418 | 418 | $row = $modx->getDatabase()->getRow($sql); |
419 | 419 | $contextmenu = array( |
420 | 420 | 'header' => array( |
@@ -425,13 +425,13 @@ discard block |
||
425 | 425 | 'url' => "index.php?a=22&id=" . $row['id'] |
426 | 426 | ) |
427 | 427 | ); |
428 | - if (!empty($row['description'])) { |
|
428 | + if (!empty($row['description'])) { |
|
429 | 429 | $contextmenu['seperator'] = ''; |
430 | 430 | $contextmenu['description'] = array( |
431 | 431 | 'innerHTML' => '<i class="fa fa-info"></i> ' . entities($row['description'], $modx->getConfig('modx_charset')) |
432 | 432 | ); |
433 | 433 | } |
434 | - } else { |
|
434 | + } else { |
|
435 | 435 | $contextmenu = array( |
436 | 436 | 'header' => array( |
437 | 437 | 'innerHTML' => '<i class="fa fa-code"></i> ' . entities($name, $modx->getConfig('modx_charset')) |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | 'alias_visible' |
494 | 494 | ); |
495 | 495 | |
496 | - if (in_array($name, $default_field)) { |
|
496 | + if (in_array($name, $default_field)) { |
|
497 | 497 | return; |
498 | 498 | } |
499 | 499 | |
@@ -502,7 +502,7 @@ discard block |
||
502 | 502 | WHERE name="' . $name . '" |
503 | 503 | LIMIT 1'); |
504 | 504 | |
505 | - if ($modx->getDatabase()->getRecordCount($sql)) { |
|
505 | + if ($modx->getDatabase()->getRecordCount($sql)) { |
|
506 | 506 | $row = $modx->getDatabase()->getRow($sql); |
507 | 507 | $contextmenu = array( |
508 | 508 | 'header' => array( |
@@ -513,13 +513,13 @@ discard block |
||
513 | 513 | 'url' => "index.php?a=301&id=" . $row['id'] |
514 | 514 | ) |
515 | 515 | ); |
516 | - if (!empty($row['description'])) { |
|
516 | + if (!empty($row['description'])) { |
|
517 | 517 | $contextmenu['seperator'] = ''; |
518 | 518 | $contextmenu['description'] = array( |
519 | 519 | 'innerHTML' => '<i class="fa fa-info"></i> ' . entities($row['description'], $modx->getConfig('modx_charset')) |
520 | 520 | ); |
521 | 521 | } |
522 | - } else { |
|
522 | + } else { |
|
523 | 523 | $contextmenu = array( |
524 | 524 | 'header' => array( |
525 | 525 | 'innerHTML' => '<i class="fa fa-list-alt"></i> ' . entities($name, $modx->getConfig('modx_charset')) |
@@ -544,13 +544,13 @@ discard block |
||
544 | 544 | case 'movedocument' : { |
545 | 545 | $json = array(); |
546 | 546 | |
547 | - if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
|
547 | + if ($modx->hasPermission('new_document') && $modx->hasPermission('edit_document') && $modx->hasPermission('save_document')) { |
|
548 | 548 | $id = !empty($_REQUEST['id']) ? (int)$_REQUEST['id'] : ''; |
549 | 549 | $parent = isset($_REQUEST['parent']) ? (int)$_REQUEST['parent'] : 0; |
550 | 550 | $menuindex = isset($_REQUEST['menuindex']) && is_scalar($_REQUEST['menuindex']) ? $_REQUEST['menuindex'] : 0; |
551 | 551 | |
552 | 552 | // set parent |
553 | - if ($id && $parent >= 0) { |
|
553 | + if ($id && $parent >= 0) { |
|
554 | 554 | |
555 | 555 | // find older parent |
556 | 556 | $parentOld = $modx->getDatabase()->getValue($modx->getDatabase()->select('parent', $modx->getFullTableName('site_content'), 'id=' . $id)); |
@@ -561,31 +561,31 @@ discard block |
||
561 | 561 | 'new_parent' => $parent, |
562 | 562 | ]); |
563 | 563 | |
564 | - if (is_array($eventOut) && count($eventOut) > 0) { |
|
564 | + if (is_array($eventOut) && count($eventOut) > 0) { |
|
565 | 565 | $eventParent = array_pop($eventOut); |
566 | 566 | |
567 | - if ($eventParent == $parentOld) { |
|
567 | + if ($eventParent == $parentOld) { |
|
568 | 568 | $json['errors'] = $_lang['error_movedocument2']; |
569 | - } else { |
|
569 | + } else { |
|
570 | 570 | $parent = $eventParent; |
571 | 571 | } |
572 | 572 | } |
573 | 573 | |
574 | - if (empty($json['errors'])) { |
|
574 | + if (empty($json['errors'])) { |
|
575 | 575 | // check privileges user for move docs |
576 | - if (!empty($modx->config['tree_show_protected']) && $role != 1) { |
|
576 | + if (!empty($modx->config['tree_show_protected']) && $role != 1) { |
|
577 | 577 | $sql = $modx->getDatabase()->select('*', $modx->getFullTableName('document_groups'), 'document IN(' . $id . ',' . $parent . ',' . $parentOld . ')'); |
578 | - if ($modx->getDatabase()->getRecordCount($sql)) { |
|
578 | + if ($modx->getDatabase()->getRecordCount($sql)) { |
|
579 | 579 | $document_groups = array(); |
580 | - while ($row = $modx->getDatabase()->getRow($sql)) { |
|
580 | + while ($row = $modx->getDatabase()->getRow($sql)) { |
|
581 | 581 | $document_groups[$row['document']]['groups'][] = $row['document_group']; |
582 | 582 | } |
583 | - foreach ($document_groups as $key => $value) { |
|
584 | - if (($key == $parent || $key == $parentOld || $key == $id) && !in_array($role, $value['groups'])) { |
|
583 | + foreach ($document_groups as $key => $value) { |
|
584 | + if (($key == $parent || $key == $parentOld || $key == $id) && !in_array($role, $value['groups'])) { |
|
585 | 585 | $json['errors'] = $_lang["error_no_privileges"]; |
586 | 586 | } |
587 | 587 | } |
588 | - if ($json['errors']) { |
|
588 | + if ($json['errors']) { |
|
589 | 589 | header('content-type: application/json'); |
590 | 590 | echo json_encode($json, JSON_FORCE_OBJECT | JSON_UNESCAPED_UNICODE); |
591 | 591 | break; |
@@ -593,9 +593,9 @@ discard block |
||
593 | 593 | } |
594 | 594 | } |
595 | 595 | |
596 | - if ($parent == 0 && $parent != $parentOld && !$modx->config['udperms_allowroot'] && $role != 1) { |
|
596 | + if ($parent == 0 && $parent != $parentOld && !$modx->config['udperms_allowroot'] && $role != 1) { |
|
597 | 597 | $json['errors'] = $_lang["error_no_privileges"]; |
598 | - } else { |
|
598 | + } else { |
|
599 | 599 | // set new parent |
600 | 600 | $modx->getDatabase()->update(array( |
601 | 601 | 'parent' => $parent |
@@ -605,13 +605,13 @@ discard block |
||
605 | 605 | 'isfolder' => 1 |
606 | 606 | ), $modx->getFullTableName('site_content'), 'id=' . $parent); |
607 | 607 | |
608 | - if ($parent != $parentOld) { |
|
608 | + if ($parent != $parentOld) { |
|
609 | 609 | // check children docs and set parent isfolder |
610 | - if ($modx->getDatabase()->getRecordCount($modx->getDatabase()->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) { |
|
610 | + if ($modx->getDatabase()->getRecordCount($modx->getDatabase()->select('id', $modx->getFullTableName('site_content'), 'parent=' . $parentOld))) { |
|
611 | 611 | $modx->getDatabase()->update(array( |
612 | 612 | 'isfolder' => 1 |
613 | 613 | ), $modx->getFullTableName('site_content'), 'id=' . $parentOld); |
614 | - } else { |
|
614 | + } else { |
|
615 | 615 | $modx->getDatabase()->update(array( |
616 | 616 | 'isfolder' => 0 |
617 | 617 | ), $modx->getFullTableName('site_content'), 'id=' . $parentOld); |
@@ -619,16 +619,16 @@ discard block |
||
619 | 619 | } |
620 | 620 | |
621 | 621 | // set menuindex |
622 | - if (!empty($menuindex)) { |
|
622 | + if (!empty($menuindex)) { |
|
623 | 623 | $menuindex = explode(',', $menuindex); |
624 | - foreach ($menuindex as $key => $value) { |
|
624 | + foreach ($menuindex as $key => $value) { |
|
625 | 625 | $modx->getDatabase()->query('UPDATE ' . $modx->getFullTableName('site_content') . ' SET menuindex=' . $key . ' WHERE id=' . $value); |
626 | 626 | } |
627 | - } else { |
|
627 | + } else { |
|
628 | 628 | // TODO: max(*) menuindex |
629 | 629 | } |
630 | 630 | |
631 | - if (!$json['errors']) { |
|
631 | + if (!$json['errors']) { |
|
632 | 632 | $json['success'] = $_lang["actioncomplete"]; |
633 | 633 | |
634 | 634 | $modx->invokeEvent('onAfterMoveDocument', [ |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | } |
641 | 641 | } |
642 | 642 | } |
643 | - } else { |
|
643 | + } else { |
|
644 | 644 | $json['errors'] = $_lang["error_no_privileges"]; |
645 | 645 | } |
646 | 646 | |
@@ -656,7 +656,7 @@ discard block |
||
656 | 656 | |
657 | 657 | $output = !!$modx->elementIsLocked($type, $id, true); |
658 | 658 | |
659 | - if (!$output) { |
|
659 | + if (!$output) { |
|
660 | 660 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
661 | 661 | $docgrp_cond = $docgrp ? ' OR dg.document_group IN (' . $docgrp . ')' : ''; |
662 | 662 | $sql = ' |
@@ -665,7 +665,7 @@ discard block |
||
665 | 665 | LEFT JOIN ' . $modx->getFullTableName('document_groups') . ' dg ON dg.document=sc.id |
666 | 666 | WHERE sc.id=' . $id . ' GROUP BY sc.id'; |
667 | 667 | $sql = $modx->getDatabase()->query($sql); |
668 | - if ($modx->getDatabase()->getRecordCount($sql)) { |
|
668 | + if ($modx->getDatabase()->getRecordCount($sql)) { |
|
669 | 669 | $row = $modx->getDatabase()->getRow($sql); |
670 | 670 | $output = !!$row['locked']; |
671 | 671 | } |
@@ -238,66 +238,66 @@ discard block |
||
238 | 238 | $addnew = 0; |
239 | 239 | $run = 0; |
240 | 240 | switch($action) { |
241 | - case '3': |
|
242 | - case '4': |
|
243 | - case '27': |
|
244 | - case '72': |
|
245 | - if($modx->hasPermission('new_document')) { |
|
246 | - $addnew = 1; |
|
247 | - } |
|
248 | - break; |
|
249 | - case '16': |
|
250 | - case '19': |
|
251 | - if($modx->hasPermission('new_template')) { |
|
252 | - $addnew = 1; |
|
253 | - } |
|
254 | - break; |
|
255 | - case '300': |
|
256 | - case '301': |
|
257 | - if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) { |
|
258 | - $addnew = 1; |
|
259 | - } |
|
260 | - break; |
|
261 | - case '77': |
|
262 | - case '78': |
|
263 | - if($modx->hasPermission('new_chunk')) { |
|
264 | - $addnew = 1; |
|
265 | - } |
|
266 | - break; |
|
267 | - case '22': |
|
268 | - case '23': |
|
269 | - if($modx->hasPermission('new_snippet')) { |
|
270 | - $addnew = 1; |
|
271 | - } |
|
272 | - break; |
|
273 | - case '101': |
|
274 | - case '102': |
|
275 | - if($modx->hasPermission('new_plugin')) { |
|
276 | - $addnew = 1; |
|
277 | - } |
|
278 | - break; |
|
279 | - case '106': |
|
280 | - case '107': |
|
281 | - case '108': |
|
282 | - if($modx->hasPermission('new_module')) { |
|
283 | - $addnew = 1; |
|
284 | - } |
|
285 | - if($modx->hasPermission('exec_module')) { |
|
286 | - $run = 1; |
|
287 | - } |
|
288 | - break; |
|
289 | - case '88': |
|
290 | - if($modx->hasPermission('new_web_user')) { |
|
291 | - $addnew = 1; |
|
292 | - } |
|
293 | - break; |
|
241 | + case '3': |
|
242 | + case '4': |
|
243 | + case '27': |
|
244 | + case '72': |
|
245 | + if($modx->hasPermission('new_document')) { |
|
246 | + $addnew = 1; |
|
247 | + } |
|
248 | + break; |
|
249 | + case '16': |
|
250 | + case '19': |
|
251 | + if($modx->hasPermission('new_template')) { |
|
252 | + $addnew = 1; |
|
253 | + } |
|
254 | + break; |
|
255 | + case '300': |
|
256 | + case '301': |
|
257 | + if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) { |
|
258 | + $addnew = 1; |
|
259 | + } |
|
260 | + break; |
|
261 | + case '77': |
|
262 | + case '78': |
|
263 | + if($modx->hasPermission('new_chunk')) { |
|
264 | + $addnew = 1; |
|
265 | + } |
|
266 | + break; |
|
267 | + case '22': |
|
268 | + case '23': |
|
269 | + if($modx->hasPermission('new_snippet')) { |
|
270 | + $addnew = 1; |
|
271 | + } |
|
272 | + break; |
|
273 | + case '101': |
|
274 | + case '102': |
|
275 | + if($modx->hasPermission('new_plugin')) { |
|
276 | + $addnew = 1; |
|
277 | + } |
|
278 | + break; |
|
279 | + case '106': |
|
280 | + case '107': |
|
281 | + case '108': |
|
282 | + if($modx->hasPermission('new_module')) { |
|
283 | + $addnew = 1; |
|
284 | + } |
|
285 | + if($modx->hasPermission('exec_module')) { |
|
286 | + $run = 1; |
|
287 | + } |
|
288 | + break; |
|
289 | + case '88': |
|
290 | + if($modx->hasPermission('new_web_user')) { |
|
291 | + $addnew = 1; |
|
292 | + } |
|
293 | + break; |
|
294 | 294 | } |
295 | 295 | |
296 | 296 | $disabled = ($action == '19' || $action == '300' || $action == '77' || $action == '23' || $action == '101' || $action == '4' || $action == '72' || $action == '87' || $action == '11' || $action == '107' || $action == '38') ? ' disabled' : ''; |
297 | 297 | |
298 | 298 | $_style['actionbuttons'] = array( |
299 | - 'dynamic' => array( |
|
300 | - 'document' => '<div id="actions"> |
|
299 | + 'dynamic' => array( |
|
300 | + 'document' => '<div id="actions"> |
|
301 | 301 | <div class="btn-group"> |
302 | 302 | <div class="btn-group"> |
303 | 303 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option> |
313 | 313 | </select> |
314 | 314 | </div>' . |
315 | - ($addnew ? ' |
|
315 | + ($addnew ? ' |
|
316 | 316 | <a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();"> |
317 | 317 | <i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span> |
318 | 318 | </a> |
@@ -328,7 +328,7 @@ discard block |
||
328 | 328 | </a> |
329 | 329 | </div> |
330 | 330 | </div>', |
331 | - 'user' => '<div id="actions"> |
|
331 | + 'user' => '<div id="actions"> |
|
332 | 332 | <div class="btn-group"> |
333 | 333 | <div class="btn-group"> |
334 | 334 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
@@ -351,7 +351,7 @@ discard block |
||
351 | 351 | </a> |
352 | 352 | </div> |
353 | 353 | </div>', |
354 | - 'element' => '<div id="actions"> |
|
354 | + 'element' => '<div id="actions"> |
|
355 | 355 | <div class="btn-group"> |
356 | 356 | <div class="btn-group"> |
357 | 357 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
@@ -384,21 +384,21 @@ discard block |
||
384 | 384 | ' : '') . ' |
385 | 385 | </div> |
386 | 386 | </div>', |
387 | - 'newmodule' => ($addnew ? '<div id="actions"> |
|
387 | + 'newmodule' => ($addnew ? '<div id="actions"> |
|
388 | 388 | <div class="btn-group"> |
389 | 389 | <a id="newModule" class="btn btn-secondary" href="javascript:;" onclick="actions.new();"> |
390 | 390 | <i class="fa fa-plus-circle"></i><span>' . $_lang['new_module'] . '</span> |
391 | 391 | </a> |
392 | 392 | </div> |
393 | 393 | </div>' : ''), |
394 | - 'close' => '<div id="actions"> |
|
394 | + 'close' => '<div id="actions"> |
|
395 | 395 | <div class="btn-group"> |
396 | 396 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.close();"> |
397 | 397 | <i class="' . $_style["actions_close"] . '"></i><span>' . $_lang['close'] . '</span> |
398 | 398 | </a> |
399 | 399 | </div> |
400 | 400 | </div>', |
401 | - 'save' => '<div id="actions"> |
|
401 | + 'save' => '<div id="actions"> |
|
402 | 402 | <div class="btn-group"> |
403 | 403 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
404 | 404 | <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
@@ -408,7 +408,7 @@ discard block |
||
408 | 408 | </a> |
409 | 409 | </div> |
410 | 410 | </div>', |
411 | - 'savedelete' => '<div id="actions"> |
|
411 | + 'savedelete' => '<div id="actions"> |
|
412 | 412 | <div class="btn-group"> |
413 | 413 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
414 | 414 | <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
@@ -421,14 +421,14 @@ discard block |
||
421 | 421 | </a> |
422 | 422 | </div> |
423 | 423 | </div>', |
424 | - 'cancel' => '<div id="actions"> |
|
424 | + 'cancel' => '<div id="actions"> |
|
425 | 425 | <div class="btn-group"> |
426 | 426 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
427 | 427 | <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
428 | 428 | </a> |
429 | 429 | </div> |
430 | 430 | </div>', |
431 | - 'canceldelete' => '<div id="actions"> |
|
431 | + 'canceldelete' => '<div id="actions"> |
|
432 | 432 | <div class="btn-group"> |
433 | 433 | <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
434 | 434 | <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
@@ -438,11 +438,11 @@ discard block |
||
438 | 438 | </a> |
439 | 439 | </div> |
440 | 440 | </div>', |
441 | - ), |
|
442 | - 'static' => array( |
|
443 | - 'document' => '<div id="actions"> |
|
441 | + ), |
|
442 | + 'static' => array( |
|
443 | + 'document' => '<div id="actions"> |
|
444 | 444 | <div class="btn-group">' . |
445 | - ($addnew ? ' |
|
445 | + ($addnew ? ' |
|
446 | 446 | <a class="btn btn-secondary" href="javascript:;" onclick="actions.new();"> |
447 | 447 | <i class="' . $_style["icons_new_document"] . '"></i><span>' . $_lang['create_resource_here'] . '</span> |
448 | 448 | </a> |
@@ -467,12 +467,12 @@ discard block |
||
467 | 467 | </a> |
468 | 468 | </div> |
469 | 469 | </div>', |
470 | - 'cancel' => '<div id="actions"> |
|
470 | + 'cancel' => '<div id="actions"> |
|
471 | 471 | <div class="btn-group"> |
472 | 472 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
473 | 473 | <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
474 | 474 | </a> |
475 | 475 | </div> |
476 | 476 | </div>', |
477 | - ) |
|
477 | + ) |
|
478 | 478 | ); |
@@ -8,21 +8,21 @@ discard block |
||
8 | 8 | * Version: 1.1 |
9 | 9 | * MODX version: 1.0.3 |
10 | 10 | */ |
11 | -$style_path = 'media/style/' . ManagerTheme::getTheme() . '/images/'; |
|
11 | +$style_path = 'media/style/'.ManagerTheme::getTheme().'/images/'; |
|
12 | 12 | $modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php'; |
13 | 13 | |
14 | -if(!empty($_GET['a']) && $_GET['a'] == 2) { |
|
14 | +if (!empty($_GET['a']) && $_GET['a'] == 2) { |
|
15 | 15 | $modx->config['enable_filter'] = 1; |
16 | 16 | |
17 | - $modx->addSnippet('hasPermission','return $modx->hasPermission($key);'); |
|
17 | + $modx->addSnippet('hasPermission', 'return $modx->hasPermission($key);'); |
|
18 | 18 | |
19 | - 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')) |
|
19 | + 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')) |
|
20 | 20 | $hasAnyPermission = 1; |
21 | 21 | else $hasAnyPermission = 0; |
22 | - $modx->addSnippet('hasAnyPermission','global $hasAnyPermission; return $hasAnyPermission;'); |
|
23 | - $modx->addSnippet('getLoginUserName','return $modx->getLoginUserName();'); |
|
22 | + $modx->addSnippet('hasAnyPermission', 'global $hasAnyPermission; return $hasAnyPermission;'); |
|
23 | + $modx->addSnippet('getLoginUserName', 'return $modx->getLoginUserName();'); |
|
24 | 24 | $code = 'global $_lang;return $_SESSION["nrtotalmessages"] ? sprintf($_lang["welcome_messages"], $_SESSION["nrtotalmessages"], \'<span style="color:red;">\' . $_SESSION["nrnewmessages"] . "</span>") : $_lang["messages_no_messages"];'; |
25 | - $modx->addSnippet('getMessageCount',$code); |
|
25 | + $modx->addSnippet('getMessageCount', $code); |
|
26 | 26 | |
27 | 27 | // Large Icons |
28 | 28 | $_style['icons_backup_large'] = 'fa fa-database fa-fw fa-2x'; |
@@ -41,7 +41,7 @@ discard block |
||
41 | 41 | } |
42 | 42 | |
43 | 43 | // Favicon |
44 | -$_style['favicon'] = (file_exists(MODX_BASE_PATH . 'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/' . ManagerTheme::getTheme() . '/images/favicon.ico'); |
|
44 | +$_style['favicon'] = (file_exists(MODX_BASE_PATH.'favicon.ico') ? MODX_SITE_URL . 'favicon.ico' : 'media/style/'.ManagerTheme::getTheme().'/images/favicon.ico'); |
|
45 | 45 | |
46 | 46 | // Tree Menu Toolbar |
47 | 47 | $_style['show_tree'] = $style_path.'tree/expand.png'; |
@@ -70,10 +70,10 @@ discard block |
||
70 | 70 | $_style['tree_page_word'] = "<i class='fa fa-file-word-o'></i>"; |
71 | 71 | $_style['tree_page_excel'] = "<i class='fa fa-file-excel-o'></i>"; |
72 | 72 | |
73 | -$_style['tree_minusnode'] = "<i class='fa fa-angle-down'></i>";//$style_path.'tree/angle-down.png'; |
|
74 | -$_style['tree_plusnode'] = "<i class='fa fa-angle-right'></i>";//$style_path.'tree/angle-right.png'; |
|
73 | +$_style['tree_minusnode'] = "<i class='fa fa-angle-down'></i>"; //$style_path.'tree/angle-down.png'; |
|
74 | +$_style['tree_plusnode'] = "<i class='fa fa-angle-right'></i>"; //$style_path.'tree/angle-right.png'; |
|
75 | 75 | $_style['tree_weblink'] = $style_path.'tree/link.png'; |
76 | -$_style['tree_preview_resource'] = "<i class='fa fa-eye'></i>";//$style_path.'icons/eye.png'; |
|
76 | +$_style['tree_preview_resource'] = "<i class='fa fa-eye'></i>"; //$style_path.'icons/eye.png'; |
|
77 | 77 | |
78 | 78 | $_style['tree_showtree'] = '<i class="fa fa-sitemap"></i>'; |
79 | 79 | $_style['tree_working'] = '<i class="fa fa-warning"></i>'; |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | $_style['icons_edit_document'] = $style_path.'icons/save.png'; |
106 | 106 | $_style['icons_delete_document'] = $style_path.'icons/trash.png'; |
107 | 107 | //locks |
108 | -$_style['icons_preview_resource'] = $style_path.'icons/eye.png';//$style_path.'icons/eye.png'; |
|
109 | -$_style['icons_secured'] = "<i class='fa fa-lock'></i>";//$style_path.'icons/lock.png'; |
|
108 | +$_style['icons_preview_resource'] = $style_path.'icons/eye.png'; //$style_path.'icons/eye.png'; |
|
109 | +$_style['icons_secured'] = "<i class='fa fa-lock'></i>"; //$style_path.'icons/lock.png'; |
|
110 | 110 | |
111 | 111 | //file manager icons |
112 | 112 | $_style['files_save'] = 'fa fa-floppy-o'; |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $_style['icons_set_parent'] = $style_path.'icons/folder-open.png'; |
178 | 178 | |
179 | 179 | //modules |
180 | -$_style['icons_module'] = 'fa fa-cube'; |
|
180 | +$_style['icons_module'] = 'fa fa-cube'; |
|
181 | 181 | $_style['icons_modules'] = 'fa fa-cubes'; //$style_path.'icons/modules.png'; |
182 | 182 | $_style['icons_run'] = $style_path.'icons/play.png'; |
183 | 183 | |
@@ -237,57 +237,57 @@ discard block |
||
237 | 237 | $stay = isset($_REQUEST['stay']) ? $_REQUEST['stay'] : ''; |
238 | 238 | $addnew = 0; |
239 | 239 | $run = 0; |
240 | -switch($action) { |
|
240 | +switch ($action) { |
|
241 | 241 | case '3': |
242 | 242 | case '4': |
243 | 243 | case '27': |
244 | 244 | case '72': |
245 | - if($modx->hasPermission('new_document')) { |
|
245 | + if ($modx->hasPermission('new_document')) { |
|
246 | 246 | $addnew = 1; |
247 | 247 | } |
248 | 248 | break; |
249 | 249 | case '16': |
250 | 250 | case '19': |
251 | - if($modx->hasPermission('new_template')) { |
|
251 | + if ($modx->hasPermission('new_template')) { |
|
252 | 252 | $addnew = 1; |
253 | 253 | } |
254 | 254 | break; |
255 | 255 | case '300': |
256 | 256 | case '301': |
257 | - if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) { |
|
257 | + if ($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) { |
|
258 | 258 | $addnew = 1; |
259 | 259 | } |
260 | 260 | break; |
261 | 261 | case '77': |
262 | 262 | case '78': |
263 | - if($modx->hasPermission('new_chunk')) { |
|
263 | + if ($modx->hasPermission('new_chunk')) { |
|
264 | 264 | $addnew = 1; |
265 | 265 | } |
266 | 266 | break; |
267 | 267 | case '22': |
268 | 268 | case '23': |
269 | - if($modx->hasPermission('new_snippet')) { |
|
269 | + if ($modx->hasPermission('new_snippet')) { |
|
270 | 270 | $addnew = 1; |
271 | 271 | } |
272 | 272 | break; |
273 | 273 | case '101': |
274 | 274 | case '102': |
275 | - if($modx->hasPermission('new_plugin')) { |
|
275 | + if ($modx->hasPermission('new_plugin')) { |
|
276 | 276 | $addnew = 1; |
277 | 277 | } |
278 | 278 | break; |
279 | 279 | case '106': |
280 | 280 | case '107': |
281 | 281 | case '108': |
282 | - if($modx->hasPermission('new_module')) { |
|
282 | + if ($modx->hasPermission('new_module')) { |
|
283 | 283 | $addnew = 1; |
284 | 284 | } |
285 | - if($modx->hasPermission('exec_module')) { |
|
285 | + if ($modx->hasPermission('exec_module')) { |
|
286 | 286 | $run = 1; |
287 | 287 | } |
288 | 288 | break; |
289 | 289 | case '88': |
290 | - if($modx->hasPermission('new_web_user')) { |
|
290 | + if ($modx->hasPermission('new_web_user')) { |
|
291 | 291 | $addnew = 1; |
292 | 292 | } |
293 | 293 | break; |
@@ -301,30 +301,30 @@ discard block |
||
301 | 301 | <div class="btn-group"> |
302 | 302 | <div class="btn-group"> |
303 | 303 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
304 | - <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
|
304 | + <i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span> |
|
305 | 305 | </a> |
306 | 306 | <span class="btn btn-success plus dropdown-toggle"></span> |
307 | 307 | <select id="stay" name="stay"> |
308 | 308 | ' . ($addnew ? ' |
309 | - <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '') . '>' . $_lang['stay_new'] . '</option> |
|
310 | - ' : '') . ' |
|
311 | - <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '') . '>' . $_lang['stay'] . '</option> |
|
312 | - <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option> |
|
309 | + <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '').'>'.$_lang['stay_new'].'</option> |
|
310 | + ' : '').' |
|
311 | + <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '').'>'.$_lang['stay'].'</option> |
|
312 | + <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '').'>'.$_lang['close'].'</option> |
|
313 | 313 | </select> |
314 | 314 | </div>' . |
315 | 315 | ($addnew ? ' |
316 | - <a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();"> |
|
317 | - <i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span> |
|
316 | + <a id="Button6" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.duplicate();"> |
|
317 | + <i class="' . $_style["actions_duplicate"].'"></i><span>'.$_lang['duplicate'].'</span> |
|
318 | 318 | </a> |
319 | - ' : '') . ' |
|
320 | - <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
|
321 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
319 | + ' : '').' |
|
320 | + <a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();"> |
|
321 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
322 | 322 | </a> |
323 | 323 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
324 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
324 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
325 | 325 | </a> |
326 | 326 | <a id="Button4" class="btn btn-secondary" href="javascript:;" onclick="actions.view();"> |
327 | - <i class="' . $_style["actions_preview"] . '"></i><span>' . $_lang['preview'] . '</span> |
|
327 | + <i class="' . $_style["actions_preview"].'"></i><span>'.$_lang['preview'].'</span> |
|
328 | 328 | </a> |
329 | 329 | </div> |
330 | 330 | </div>', |
@@ -332,22 +332,22 @@ discard block |
||
332 | 332 | <div class="btn-group"> |
333 | 333 | <div class="btn-group"> |
334 | 334 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
335 | - <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
|
335 | + <i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span> |
|
336 | 336 | </a> |
337 | 337 | <span class="btn btn-success plus dropdown-toggle"></span> |
338 | 338 | <select id="stay" name="stay"> |
339 | 339 | ' . ($addnew ? ' |
340 | - <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '') . '>' . $_lang['stay_new'] . '</option> |
|
341 | - ' : '') . ' |
|
342 | - <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '') . '>' . $_lang['stay'] . '</option> |
|
343 | - <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option> |
|
340 | + <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '').'>'.$_lang['stay_new'].'</option> |
|
341 | + ' : '').' |
|
342 | + <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '').'>'.$_lang['stay'].'</option> |
|
343 | + <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '').'>'.$_lang['close'].'</option> |
|
344 | 344 | </select> |
345 | 345 | </div> |
346 | - <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
|
347 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
346 | + <a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();"> |
|
347 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
348 | 348 | </a> |
349 | 349 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
350 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
350 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
351 | 351 | </a> |
352 | 352 | </div> |
353 | 353 | </div>', |
@@ -355,86 +355,86 @@ discard block |
||
355 | 355 | <div class="btn-group"> |
356 | 356 | <div class="btn-group"> |
357 | 357 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
358 | - <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
|
358 | + <i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span> |
|
359 | 359 | </a> |
360 | 360 | <span class="btn btn-success plus dropdown-toggle"></span> |
361 | 361 | <select id="stay" name="stay"> |
362 | 362 | ' . ($addnew ? ' |
363 | - <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '') . '>' . $_lang['stay_new'] . '</option> |
|
364 | - ' : '') . ' |
|
365 | - <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '') . '>' . $_lang['stay'] . '</option> |
|
366 | - <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '') . '>' . $_lang['close'] . '</option> |
|
363 | + <option id="stay1" value="1" ' . ($stay == '1' ? ' selected="selected"' : '').'>'.$_lang['stay_new'].'</option> |
|
364 | + ' : '').' |
|
365 | + <option id="stay2" value="2" ' . ($stay == '2' ? ' selected="selected"' : '').'>'.$_lang['stay'].'</option> |
|
366 | + <option id="stay3" value="" ' . ($stay == '' ? ' selected="selected"' : '').'>'.$_lang['close'].'</option> |
|
367 | 367 | </select> |
368 | 368 | </div> |
369 | 369 | ' . ($addnew ? ' |
370 | - <a id="Button6" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.duplicate();"> |
|
371 | - <i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span> |
|
370 | + <a id="Button6" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.duplicate();"> |
|
371 | + <i class="' . $_style["actions_duplicate"].'"></i><span>'.$_lang['duplicate'].'</span> |
|
372 | 372 | </a> |
373 | - ' : '') . ' |
|
374 | - <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
|
375 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
373 | + ' : '').' |
|
374 | + <a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();"> |
|
375 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
376 | 376 | </a> |
377 | 377 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
378 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
378 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
379 | 379 | </a> |
380 | 380 | ' . ($run ? ' |
381 | - <a id="Button4" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.run();"> |
|
382 | - <i class="' . $_style["actions_run"] . '"></i><span>' . $_lang['run_module'] . '</span> |
|
381 | + <a id="Button4" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.run();"> |
|
382 | + <i class="' . $_style["actions_run"].'"></i><span>'.$_lang['run_module'].'</span> |
|
383 | 383 | </a> |
384 | - ' : '') . ' |
|
384 | + ' : '').' |
|
385 | 385 | </div> |
386 | 386 | </div>', |
387 | 387 | 'newmodule' => ($addnew ? '<div id="actions"> |
388 | 388 | <div class="btn-group"> |
389 | 389 | <a id="newModule" class="btn btn-secondary" href="javascript:;" onclick="actions.new();"> |
390 | - <i class="fa fa-plus-circle"></i><span>' . $_lang['new_module'] . '</span> |
|
390 | + <i class="fa fa-plus-circle"></i><span>' . $_lang['new_module'].'</span> |
|
391 | 391 | </a> |
392 | 392 | </div> |
393 | 393 | </div>' : ''), |
394 | 394 | 'close' => '<div id="actions"> |
395 | 395 | <div class="btn-group"> |
396 | 396 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.close();"> |
397 | - <i class="' . $_style["actions_close"] . '"></i><span>' . $_lang['close'] . '</span> |
|
397 | + <i class="' . $_style["actions_close"].'"></i><span>'.$_lang['close'].'</span> |
|
398 | 398 | </a> |
399 | 399 | </div> |
400 | 400 | </div>', |
401 | 401 | 'save' => '<div id="actions"> |
402 | 402 | <div class="btn-group"> |
403 | 403 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
404 | - <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
|
404 | + <i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span> |
|
405 | 405 | </a> |
406 | 406 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
407 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
407 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
408 | 408 | </a> |
409 | 409 | </div> |
410 | 410 | </div>', |
411 | 411 | 'savedelete' => '<div id="actions"> |
412 | 412 | <div class="btn-group"> |
413 | 413 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.save();"> |
414 | - <i class="' . $_style["actions_save"] . '"></i><span>' . $_lang['save'] . '</span> |
|
414 | + <i class="' . $_style["actions_save"].'"></i><span>'.$_lang['save'].'</span> |
|
415 | 415 | </a> |
416 | - <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
|
417 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
416 | + <a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();"> |
|
417 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
418 | 418 | </a> |
419 | 419 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
420 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
420 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
421 | 421 | </a> |
422 | 422 | </div> |
423 | 423 | </div>', |
424 | 424 | 'cancel' => '<div id="actions"> |
425 | 425 | <div class="btn-group"> |
426 | 426 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
427 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
427 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
428 | 428 | </a> |
429 | 429 | </div> |
430 | 430 | </div>', |
431 | 431 | 'canceldelete' => '<div id="actions"> |
432 | 432 | <div class="btn-group"> |
433 | - <a id="Button3" class="btn btn-secondary' . $disabled . '" href="javascript:;" onclick="actions.delete();"> |
|
434 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
433 | + <a id="Button3" class="btn btn-secondary' . $disabled.'" href="javascript:;" onclick="actions.delete();"> |
|
434 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
435 | 435 | </a> |
436 | 436 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
437 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
437 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
438 | 438 | </a> |
439 | 439 | </div> |
440 | 440 | </div>', |
@@ -444,33 +444,33 @@ discard block |
||
444 | 444 | <div class="btn-group">' . |
445 | 445 | ($addnew ? ' |
446 | 446 | <a class="btn btn-secondary" href="javascript:;" onclick="actions.new();"> |
447 | - <i class="' . $_style["icons_new_document"] . '"></i><span>' . $_lang['create_resource_here'] . '</span> |
|
447 | + <i class="' . $_style["icons_new_document"].'"></i><span>'.$_lang['create_resource_here'].'</span> |
|
448 | 448 | </a> |
449 | 449 | <a class="btn btn-secondary" href="javascript:;" onclick="actions.newlink();"> |
450 | - <i class="' . $_style["icons_new_weblink"] . '"></i><span>' . $_lang['create_weblink_here'] . '</span> |
|
450 | + <i class="' . $_style["icons_new_weblink"].'"></i><span>'.$_lang['create_weblink_here'].'</span> |
|
451 | 451 | </a> |
452 | - ' : '') . ' |
|
452 | + ' : '').' |
|
453 | 453 | <a id="Button1" class="btn btn-success" href="javascript:;" onclick="actions.edit();"> |
454 | - <i class="' . $_style["actions_edit"] . '"></i><span>' . $_lang['edit'] . '</span> |
|
454 | + <i class="' . $_style["actions_edit"].'"></i><span>'.$_lang['edit'].'</span> |
|
455 | 455 | </a> |
456 | 456 | <a id="Button2" class="btn btn-secondary" href="javascript:;" onclick="actions.move();"> |
457 | - <i class="' . $_style["actions_move"] . '"></i><span>' . $_lang['move'] . '</span> |
|
457 | + <i class="' . $_style["actions_move"].'"></i><span>'.$_lang['move'].'</span> |
|
458 | 458 | </a> |
459 | 459 | <a id="Button6" class="btn btn-secondary" href="javascript:;" onclick="actions.duplicate();"> |
460 | - <i class="' . $_style["actions_duplicate"] . '"></i><span>' . $_lang['duplicate'] . '</span> |
|
460 | + <i class="' . $_style["actions_duplicate"].'"></i><span>'.$_lang['duplicate'].'</span> |
|
461 | 461 | </a> |
462 | 462 | <a id="Button3" class="btn btn-secondary" href="javascript:;" onclick="actions.delete();"> |
463 | - <i class="' . $_style["actions_delete"] . '"></i><span>' . $_lang['delete'] . '</span> |
|
463 | + <i class="' . $_style["actions_delete"].'"></i><span>'.$_lang['delete'].'</span> |
|
464 | 464 | </a> |
465 | 465 | <a id="Button4" class="btn btn-secondary" href="javascript:;" onclick="actions.view();"> |
466 | - <i class="' . $_style["actions_preview"] . '"></i><span>' . $_lang['preview'] . '</span> |
|
466 | + <i class="' . $_style["actions_preview"].'"></i><span>'.$_lang['preview'].'</span> |
|
467 | 467 | </a> |
468 | 468 | </div> |
469 | 469 | </div>', |
470 | 470 | 'cancel' => '<div id="actions"> |
471 | 471 | <div class="btn-group"> |
472 | 472 | <a id="Button5" class="btn btn-secondary" href="javascript:;" onclick="actions.cancel();"> |
473 | - <i class="' . $_style["actions_cancel"] . '"></i><span>' . $_lang['cancel'] . '</span> |
|
473 | + <i class="' . $_style["actions_cancel"].'"></i><span>'.$_lang['cancel'].'</span> |
|
474 | 474 | </a> |
475 | 475 | </div> |
476 | 476 | </div>', |
@@ -11,14 +11,16 @@ discard block |
||
11 | 11 | $style_path = 'media/style/' . ManagerTheme::getTheme() . '/images/'; |
12 | 12 | $modx->config['mgr_date_picker_path'] = 'media/calendar/datepicker.inc.php'; |
13 | 13 | |
14 | -if(!empty($_GET['a']) && $_GET['a'] == 2) { |
|
14 | +if(!empty($_GET['a']) && $_GET['a'] == 2) { |
|
15 | 15 | $modx->config['enable_filter'] = 1; |
16 | 16 | |
17 | 17 | $modx->addSnippet('hasPermission','return $modx->hasPermission($key);'); |
18 | 18 | |
19 | - 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')) |
|
20 | - $hasAnyPermission = 1; |
|
21 | - else $hasAnyPermission = 0; |
|
19 | + 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')) { |
|
20 | + $hasAnyPermission = 1; |
|
21 | + } else { |
|
22 | + $hasAnyPermission = 0; |
|
23 | + } |
|
22 | 24 | $modx->addSnippet('hasAnyPermission','global $hasAnyPermission; return $hasAnyPermission;'); |
23 | 25 | $modx->addSnippet('getLoginUserName','return $modx->getLoginUserName();'); |
24 | 26 | $code = 'global $_lang;return $_SESSION["nrtotalmessages"] ? sprintf($_lang["welcome_messages"], $_SESSION["nrtotalmessages"], \'<span style="color:red;">\' . $_SESSION["nrnewmessages"] . "</span>") : $_lang["messages_no_messages"];'; |
@@ -226,68 +228,68 @@ discard block |
||
226 | 228 | |
227 | 229 | // actions buttons templates |
228 | 230 | $action = isset($_REQUEST['a']) ? $_REQUEST['a'] : ''; |
229 | -if (!empty($modx->config['global_tabs']) && !isset($_SESSION['stay'])) { |
|
231 | +if (!empty($modx->config['global_tabs']) && !isset($_SESSION['stay'])) { |
|
230 | 232 | $_REQUEST['stay'] = 2; |
231 | 233 | } |
232 | -if (isset($_REQUEST['stay'])) { |
|
234 | +if (isset($_REQUEST['stay'])) { |
|
233 | 235 | $_SESSION['stay'] = $_REQUEST['stay']; |
234 | -} else if (isset($_SESSION['stay'])) { |
|
236 | +} else if (isset($_SESSION['stay'])) { |
|
235 | 237 | $_REQUEST['stay'] = $_SESSION['stay']; |
236 | 238 | } |
237 | 239 | $stay = isset($_REQUEST['stay']) ? $_REQUEST['stay'] : ''; |
238 | 240 | $addnew = 0; |
239 | 241 | $run = 0; |
240 | -switch($action) { |
|
242 | +switch($action) { |
|
241 | 243 | case '3': |
242 | 244 | case '4': |
243 | 245 | case '27': |
244 | 246 | case '72': |
245 | - if($modx->hasPermission('new_document')) { |
|
247 | + if($modx->hasPermission('new_document')) { |
|
246 | 248 | $addnew = 1; |
247 | 249 | } |
248 | 250 | break; |
249 | 251 | case '16': |
250 | 252 | case '19': |
251 | - if($modx->hasPermission('new_template')) { |
|
253 | + if($modx->hasPermission('new_template')) { |
|
252 | 254 | $addnew = 1; |
253 | 255 | } |
254 | 256 | break; |
255 | 257 | case '300': |
256 | 258 | case '301': |
257 | - if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) { |
|
259 | + if($modx->hasPermission('new_snippet') && $modx->hasPermission('new_chunk') && $modx->hasPermission('new_plugin')) { |
|
258 | 260 | $addnew = 1; |
259 | 261 | } |
260 | 262 | break; |
261 | 263 | case '77': |
262 | 264 | case '78': |
263 | - if($modx->hasPermission('new_chunk')) { |
|
265 | + if($modx->hasPermission('new_chunk')) { |
|
264 | 266 | $addnew = 1; |
265 | 267 | } |
266 | 268 | break; |
267 | 269 | case '22': |
268 | 270 | case '23': |
269 | - if($modx->hasPermission('new_snippet')) { |
|
271 | + if($modx->hasPermission('new_snippet')) { |
|
270 | 272 | $addnew = 1; |
271 | 273 | } |
272 | 274 | break; |
273 | 275 | case '101': |
274 | 276 | case '102': |
275 | - if($modx->hasPermission('new_plugin')) { |
|
277 | + if($modx->hasPermission('new_plugin')) { |
|
276 | 278 | $addnew = 1; |
277 | 279 | } |
278 | 280 | break; |
279 | 281 | case '106': |
280 | 282 | case '107': |
281 | 283 | case '108': |
282 | - if($modx->hasPermission('new_module')) { |
|
284 | + if($modx->hasPermission('new_module')) { |
|
283 | 285 | $addnew = 1; |
284 | 286 | } |
285 | - if($modx->hasPermission('exec_module')) { |
|
287 | + if($modx->hasPermission('exec_module')) { |
|
286 | 288 | $run = 1; |
287 | 289 | } |
288 | 290 | break; |
289 | 291 | case '88': |
290 | - if($modx->hasPermission('new_web_user')) { |
|
292 | + if($modx->hasPermission('new_web_user')) { |
|
291 | 293 | $addnew = 1; |
292 | 294 | } |
293 | 295 | break; |