class.t3lib_pagetree.php

Go to the documentation of this file.
00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2008 Kasper Skaarhoj (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 3319 2008-02-28 21:28:57Z ohader $
00031  * Revised for TYPO3 3.6 November/2003 by Kasper Skaarhoj
00032  *
00033  * @author  Kasper Skaarhoj <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 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00065 
00066 
00067 require_once (PATH_t3lib.'class.t3lib_treeview.php');
00068 
00069 /**
00070  * Class for generating a page tree.
00071  *
00072  * @author  Kasper Skaarhoj <kasperYYYY@typo3.com>
00073  * @coauthor    René Fritz <r.fritz@colorcube.de>
00074  * @see t3lib_treeView, t3lib_browseTree
00075  * @package TYPO3
00076  * @subpackage t3lib
00077  */
00078 class t3lib_pageTree extends t3lib_treeView {
00079     var $fieldArray = array('uid', 'title', 'doktype', 'php_tree_stop', 't3ver_id', 't3ver_state', 't3ver_swapmode');
00080     var $defaultList = 'uid,pid,tstamp,sorting,deleted,perms_userid,perms_groupid,perms_user,perms_group,perms_everybody,crdate,cruser_id';
00081     var $setRecs = 0;
00082 
00083     /**
00084      * Init function
00085      * REMEMBER to feed a $clause which will filter out non-readable pages!
00086      *
00087      * @param   string      Part of where query which will filter out non-readable pages.
00088      * @return  void
00089      */
00090     function init($clause='')   {
00091         parent::init(' AND deleted=0 '.$clause, 'sorting');
00092 
00093         if (t3lib_extMgm::isLoaded('cms'))  {
00094             $this->fieldArray = array_merge(
00095                 $this->fieldArray,
00096                 array('hidden', 'starttime', 'endtime', 'fe_group', 'module', 'extendToSubpages', 'nav_hide')
00097             );
00098         }
00099         $this->table='pages';
00100         $this->treeName='pages';
00101     }
00102 
00103     /**
00104      * Returns true/false if the next level for $id should be expanded - and all levels should, so we always return 1.
00105      *
00106      * @param   integer     ID (uid) to test for (see extending classes where this is checked againts session data)
00107      * @return  boolean
00108      */
00109     function expandNext($id)    {
00110         return 1;
00111     }
00112 
00113     /**
00114      * Generate the plus/minus icon for the browsable tree.
00115      * In this case, there is no plus-minus icon displayed.
00116      *
00117      * @param   array       record for the entry
00118      * @param   integer     The current entry number
00119      * @param   integer     The total number of entries. If equal to $a, a 'bottom' element is returned.
00120      * @param   integer     The number of sub-elements to the current element.
00121      * @param   boolean     The element was expanded to render subelements if this flag is set.
00122      * @return  string      Image tag with the plus/minus icon.
00123      * @access private
00124      * @see t3lib_treeView::PMicon()
00125      */
00126     function PMicon($row,$a,$c,$nextCount,$exp) {
00127         $PM = 'join';
00128         $BTM = ($a==$c)?'bottom':'';
00129         $icon = '<img'.t3lib_iconWorks::skinImg($this->backPath,'gfx/ol/'.$PM.$BTM.'.gif','width="18" height="16"').' alt="" />';
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') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagetree.php'])  {
00148     include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_pagetree.php']);
00149 }
00150 ?>

Generated on Sat Jan 3 04:23:26 2009 for TYPO3 API by  doxygen 1.4.7