2 /***************************************************************
5 * (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
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.
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.
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.
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
28 * Generate a page-tree, non-browsable.
30 * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
32 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
33 * @coauthor René Fritz <r.fritz@colorcube.de>
36 * [CLASS/FUNCTION INDEX of SCRIPT]
40 * 78: class t3lib_pageTree extends t3lib_treeView
41 * 90: function init($clause='')
42 * 106: function expandNext($id)
43 * 123: function PMicon($row,$a,$c,$nextCount,$exp)
44 * 138: function initializePositionSaving()
47 * (This index is automatically created/updated by the extension "extdeveval")
53 * Class for generating a page tree.
55 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
56 * @coauthor René Fritz <r.fritz@colorcube.de>
57 * @see t3lib_treeView, t3lib_browseTree
61 class t3lib_pageTree
extends t3lib_treeView
{
62 var $fieldArray = array(
71 var $defaultList = 'uid,pid,tstamp,sorting,deleted,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,crdate,cruser_id';
76 * REMEMBER to feed a $clause which will filter out non-readable pages!
78 * @param string Part of where query which will filter out non-readable pages.
81 function init($clause = '') {
82 parent
::init(' AND deleted=0 ' . $clause, 'sorting');
84 if (t3lib_extMgm
::isLoaded('cms')) {
85 $this->fieldArray
= array_merge(
97 $this->table
= 'pages';
98 $this->treeName
= 'pages';
102 * Returns true/false if the next level for $id should be expanded - and all levels should, so we always return 1.
104 * @param integer ID (uid) to test for (see extending classes where this is checked againts session data)
107 function expandNext($id) {
112 * Generate the plus/minus icon for the browsable tree.
113 * In this case, there is no plus-minus icon displayed.
115 * @param array record for the entry
116 * @param integer The current entry number
117 * @param integer The total number of entries. If equal to $a, a 'bottom' element is returned.
118 * @param integer The number of sub-elements to the current element.
119 * @param boolean The element was expanded to render subelements if this flag is set.
120 * @return string Image tag with the plus/minus icon.
122 * @see t3lib_treeView::PMicon()
124 function PMicon($row, $a, $c, $nextCount, $exp) {
126 $BTM = ($a == $c) ?
'bottom' : '';
127 $icon = '<img' . t3lib_iconWorks
::skinImg($this->backPath
, 'gfx/ol/' . $PM . $BTM . '.gif', 'width="18" height="16"') . ' alt="" />';
134 * Get stored tree structure AND updating it if needed according to incoming PM GET var.
135 * - Here we just set it to nothing since we want to just render the tree, nothing more.
140 function initializePositionSaving() {
141 $this->stored
= array();
146 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['XCLASS']['t3lib/class.t3lib_pagetree.php'])) {
147 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE
]['XCLASS']['t3lib/class.t3lib_pagetree.php']);