2 /***************************************************************
5 * (c) 1999-2004 Kasper Skaarhoj (kasper@typo3.com)
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.
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.
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.
25 * This copyright notice MUST APPEAR in all copies of the script!
26 ***************************************************************/
28 * Generate a page-tree, browsable.
31 * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
33 * @author Kasper Skaarhoj <kasper@typo3.com>
34 * @coauthor René Fritz <r.fritz@colorcube.de>
37 * [CLASS/FUNCTION INDEX of SCRIPT]
41 * 73: class t3lib_browseTree extends t3lib_treeView
42 * 82: function init($clause='')
43 * 105: function getTitleAttrib($row)
46 * (This index is automatically created/updated by the extension "extdeveval")
50 require_once (PATH_t3lib
.'class.t3lib_treeview.php');
65 * Extension class for the t3lib_treeView class, specially made for browsing pages
67 * @author Kasper Skaarhoj <kasper@typo3.com>
68 * @coauthor René Fritz <r.fritz@colorcube.de>
69 * @see t3lib_treeView, t3lib_pageTree
73 class t3lib_browseTree
extends t3lib_treeView
{
76 * Initialize, setting what is necessary for browsing pages.
77 * Using the current user.
79 * @param string Additional clause for selecting pages.
82 function init($clause='') {
83 // This is very important for making trees of pages: Filtering out deleted pages, pages with no access to and sorting them correctly:
84 parent
::init(' AND NOT deleted AND '.$GLOBALS['BE_USER']->getPagePermsClause(1).' '.$clause.' ORDER BY sorting');
87 $this->treeName
='browsePages';
88 $this->domIdPrefix
= 'pages';
90 $this->title
= $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
91 $this->MOUNTS
= $GLOBALS['WEBMOUNTS'];
93 if (t3lib_extMgm
::isLoaded('cms')) {
94 $this->fieldArray
=array_merge($this->fieldArray
,array('doktype','php_tree_stop','hidden','starttime','endtime','fe_group','module','extendToSubpages'));
99 * Creates title attribute content for pages.
100 * Uses API function in t3lib_BEfunc which will retrieve lots of useful information for pages.
102 * @param array The table row.
105 function getTitleAttrib($row) {
106 return t3lib_BEfunc
::titleAttribForPages($row,'1=1 '.$this->clause
,0);
110 * Wrapping the image tag, $icon, for the row, $row (except for mount points)
112 * @param string The image tag for the icon
113 * @param array The row for the current element
114 * @return string The processed icon input value.
117 function wrapIcon($icon,$row) {
118 // Add title attribute to input icon tag
119 $theIcon = $this->addTagAttributes($icon,($this->titleAttrib ?
$this->titleAttrib
.'="'.$this->getTitleAttrib($row).'"' : ''));
121 // Wrap icon in click-menu link.
122 if (!$this->ext_IconMode
) {
123 $theIcon = $GLOBALS['TBE_TEMPLATE']->wrapClickMenuOnIcon($theIcon,$this->treeName
,$this->getId($row),0);
124 } elseif (!strcmp($this->ext_IconMode
,'titlelink')) {
125 $aOnClick = 'return jumpTo('.$this->getJumpToParm($row).',this,\''.$this->domIdPrefix
.$this->getId($row).'_'.$this->bank
.'\');';
126 $theIcon='<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$theIcon.'</a>';
132 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['t3lib/class.t3lib_browsetree.php']) {
133 include_once($TYPO3_CONF_VARS[TYPO3_MODE
]['XCLASS']['t3lib/class.t3lib_browsetree.php']);