@@ -18,9 +18,9 @@ |
||
18 | 18 | exit('send some data'); |
19 | 19 | } //?? |
20 | 20 | |
21 | -$indent = (int)$_REQUEST['indent']; |
|
22 | -$parent = (int)$_REQUEST['parent']; |
|
23 | -$expandAll = (int)$_REQUEST['expandAll']; |
|
21 | +$indent = (int) $_REQUEST['indent']; |
|
22 | +$parent = (int) $_REQUEST['parent']; |
|
23 | +$expandAll = (int) $_REQUEST['expandAll']; |
|
24 | 24 | $output = ''; |
25 | 25 | $hereid = isset($_REQUEST['id']) && is_numeric($_REQUEST['id']) ? $_REQUEST['id'] : ''; |
26 | 26 |
@@ -38,13 +38,13 @@ discard block |
||
38 | 38 | case 'publishedon': |
39 | 39 | case 'pub_date': |
40 | 40 | case 'unpub_date': |
41 | - $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.' . $_SESSION['tree_sortby'], 'sc.' . $_SESSION['tree_sortby']); |
|
41 | + $sortby = sprintf('CASE WHEN %s IS NULL THEN 1 ELSE 0 END, %s', 'sc.'.$_SESSION['tree_sortby'], 'sc.'.$_SESSION['tree_sortby']); |
|
42 | 42 | break; |
43 | 43 | default: |
44 | - $sortby = 'sc.' . $_SESSION['tree_sortby']; |
|
44 | + $sortby = 'sc.'.$_SESSION['tree_sortby']; |
|
45 | 45 | }; |
46 | 46 | |
47 | - $orderby = $modx->db->escape($sortby . ' ' . $_SESSION['tree_sortdir']); |
|
47 | + $orderby = $modx->db->escape($sortby.' '.$_SESSION['tree_sortdir']); |
|
48 | 48 | |
49 | 49 | // Folder sorting gets special setup ;) Add menuindex and pagetitle |
50 | 50 | if ($_SESSION['tree_sortby'] == 'isfolder') { |
@@ -58,11 +58,11 @@ discard block |
||
58 | 58 | $docgrp = (isset($_SESSION['mgrDocgroups']) && is_array($_SESSION['mgrDocgroups'])) ? implode(',', $_SESSION['mgrDocgroups']) : ''; |
59 | 59 | $showProtected = false; |
60 | 60 | if (isset ($modx->config['tree_show_protected'])) { |
61 | - $showProtected = (boolean)$modx->config['tree_show_protected']; |
|
61 | + $showProtected = (boolean) $modx->config['tree_show_protected']; |
|
62 | 62 | } |
63 | - $mgrRole = (isset ($_SESSION['mgrRole']) && (string)$_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
63 | + $mgrRole = (isset ($_SESSION['mgrRole']) && (string) $_SESSION['mgrRole'] === '1') ? '1' : '0'; |
|
64 | 64 | if ($showProtected == false) { |
65 | - $access = "AND (1={$mgrRole} OR sc.privatemgr=0" . (!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
65 | + $access = "AND (1={$mgrRole} OR sc.privatemgr=0".(!$docgrp ? ')' : " OR dg.document_group IN ({$docgrp}))"); |
|
66 | 66 | } else { |
67 | 67 | $access = ''; |
68 | 68 | } |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | } |
99 | 99 | |
100 | 100 | $weblinkDisplay = $row['type'] == 'reference' ? sprintf(' %s', $_style['tree_linkgo']) : ''; |
101 | - $pageIdDisplay = '<small>(' . ($modx_textdir ? '‏' : '') . $row['id'] . ')</small>'; |
|
101 | + $pageIdDisplay = '<small>('.($modx_textdir ? '‏' : '').$row['id'].')</small>'; |
|
102 | 102 | |
103 | 103 | // Prepare displaying user-locks |
104 | 104 | $lockedByUser = ''; |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | 'element_type' => $_lang["lock_element_type_7"], |
110 | 110 | 'lasthit_df' => $rowLock['lasthit_df'] |
111 | 111 | )); |
112 | - $lockedByUser = '<span title="' . $title . '" class="editResource">' . $_style['tree_preview_resource'] . '</span>'; |
|
112 | + $lockedByUser = '<span title="'.$title.'" class="editResource">'.$_style['tree_preview_resource'].'</span>'; |
|
113 | 113 | } else { |
114 | 114 | $title = $modx->parseText($_lang["lock_element_locked_by"], array( |
115 | 115 | 'element_type' => $_lang["lock_element_type_7"], |
@@ -117,9 +117,9 @@ discard block |
||
117 | 117 | 'lasthit_df' => $rowLock['lasthit_df'] |
118 | 118 | )); |
119 | 119 | if ($modx->hasPermission('remove_locks')) { |
120 | - $lockedByUser = '<span onclick="modx.tree.unlockElement(7, ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>'; |
|
120 | + $lockedByUser = '<span onclick="modx.tree.unlockElement(7, '.$row['id'].', this);return false;" title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>'; |
|
121 | 121 | } else { |
122 | - $lockedByUser = '<span title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>'; |
|
122 | + $lockedByUser = '<span title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>'; |
|
123 | 123 | } |
124 | 124 | } |
125 | 125 | } |
@@ -128,22 +128,22 @@ discard block |
||
128 | 128 | |
129 | 129 | $title = ''; |
130 | 130 | if (isDateNode($nodeNameSource)) { |
131 | - $title = $_lang['pagetitle'] . ': ' . $row['pagetitle'] . '[+lf+]'; |
|
131 | + $title = $_lang['pagetitle'].': '.$row['pagetitle'].'[+lf+]'; |
|
132 | 132 | } |
133 | - $title .= $_lang['id'] . ': ' . $row['id']; |
|
134 | - $title .= '[+lf+]' . $_lang['resource_opt_menu_title'] . ': ' . $row['menutitle']; |
|
135 | - $title .= '[+lf+]' . $_lang['resource_opt_menu_index'] . ': ' . $row['menuindex']; |
|
136 | - $title .= '[+lf+]' . $_lang['alias'] . ': ' . (!empty($row['alias']) ? $row['alias'] : '-'); |
|
137 | - $title .= '[+lf+]' . $_lang['template'] . ': ' . $row['templatename']; |
|
138 | - $title .= '[+lf+]' . $_lang['publish_date'] . ': ' . $modx->toDateFormat($row['pub_date']); |
|
139 | - $title .= '[+lf+]' . $_lang['unpublish_date'] . ': ' . $modx->toDateFormat($row['unpub_date']); |
|
140 | - $title .= '[+lf+]' . $_lang['page_data_web_access'] . ': ' . ($row['privateweb'] ? $_lang['private'] : $_lang['public']); |
|
141 | - $title .= '[+lf+]' . $_lang['page_data_mgr_access'] . ': ' . ($row['privatemgr'] ? $_lang['private'] : $_lang['public']); |
|
142 | - $title .= '[+lf+]' . $_lang['resource_opt_richtext'] . ': ' . ($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
143 | - $title .= '[+lf+]' . $_lang['page_data_searchable'] . ': ' . ($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
144 | - $title .= '[+lf+]' . $_lang['page_data_cacheable'] . ': ' . ($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
133 | + $title .= $_lang['id'].': '.$row['id']; |
|
134 | + $title .= '[+lf+]'.$_lang['resource_opt_menu_title'].': '.$row['menutitle']; |
|
135 | + $title .= '[+lf+]'.$_lang['resource_opt_menu_index'].': '.$row['menuindex']; |
|
136 | + $title .= '[+lf+]'.$_lang['alias'].': '.(!empty($row['alias']) ? $row['alias'] : '-'); |
|
137 | + $title .= '[+lf+]'.$_lang['template'].': '.$row['templatename']; |
|
138 | + $title .= '[+lf+]'.$_lang['publish_date'].': '.$modx->toDateFormat($row['pub_date']); |
|
139 | + $title .= '[+lf+]'.$_lang['unpublish_date'].': '.$modx->toDateFormat($row['unpub_date']); |
|
140 | + $title .= '[+lf+]'.$_lang['page_data_web_access'].': '.($row['privateweb'] ? $_lang['private'] : $_lang['public']); |
|
141 | + $title .= '[+lf+]'.$_lang['page_data_mgr_access'].': '.($row['privatemgr'] ? $_lang['private'] : $_lang['public']); |
|
142 | + $title .= '[+lf+]'.$_lang['resource_opt_richtext'].': '.($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
143 | + $title .= '[+lf+]'.$_lang['page_data_searchable'].': '.($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
144 | + $title .= '[+lf+]'.$_lang['page_data_cacheable'].': '.($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
145 | 145 | $title = $modx->htmlspecialchars($title); |
146 | - $title = str_replace('[+lf+]', ' ', $title); // replace line-breaks with empty space as fall-back |
|
146 | + $title = str_replace('[+lf+]', ' ', $title); // replace line-breaks with empty space as fall-back |
|
147 | 147 | |
148 | 148 | $data = array( |
149 | 149 | 'id' => $row['id'], |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | } |
228 | 228 | |
229 | 229 | if ($ph['contextmenu']) { |
230 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
230 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
231 | 231 | } |
232 | 232 | |
233 | 233 | if ($_SESSION['tree_show_only_folders']) { |
@@ -285,7 +285,7 @@ discard block |
||
285 | 285 | } |
286 | 286 | |
287 | 287 | if ($ph['contextmenu']) { |
288 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
288 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
289 | 289 | } |
290 | 290 | |
291 | 291 | $node .= $modx->parseText($tpl, $ph); |
@@ -323,7 +323,7 @@ discard block |
||
323 | 323 | } |
324 | 324 | |
325 | 325 | if ($ph['contextmenu']) { |
326 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
326 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
327 | 327 | } |
328 | 328 | |
329 | 329 | $node .= $modx->parseText($tpl, $ph); |
@@ -374,7 +374,7 @@ discard block |
||
374 | 374 | } |
375 | 375 | |
376 | 376 | if ($ph['contextmenu']) { |
377 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
377 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
378 | 378 | } |
379 | 379 | |
380 | 380 | $node .= $modx->parseText($tpl, $ph); |
@@ -416,7 +416,7 @@ discard block |
||
416 | 416 | } |
417 | 417 | |
418 | 418 | if ($ph['contextmenu']) { |
419 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
419 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
420 | 420 | } |
421 | 421 | |
422 | 422 | $node .= $modx->parseText($tpl, $ph); |
@@ -493,7 +493,7 @@ discard block |
||
493 | 493 | $nodetitle .= $modx->config['friendly_url_suffix']; |
494 | 494 | } |
495 | 495 | } |
496 | - $nodetitle = $modx->config['friendly_url_prefix'] . $nodetitle; |
|
496 | + $nodetitle = $modx->config['friendly_url_prefix'].$nodetitle; |
|
497 | 497 | break; |
498 | 498 | case 'pagetitle': |
499 | 499 | $nodetitle = $row['pagetitle']; |
@@ -553,7 +553,7 @@ discard block |
||
553 | 553 | { |
554 | 554 | global $modx; |
555 | 555 | |
556 | - return (int)$modx->db->getValue($modx->db->query('SELECT count(*) FROM ' . $modx->getFullTableName('site_content') . ' WHERE parent=' . $parent . ' AND isfolder=' . $isfolder . ' ')); |
|
556 | + return (int) $modx->db->getValue($modx->db->query('SELECT count(*) FROM '.$modx->getFullTableName('site_content').' WHERE parent='.$parent.' AND isfolder='.$isfolder.' ')); |
|
557 | 557 | } |
558 | 558 | |
559 | 559 | /** |