Disabling some or all controls in group field - controllable via pageTS
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_pagetree.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2008 Kasper Skaarhoj (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 * $Id$
31 * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
32 *
33 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
34 * @coauthor René Fritz <r.fritz@colorcube.de>
35 */
36 /**
37 * [CLASS/FUNCTION INDEX of SCRIPT]
38 *
39 *
40 *
41 * 78: class t3lib_pageTree extends t3lib_treeView
42 * 90: function init($clause='')
43 * 106: function expandNext($id)
44 * 123: function PMicon($row,$a,$c,$nextCount,$exp)
45 * 138: function initializePositionSaving()
46 *
47 * TOTAL FUNCTIONS: 4
48 * (This index is automatically created/updated by the extension "extdeveval")
49 *
50 */
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67 require_once (PATH_t3lib.'class.t3lib_treeview.php');
68
69 /**
70 * Class for generating a page tree.
71 *
72 * @author Kasper Skaarhoj <kasperYYYY@typo3.com>
73 * @coauthor René Fritz <r.fritz@colorcube.de>
74 * @see t3lib_treeView, t3lib_browseTree
75 * @package TYPO3
76 * @subpackage t3lib
77 */
78 class t3lib_pageTree extends t3lib_treeView {
79 var $fieldArray = array('uid', 'title', 'doktype', 'php_tree_stop', 't3ver_id', 't3ver_state', 't3ver_swapmode');
80 var $defaultList = 'uid,pid,tstamp,sorting,deleted,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,crdate,cruser_id';
81 var $setRecs = 0;
82
83 /**
84 * Init function
85 * REMEMBER to feed a $clause which will filter out non-readable pages!
86 *
87 * @param string Part of where query which will filter out non-readable pages.
88 * @return void
89 */
90 function init($clause='') {
91 parent::init(' AND deleted=0 '.$clause, 'sorting');
92
93 if (t3lib_extMgm::isLoaded('cms')) {
94 $this->fieldArray = array_merge(
95 $this->fieldArray,
96 array('hidden', 'starttime', 'endtime', 'fe_group', 'module', 'extendToSubpages', 'nav_hide')
97 );
98 }
99 $this->table='pages';
100 $this->treeName='pages';
101 }
102
103 /**
104 * Returns true/false if the next level for $id should be expanded - and all levels should, so we always return 1.
105 *
106 * @param integer ID (uid) to test for (see extending classes where this is checked againts session data)
107 * @return boolean
108 */
109 function expandNext($id) {
110 return 1;
111 }
112
113 /**
114 * Generate the plus/minus icon for the browsable tree.
115 * In this case, there is no plus-minus icon displayed.
116 *
117 * @param array record for the entry
118 * @param integer The current entry number
119 * @param integer The total number of entries. If equal to $a, a 'bottom' element is returned.
120 * @param integer The number of sub-elements to the current element.
121 * @param boolean The element was expanded to render subelements if this flag is set.
122 * @return string Image tag with the plus/minus icon.
123 * @access private
124 * @see t3lib_treeView::PMicon()
125 */
126 function PMicon($row,$a,$c,$nextCount,$exp) {
127 $PM = 'join';
128 $BTM = ($a==$c)?'bottom':'';
129 $icon = '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.$PM.$BTM.'.gif','width="18" height="16"').' alt="" />';
130 return $icon;
131 }
132
133
134 /**
135 * Get stored tree structure AND updating it if needed according to incoming PM GET var.
136 * - Here we just set it to nothing since we want to just render the tree, nothing more.
137 *
138 * @return void
139 * @access private
140 */
141 function initializePositionSaving() {
142 $this->stored=array();
143 }
144 }
145
146
147 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagetree.php']) {
148 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagetree.php']);
149 }
150 ?>