@@ -473,6 +473,9 @@ |
||
473 | 473 | ); |
474 | 474 | } |
475 | 475 | |
476 | +/** |
|
477 | + * @return string |
|
478 | + */ |
|
476 | 479 | function getNodeTitle($nodeNameSource, $row) |
477 | 480 | { |
478 | 481 | global $modx; |
@@ -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 | } |
@@ -101,7 +101,7 @@ discard block |
||
101 | 101 | } |
102 | 102 | |
103 | 103 | $weblinkDisplay = $row['type'] == 'reference' ? sprintf(' %s', $_style['tree_linkgo']) : ''; |
104 | - $pageIdDisplay = '<small>(' . ($modx_textdir ? '‏' : '') . $row['id'] . ')</small>'; |
|
104 | + $pageIdDisplay = '<small>('.($modx_textdir ? '‏' : '').$row['id'].')</small>'; |
|
105 | 105 | |
106 | 106 | // Prepare displaying user-locks |
107 | 107 | $lockedByUser = ''; |
@@ -112,7 +112,7 @@ discard block |
||
112 | 112 | 'element_type' => $_lang["lock_element_type_7"], |
113 | 113 | 'lasthit_df' => $rowLock['lasthit_df'] |
114 | 114 | )); |
115 | - $lockedByUser = '<span title="' . $title . '" class="editResource">' . $_style['tree_preview_resource'] . '</span>'; |
|
115 | + $lockedByUser = '<span title="'.$title.'" class="editResource">'.$_style['tree_preview_resource'].'</span>'; |
|
116 | 116 | } else { |
117 | 117 | $title = $modx->parseText($_lang["lock_element_locked_by"], array( |
118 | 118 | 'element_type' => $_lang["lock_element_type_7"], |
@@ -120,9 +120,9 @@ discard block |
||
120 | 120 | 'lasthit_df' => $rowLock['lasthit_df'] |
121 | 121 | )); |
122 | 122 | if ($modx->hasPermission('remove_locks')) { |
123 | - $lockedByUser = '<span onclick="modx.tree.unlockElement(7, ' . $row['id'] . ', this);return false;" title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>'; |
|
123 | + $lockedByUser = '<span onclick="modx.tree.unlockElement(7, '.$row['id'].', this);return false;" title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>'; |
|
124 | 124 | } else { |
125 | - $lockedByUser = '<span title="' . $title . '" class="lockedResource">' . $_style['icons_secured'] . '</span>'; |
|
125 | + $lockedByUser = '<span title="'.$title.'" class="lockedResource">'.$_style['icons_secured'].'</span>'; |
|
126 | 126 | } |
127 | 127 | } |
128 | 128 | } |
@@ -131,22 +131,22 @@ discard block |
||
131 | 131 | |
132 | 132 | $title = ''; |
133 | 133 | if (isDateNode($nodeNameSource)) { |
134 | - $title = $_lang['pagetitle'] . ': ' . $row['pagetitle'] . '[+lf+]'; |
|
134 | + $title = $_lang['pagetitle'].': '.$row['pagetitle'].'[+lf+]'; |
|
135 | 135 | } |
136 | - $title .= $_lang['id'] . ': ' . $row['id']; |
|
137 | - $title .= '[+lf+]' . $_lang['resource_opt_menu_title'] . ': ' . $row['menutitle']; |
|
138 | - $title .= '[+lf+]' . $_lang['resource_opt_menu_index'] . ': ' . $row['menuindex']; |
|
139 | - $title .= '[+lf+]' . $_lang['alias'] . ': ' . (!empty($row['alias']) ? $row['alias'] : '-'); |
|
140 | - $title .= '[+lf+]' . $_lang['template'] . ': ' . $row['templatename']; |
|
141 | - $title .= '[+lf+]' . $_lang['publish_date'] . ': ' . $modx->toDateFormat($row['pub_date']); |
|
142 | - $title .= '[+lf+]' . $_lang['unpublish_date'] . ': ' . $modx->toDateFormat($row['unpub_date']); |
|
143 | - $title .= '[+lf+]' . $_lang['page_data_web_access'] . ': ' . ($row['privateweb'] ? $_lang['private'] : $_lang['public']); |
|
144 | - $title .= '[+lf+]' . $_lang['page_data_mgr_access'] . ': ' . ($row['privatemgr'] ? $_lang['private'] : $_lang['public']); |
|
145 | - $title .= '[+lf+]' . $_lang['resource_opt_richtext'] . ': ' . ($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
146 | - $title .= '[+lf+]' . $_lang['page_data_searchable'] . ': ' . ($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
147 | - $title .= '[+lf+]' . $_lang['page_data_cacheable'] . ': ' . ($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
136 | + $title .= $_lang['id'].': '.$row['id']; |
|
137 | + $title .= '[+lf+]'.$_lang['resource_opt_menu_title'].': '.$row['menutitle']; |
|
138 | + $title .= '[+lf+]'.$_lang['resource_opt_menu_index'].': '.$row['menuindex']; |
|
139 | + $title .= '[+lf+]'.$_lang['alias'].': '.(!empty($row['alias']) ? $row['alias'] : '-'); |
|
140 | + $title .= '[+lf+]'.$_lang['template'].': '.$row['templatename']; |
|
141 | + $title .= '[+lf+]'.$_lang['publish_date'].': '.$modx->toDateFormat($row['pub_date']); |
|
142 | + $title .= '[+lf+]'.$_lang['unpublish_date'].': '.$modx->toDateFormat($row['unpub_date']); |
|
143 | + $title .= '[+lf+]'.$_lang['page_data_web_access'].': '.($row['privateweb'] ? $_lang['private'] : $_lang['public']); |
|
144 | + $title .= '[+lf+]'.$_lang['page_data_mgr_access'].': '.($row['privatemgr'] ? $_lang['private'] : $_lang['public']); |
|
145 | + $title .= '[+lf+]'.$_lang['resource_opt_richtext'].': '.($row['richtext'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
146 | + $title .= '[+lf+]'.$_lang['page_data_searchable'].': '.($row['searchable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
147 | + $title .= '[+lf+]'.$_lang['page_data_cacheable'].': '.($row['cacheable'] == 0 ? $_lang['no'] : $_lang['yes']); |
|
148 | 148 | $title = $modx->htmlspecialchars($title); |
149 | - $title = str_replace('[+lf+]', ' ', $title); // replace line-breaks with empty space as fall-back |
|
149 | + $title = str_replace('[+lf+]', ' ', $title); // replace line-breaks with empty space as fall-back |
|
150 | 150 | |
151 | 151 | $data = array( |
152 | 152 | 'id' => $row['id'], |
@@ -230,7 +230,7 @@ discard block |
||
230 | 230 | } |
231 | 231 | |
232 | 232 | if ($ph['contextmenu']) { |
233 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
233 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
234 | 234 | } |
235 | 235 | |
236 | 236 | if ($_SESSION['tree_show_only_folders']) { |
@@ -288,7 +288,7 @@ discard block |
||
288 | 288 | } |
289 | 289 | |
290 | 290 | if ($ph['contextmenu']) { |
291 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
291 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
292 | 292 | } |
293 | 293 | |
294 | 294 | $node .= $modx->parseText($tpl, $ph); |
@@ -326,7 +326,7 @@ discard block |
||
326 | 326 | } |
327 | 327 | |
328 | 328 | if ($ph['contextmenu']) { |
329 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
329 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
330 | 330 | } |
331 | 331 | |
332 | 332 | $node .= $modx->parseText($tpl, $ph); |
@@ -377,7 +377,7 @@ discard block |
||
377 | 377 | } |
378 | 378 | |
379 | 379 | if ($ph['contextmenu']) { |
380 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
380 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
381 | 381 | } |
382 | 382 | |
383 | 383 | $node .= $modx->parseText($tpl, $ph); |
@@ -420,7 +420,7 @@ discard block |
||
420 | 420 | } |
421 | 421 | |
422 | 422 | if ($ph['contextmenu']) { |
423 | - $ph['contextmenu'] = ' data-contextmenu="' . _htmlentities($ph['contextmenu']) . '"'; |
|
423 | + $ph['contextmenu'] = ' data-contextmenu="'._htmlentities($ph['contextmenu']).'"'; |
|
424 | 424 | } |
425 | 425 | |
426 | 426 | $node .= $modx->parseText($tpl, $ph); |
@@ -488,7 +488,7 @@ discard block |
||
488 | 488 | $nodetitle .= $modx->config['friendly_url_suffix']; |
489 | 489 | } |
490 | 490 | } |
491 | - $nodetitle = $modx->config['friendly_url_prefix'] . $nodetitle; |
|
491 | + $nodetitle = $modx->config['friendly_url_prefix'].$nodetitle; |
|
492 | 492 | break; |
493 | 493 | case 'pagetitle': |
494 | 494 | $nodetitle = $row['pagetitle']; |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | { |
539 | 539 | global $modx; |
540 | 540 | |
541 | - return (int)$modx->db->getValue($modx->db->query('SELECT count(*) FROM ' . $modx->getFullTableName('site_content') . ' WHERE parent=' . $parent . ' AND isfolder=' . $isfolder . ' ')); |
|
541 | + return (int) $modx->db->getValue($modx->db->query('SELECT count(*) FROM '.$modx->getFullTableName('site_content').' WHERE parent='.$parent.' AND isfolder='.$isfolder.' ')); |
|
542 | 542 | } |
543 | 543 | |
544 | 544 | function _htmlentities($array) |
@@ -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 |