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