[FEATURE] Add support for native date/time fields
[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 * Class for generating a page tree.
38 *
39 * @author Kasper Skårhøj <kasperYYYY@typo3.com>
40 * @coauthor René Fritz <r.fritz@colorcube.de>
41 * @see t3lib_treeView, t3lib_browseTree
42 * @package TYPO3
43 * @subpackage t3lib
44 */
45 class t3lib_pageTree extends t3lib_treeView {
46 var $fieldArray = array(
47 'uid',
48 'title',
49 'doktype',
50 'php_tree_stop',
51 't3ver_id',
52 't3ver_state',
53 );
54 var $defaultList = 'uid,pid,tstamp,sorting,deleted,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,crdate,cruser_id';
55 var $setRecs = 0;
56
57 /**
58 * Init function
59 * REMEMBER to feed a $clause which will filter out non-readable pages!
60 *
61 * @param string $clause Part of where query which will filter out non-readable pages.
62 * @param string $orderByFields Record ORDER BY field
63 * @return void
64 */
65 function init($clause = '', $orderByFields = '') {
66 parent::init(' AND deleted=0 ' . $clause, 'sorting');
67
68 if (t3lib_extMgm::isLoaded('cms')) {
69 $this->fieldArray = array_merge(
70 $this->fieldArray,
71 array(
72 'hidden',
73 'starttime',
74 'endtime',
75 'fe_group',
76 'module',
77 'extendToSubpages',
78 'nav_hide')
79 );
80 }
81 $this->table = 'pages';
82 $this->treeName = 'pages';
83 }
84
85 /**
86 * Returns TRUE/FALSE if the next level for $id should be expanded - and all levels should, so we always return 1.
87 *
88 * @param integer $id ID (uid) to test for (see extending classes where this is checked againts session data)
89 * @return boolean
90 */
91 function expandNext($id) {
92 return 1;
93 }
94
95 /**
96 * Generate the plus/minus icon for the browsable tree.
97 * In this case, there is no plus-minus icon displayed.
98 *
99 * @param array $row Record for the entry
100 * @param integer $a The current entry number
101 * @param integer $c The total number of entries. If equal to $a, a 'bottom' element is returned.
102 * @param integer $nextCount The number of sub-elements to the current element.
103 * @param boolean $exp The element was expanded to render subelements if this flag is set.
104 * @return string Image tag with the plus/minus icon.
105 * @access private
106 * @see t3lib_treeView::PMicon()
107 */
108 function PMicon($row, $a, $c, $nextCount, $exp) {
109 $PM = 'join';
110 $BTM = ($a == $c) ? 'bottom' : '';
111 $icon = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/ol/' . $PM . $BTM . '.gif', 'width="18" height="16"') . ' alt="" />';
112
113 return $icon;
114 }
115
116 /**
117 * Get stored tree structure AND updating it if needed according to incoming PM GET var.
118 * - Here we just set it to nothing since we want to just render the tree, nothing more.
119 *
120 * @return void
121 * @access private
122 */
123 function initializePositionSaving() {
124 $this->stored = array();
125 }
126 }
127
128 ?>