Documentation TYPO3 par Ameos

class.t3lib_browsetree.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2006 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 ***************************************************************/
00052 require_once (PATH_t3lib.'class.t3lib_treeview.php');
00053 
00054 
00055 
00056 
00057 
00058 
00059 
00060 
00061 
00062 
00063 
00064 
00074 class t3lib_browseTree extends t3lib_treeView {
00075 
00083         function init($clause='')       {
00084 
00085                         // this will hide records from display - it has nothing todo with user rights!!
00086                 $clauseExludePidList = '';
00087                 if ($pidList = $GLOBALS['BE_USER']->getTSConfigVal('options.hideRecords.pages')) {
00088                         if ($pidList = $GLOBALS['TYPO3_DB']->cleanIntList($pidList)) {
00089                                 $clauseExludePidList = ' AND pages.uid NOT IN ('.$pidList.')';
00090                         }
00091                 }
00092 
00093                         // This is very important for making trees of pages: Filtering out deleted pages, pages with no access to and sorting them correctly:
00094                 parent::init(' AND '.$GLOBALS['BE_USER']->getPagePermsClause(1).' '.$clause.$clauseExludePidList, 'sorting');
00095 
00096                 $this->table = 'pages';
00097                 $this->setTreeName('browsePages');
00098                 $this->domIdPrefix = 'pages';
00099                 $this->iconName = '';
00100                 $this->title = $GLOBALS['TYPO3_CONF_VARS']['SYS']['sitename'];
00101                 $this->MOUNTS = $GLOBALS['WEBMOUNTS'];
00102 
00103                 if ($pidList)   {
00104                                 // Remove mountpoint if explicitely set in options.hideRecords.pages (see above)
00105                         $hideList = explode(',',$pidList);
00106                         $this->MOUNTS = array_diff($this->MOUNTS,$hideList);
00107                 }
00108 
00109                 $this->fieldArray = array_merge($this->fieldArray,array('doktype','php_tree_stop','t3ver_id','t3ver_state','t3ver_wsid','t3ver_swapmode'));
00110                 if (t3lib_extMgm::isLoaded('cms'))      {
00111                         $this->fieldArray = array_merge($this->fieldArray,array('hidden','starttime','endtime','fe_group','module','extendToSubpages', 'is_siteroot'));
00112                 }
00113         }
00114 
00122         function getTitleAttrib($row) {
00123                 return t3lib_BEfunc::titleAttribForPages($row,'1=1 '.$this->clause,0);
00124         }
00125 
00134         function wrapIcon($icon,$row)   {
00135                         // Add title attribute to input icon tag
00136                 $theIcon = $this->addTagAttributes($icon,($this->titleAttrib ? $this->titleAttrib.'="'.$this->getTitleAttrib($row).'"' : ''));
00137 
00138                         // Wrap icon in click-menu link.
00139                 if (!$this->ext_IconMode)       {
00140                         $theIcon = $GLOBALS['TBE_TEMPLATE']->wrapClickMenuOnIcon($theIcon,$this->treeName,$this->getId($row),0);
00141                 } elseif (!strcmp($this->ext_IconMode,'titlelink'))     {
00142                         $aOnClick = 'return jumpTo(\''.$this->getJumpToParam($row).'\',this,\''.$this->domIdPrefix.$this->getId($row).'\','.$this->bank.');';
00143                         $theIcon='<a href="#" onclick="'.htmlspecialchars($aOnClick).'">'.$theIcon.'</a>';
00144                 }
00145                 return $theIcon;
00146         }
00147 
00156         function getTitleStr($row,$titleLen=30) {
00157                 $title = (!strcmp(trim($row['title']),'')) ? '<em>['.$GLOBALS['LANG']->sL('LLL:EXT:lang/locallang_core.php:labels.no_title',1).']</em>' : htmlspecialchars(t3lib_div::fixed_lgd_cs($row['title'],$titleLen));
00158                 if (isset($row['is_siteroot']) && $row['is_siteroot'] != 0 && $GLOBALS['BE_USER']->getTSConfigVal('options.pageTree.showDomainNameWithTitle')) {
00159                         $rows = $GLOBALS['TYPO3_DB']->exec_SELECTgetRows('domainName,sorting', 'sys_domain',
00160                                                 'pid=' . $GLOBALS['TYPO3_DB']->quoteStr($row['uid'], 'sys_domain'), '', 'sorting', 1);
00161                         if (is_array($rows) && count($rows) > 0) {
00162                                 $title = sprintf('%s [%s]', $title, $rows[0]['domainName']);
00163                         }
00164                 }
00165                 return $title;
00166         }
00167 }
00168 
00169 if (defined('TYPO3_MODE') && $TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_browsetree.php'])        {
00170         include_once($TYPO3_CONF_VARS[TYPO3_MODE]['XCLASS']['t3lib/class.t3lib_browsetree.php']);
00171 }
00172 ?>


Généré par Le spécialiste TYPO3 avec  doxygen 1.4.6