[TASK] Move XLIFF handling to t3lib
[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 Part of where query which will filter out non-readable pages.
64 * @return void
65 */
66 function init($clause = '') {
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 (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 record for the entry
101 * @param integer The current entry number
102 * @param integer The total number of entries. If equal to $a, a 'bottom' element is returned.
103 * @param integer The number of sub-elements to the current element.
104 * @param boolean 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 /**
119 * Get stored tree structure AND updating it if needed according to incoming PM GET var.
120 * - Here we just set it to nothing since we want to just render the tree, nothing more.
121 *
122 * @return void
123 * @access private
124 */
125 function initializePositionSaving() {
126 $this->stored = array();
127 }
128 }
129
130
131 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagetree.php'])) {
132 include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagetree.php']);
133 }
134 ?>