Documentation TYPO3 par Ameos |
00001 <?php 00002 /*************************************************************** 00003 * Copyright notice 00004 * 00005 * (c) 1999-2004 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 ***************************************************************/ 00133 class t3lib_SCbase { 00134 00139 var $MCONF = array(); 00140 00145 var $id; 00146 00151 var $CMD; 00152 00157 var $perms_clause; 00158 00159 00160 00165 var $MOD_MENU = Array ( 00166 'function' => array() 00167 ); 00168 00173 var $MOD_SETTINGS = array(); 00174 00179 var $modTSconfig; 00180 00187 var $modMenu_type = ''; 00188 00195 var $modMenu_dontValidateList = ''; 00196 00203 var $modMenu_setDefaultList = ''; 00204 00210 var $extClassConf; 00211 00217 var $include_once = array(); 00218 00222 var $content = ''; 00223 00227 var $doc; 00228 00234 var $extObj; 00235 00236 00237 00238 00239 00240 00241 00242 00249 function init() { 00250 // name might be set from outside 00251 if (!$this->MCONF['name']) { 00252 $this->MCONF = $GLOBALS['MCONF']; 00253 } 00254 $this->id = intval(t3lib_div::_GP('id')); 00255 $this->CMD = t3lib_div::_GP('CMD'); 00256 $this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1); 00257 $this->menuConfig(); 00258 $this->handleExternalFunctionValue(); 00259 } 00260 00269 function menuConfig() { 00270 // page/be_user TSconfig settings and blinding of menu-items 00271 $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,'mod.'.$this->MCONF['name']); 00272 $this->MOD_MENU['function'] = $this->mergeExternalItems($this->MCONF['name'],'function',$this->MOD_MENU['function']); 00273 $this->MOD_MENU['function'] = t3lib_BEfunc::unsetMenuItems($this->modTSconfig['properties'],$this->MOD_MENU['function'],'menu.function'); 00274 00275 #debug($this->MOD_MENU['function'],$this->MCONF['name']); 00276 #debug($this->modTSconfig['properties']); 00277 00278 // CLEANSE 'function' SETTINGS 00279 $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name'], $this->modMenu_type, $this->modMenu_dontValidateList, $this->modMenu_setDefaultList); 00280 } 00281 00292 function mergeExternalItems($modName,$menuKey,$menuArr) { 00293 $mergeArray = $GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey]; 00294 if (is_array($mergeArray)) { 00295 reset($mergeArray); 00296 while(list($k,$v)=each($mergeArray)) { 00297 $menuArr[$k]=$GLOBALS['LANG']->sL($v['title']); 00298 } 00299 } 00300 return $menuArr; 00301 } 00302 00312 function handleExternalFunctionValue($MM_key='function', $MS_value=NULL) { 00313 $MS_value = is_null($MS_value) ? $this->MOD_SETTINGS[$MM_key] : $MS_value; 00314 $this->extClassConf = $this->getExternalItemConfig($this->MCONF['name'],$MM_key,$MS_value); 00315 if (is_array($this->extClassConf) && $this->extClassConf['path']) { 00316 $this->include_once[]=$this->extClassConf['path']; 00317 } 00318 } 00319 00330 function getExternalItemConfig($modName,$menuKey,$value='') { 00331 return strcmp($value,'')?$GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey][$value]:$GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey]; 00332 } 00333 00344 function checkExtObj() { 00345 if (is_array($this->extClassConf) && $this->extClassConf['name']) { 00346 $this->extObj = t3lib_div::makeInstance($this->extClassConf['name']); 00347 $this->extObj->init($this,$this->extClassConf); 00348 // Re-write: 00349 $this->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->MOD_MENU, t3lib_div::_GP('SET'), $this->MCONF['name']); 00350 } 00351 } 00352 00358 function checkSubExtObj() { 00359 if (is_object($this->extObj)) $this->extObj->checkExtObj(); 00360 } 00361 00370 function extObjHeader() { 00371 if (is_callable(array($this->extObj,'head'))) $this->extObj->head(); 00372 } 00373 00379 function extObjContent() { 00380 $this->extObj->pObj = &$this; 00381 if (is_callable(array($this->extObj, 'main'))) $this->content.=$this->extObj->main(); 00382 } 00383 } 00384 ?>