TYPO3 API  SVNRelease
class.t3lib_pagetree.php
Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003  *  Copyright notice
00004  *
00005  *  (c) 1999-2011 Kasper Skårhøj (kasperYYYY@typo3.com)
00006  *  All rights reserved
00007  *
00008  *  This script is part of the TYPO3 project. The TYPO3 project is
00009  *  free software; you can redistribute it and/or modify
00010  *  it under the terms of the GNU General Public License as published by
00011  *  the Free Software Foundation; either version 2 of the License, or
00012  *  (at your option) any later version.
00013  *
00014  *  The GNU General Public License can be found at
00015  *  http://www.gnu.org/copyleft/gpl.html.
00016  *  A copy is found in the textfile GPL.txt and important notices to the license
00017  *  from the author is found in LICENSE.txt distributed with these scripts.
00018  *
00019  *
00020  *  This script is distributed in the hope that it will be useful,
00021  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00022  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00023  *  GNU General Public License for more details.
00024  *
00025  *  This copyright notice MUST APPEAR in all copies of the script!
00026  ***************************************************************/
00027 /**
00028  * Generate a page-tree, non-browsable.
00029  *
00030  * $Id: class.t3lib_pagetree.php 10121 2011-01-18 20:15:30Z ohader $
00031  * Revised for TYPO3 3.6 November/2003 by Kasper Skårhøj
00032  *
00033  * @author  Kasper Skårhøj <kasperYYYY@typo3.com>
00034  * @coauthor    René Fritz <r.fritz@colorcube.de>
00035  */
00036 /**
00037  * [CLASS/FUNCTION INDEX of SCRIPT]
00038  *
00039  *
00040  *
00041  *   78: class t3lib_pageTree extends t3lib_treeView
00042  *   90:     function init($clause='')
00043  *  106:     function expandNext($id)
00044  *  123:     function PMicon($row,$a,$c,$nextCount,$exp)
00045  *  138:     function initializePositionSaving()
00046  *
00047  * TOTAL FUNCTIONS: 4
00048  * (This index is automatically created/updated by the extension "extdeveval")
00049  *
00050  */
00051 
00052 
00053 /**
00054  * Class for generating a page tree.
00055  *
00056  * @author  Kasper Skårhøj <kasperYYYY@typo3.com>
00057  * @coauthor    René Fritz <r.fritz@colorcube.de>
00058  * @see t3lib_treeView, t3lib_browseTree
00059  * @package TYPO3
00060  * @subpackage t3lib
00061  */
00062 class t3lib_pageTree extends t3lib_treeView {
00063     var $fieldArray = array(
00064         'uid',
00065         'title',
00066         'doktype',
00067         'php_tree_stop',
00068         't3ver_id',
00069         't3ver_state',
00070         't3ver_swapmode'
00071     );
00072     var $defaultList = 'uid,pid,tstamp,sorting,deleted,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,crdate,cruser_id';
00073     var $setRecs = 0;
00074 
00075     /**
00076      * Init function
00077      * REMEMBER to feed a $clause which will filter out non-readable pages!
00078      *
00079      * @param   string      Part of where query which will filter out non-readable pages.
00080      * @return  void
00081      */
00082     function init($clause = '') {
00083         parent::init(' AND deleted=0 ' . $clause, 'sorting');
00084 
00085         if (t3lib_extMgm::isLoaded('cms')) {
00086             $this->fieldArray = array_merge(
00087                 $this->fieldArray,
00088                 array(
00089                      'hidden',
00090                      'starttime',
00091                      'endtime',
00092                      'fe_group',
00093                      'module',
00094                      'extendToSubpages',
00095                      'nav_hide')
00096             );
00097         }
00098         $this->table = 'pages';
00099         $this->treeName = 'pages';
00100     }
00101 
00102     /**
00103      * Returns true/false if the next level for $id should be expanded - and all levels should, so we always return 1.
00104      *
00105      * @param   integer     ID (uid) to test for (see extending classes where this is checked againts session data)
00106      * @return  boolean
00107      */
00108     function expandNext($id) {
00109         return 1;
00110     }
00111 
00112     /**
00113      * Generate the plus/minus icon for the browsable tree.
00114      * In this case, there is no plus-minus icon displayed.
00115      *
00116      * @param   array       record for the entry
00117      * @param   integer     The current entry number
00118      * @param   integer     The total number of entries. If equal to $a, a 'bottom' element is returned.
00119      * @param   integer     The number of sub-elements to the current element.
00120      * @param   boolean     The element was expanded to render subelements if this flag is set.
00121      * @return  string      Image tag with the plus/minus icon.
00122      * @access private
00123      * @see t3lib_treeView::PMicon()
00124      */
00125     function PMicon($row, $a, $c, $nextCount, $exp) {
00126         $PM = 'join';
00127         $BTM = ($a == $c) ? 'bottom' : '';
00128         $icon = '<img' . t3lib_iconWorks::skinImg($this->backPath, 'gfx/ol/' . $PM . $BTM . '.gif', 'width="18" height="16"') . ' alt="" />';
00129 
00130         return $icon;
00131     }
00132 
00133 
00134     /**
00135      * Get stored tree structure AND updating it if needed according to incoming PM GET var.
00136      * - Here we just set it to nothing since we want to just render the tree, nothing more.
00137      *
00138      * @return  void
00139      * @access private
00140      */
00141     function initializePositionSaving() {
00142         $this->stored = array();
00143     }
00144 }
00145 
00146 
00147 if (defined('TYPO3_MODE') && isset($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagetree.php'])) {
00148     include_once($GLOBALS['TYPO3_CONF_VARS'][TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagetree.php']);
00149 }
00150 ?>