Initial revision
[Packages/TYPO3.CMS.git] / t3lib / class.t3lib_browsetree.php
1 <?php
2 /***************************************************************
3 * Copyright notice
4 *
5 * (c) 1999-2003 Kasper Skårhøj (kasper@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. OBS: remember $clause
29 *
30 * Revised for TYPO3 3.6 August/2003 by Kasper Skårhøj
31 *
32 * @author Kasper Skårhøj <kasper@typo3.com>
33 * @coauthor René Fritz <r.fritz@colorcube.de>
34 * Maintained by René Fritz
35 */
36 /**
37 * [CLASS/FUNCTION INDEX of SCRIPT]
38 *
39 *
40 *
41 * 70: class t3lib_browseTree extends t3lib_treeView
42 * 78: function init($clause='')
43 * 104: function getTitleAttrib(&$row)
44 *
45 * TOTAL FUNCTIONS: 2
46 * (This index is automatically created/updated by the extension "extdeveval")
47 *
48 */
49
50 require_once (PATH_t3lib.'class.t3lib_treeview.php');
51
52
53
54
55
56
57
58
59
60
61
62
63
64 /**
65 * Extension class for the t3lib_treeView class, specially made for browsing pages
66 *
67 * @author Kasper Skårhøj <kasper@typo3.com>
68 * @coauthor René Fritz <r.fritz@colorcube.de>
69 * @see class t3lib_treeView
70 * @package TYPO3
71 * @subpackage t3lib
72 */
73 class t3lib_browseTree extends t3lib_treeView {
74
75 /**
76 * Initialize
77 *
78 * @param string Additional clause for selecting pages.
79 * @return void
80 */
81 function init($clause='') {
82 parent::init(' AND NOT deleted AND '.$GLOBALS['BE_USER']->getPagePermsClause(1).' '.$clause.' ORDER BY sorting');
83
84
85 $this->BE_USER = $GLOBALS['BE_USER'];
86 $this->titleAttrib = t3lib_BEfunc::titleAttrib();
87 $this->backPath = $GLOBALS['BACK_PATH'];
88
89 $this->table='pages';
90 $this->treeName='browsePages';
91 $this->domIdPrefix = 'pages';
92 $this->iconName = '';
93 $this->title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
94 $this->MOUNTS = $GLOBALS['WEBMOUNTS'];
95
96 if (t3lib_extMgm::isLoaded('cms')) {
97 $this->fieldArray=array_merge($this->fieldArray,array('doktype','php_tree_stop','hidden','starttime','endtime','fe_group','module','extendToSubpages'));
98 }
99 }
100
101 /**
102 * Creates title attribute for pages.
103 *
104 * @param array The table row.
105 * @return string
106 */
107 function getTitleAttrib(&$row) {
108 return t3lib_BEfunc::titleAttribForPages($row,'1=1 '.$this->clause,0);
109 }
110 }
111
112
113 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_browsetree.php']) {
114 include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_browsetree.php']);
115 }
116 ?>