[BUGFIX] Remove early return in PageTreeDataProvider
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_pagetree.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
6 * All rights reserved
7 *
8 * This script is part of the TYPO3 project. The TYPO3 project is
9 * free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * The GNU General Public License can be found at
15 * http://www.gnu.org/copyleft/gpl.html.
16 * A copy is found in the textfile GPL.txt and important notices to the license
17 * from the author is found in LICENSE.txt distributed with these scripts.
18 *
19 *
20 * This script is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
27 /**
28 * Generate a page-tree, non-browsable.
29 *
30 * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
31 *
32 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
33 * @coauthor René Fritz <r.fritz@colorcube.de>
34 */
35
36
37 /**
38 * Class for generating a page tree.
39 *
40 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
41 * @coauthor René Fritz <r.fritz@colorcube.de>
42 * @see t3lib_treeView, t3lib_browseTree
43 * @package TYPO3
44 * @subpackage t3lib
45 */
46 class t3lib_pageTree extends t3lib_treeView {
47 var $fieldArray = array(
48 'uid',
49 'title',
50 'doktype',
51 'php_tree_stop',
52 't3ver_id',
53 't3ver_state',
54 't3ver_swapmode'
55 );
56 var $defaultList = 'uid,pid,tstamp,sorting,deleted,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,crdate,cruser_id';
57 var $setRecs = 0;
58
59 /**
60 * Init function
61 * REMEMBER to feed a $clause which will filter out non-readable pages!
62 *
63 * @param string $clause Part of where query which will filter out non-readable pages.
64 * @param string $orderByFields record ORDER BY field
65 * @return void
66 */
67 function init($clause = '', $orderByFields = '') {
68 parent::init(' AND deleted=0 ' . $clause, 'sorting');
69
70 if (t3lib_extMgm::isLoaded('cms')) {
71 $this->fieldArray = array_merge(
72 $this->fieldArray,
73 array(
74 'hidden',
75 'starttime',
76 'endtime',
77 'fe_group',
78 'module',
79 'extendToSubpages',
80 'nav_hide')
81 );
82 }
83 $this->table = 'pages';
84 $this->treeName = 'pages';
85 }
86
87 /**
88 * Returns TRUE/FALSE if the next level for $id should be expanded - and all levels should, so we always return 1.
89 *
90 * @param integer ID (uid) to test for (see extending classes where this is checked againts session data)
91 * @return boolean
92 */
93 function expandNext($id) {
94 return 1;
95 }
96
97 /**
98 * Generate the plus/minus icon for the browsable tree.
99 * In this case, there is no plus-minus icon displayed.
100 *
101 * @param array record for the entry
102 * @param integer The current entry number
103 * @param integer The total number of entries. If equal to $a, a 'bottom' element is returned.
104 * @param integer The number of sub-elements to the current element.
105 * @param boolean The element was expanded to render subelements if this flag is set.
106 * @return string Image tag with the plus/minus icon.
107 * @access private
108 * @see t3lib_treeView::PMicon()
109 */
110 function PMicon($row, $a, $c, $nextCount, $exp) {
111 $PM = 'join';
112 $BTM = ($a == $c) ? 'bottom' : '';
113 $icon = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/ol/' . $PM . $BTM . '.gif', 'width="18" height="16"') . ' alt="" />';
114
115 return $icon;
116 }
117
118
119 /**
120 * Get stored tree structure AND updating it if needed according to incoming PM GET var.
121 * - Here we just set it to nothing since we want to just render the tree, nothing more.
122 *
123 * @return void
124 * @access private
125 */
126 function initializePositionSaving() {
127 $this->stored = array();
128 }
129 }
130
131
132 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagetree.php'])) {
133 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagetree.php']);
134 }
135 ?>