00001 <?php
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
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
00229 var $doc;
00230
00236 var $extObj;
00237
00238
00239
00240
00241
00242
00243
00244
00251 function init() {
00252
00253 if (!$this->MCONF['name']) {
00254 $this->MCONF = $GLOBALS['MCONF'];
00255 }
00256 $this->id = intval(t3lib_div::_GP('id'));
00257 $this->CMD = t3lib_div::_GP('CMD');
00258 $this->perms_clause = $GLOBALS['BE_USER']->getPagePermsClause(1);
00259 $this->menuConfig();
00260 $this->handleExternalFunctionValue();
00261 }
00262
00271 function menuConfig() {
00272
00273 $this->modTSconfig = t3lib_BEfunc::getModTSconfig($this->id,'mod.'.$this->MCONF['name']);
00274 $this->MOD_MENU['function'] = $this->mergeExternalItems($this->MCONF['name'],'function',$this->MOD_MENU['function']);
00275 $this->MOD_MENU['function'] = t3lib_BEfunc::unsetMenuItems($this->modTSconfig['properties'],$this->MOD_MENU['function'],'menu.function');
00276
00277 #debug($this->MOD_MENU['function'],$this->MCONF['name']);
00278 #debug($this->modTSconfig['properties']);
00279
00280 $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);
00281 }
00282
00293 function mergeExternalItems($modName,$menuKey,$menuArr) {
00294 $mergeArray = $GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey];
00295 if (is_array($mergeArray)) {
00296 reset($mergeArray);
00297 while(list($k,$v)=each($mergeArray)) {
00298 if ((string)$v['ws']==='' ||
00299 ($GLOBALS['BE_USER']->workspace===0 && t3lib_div::inList($v['ws'],'online')) ||
00300 ($GLOBALS['BE_USER']->workspace===-1 && t3lib_div::inList($v['ws'],'offline')) ||
00301 ($GLOBALS['BE_USER']->workspace>0 && t3lib_div::inList($v['ws'],'custom'))) {
00302 $menuArr[$k]=$GLOBALS['LANG']->sL($v['title']);
00303 }
00304 }
00305 }
00306 return $menuArr;
00307 }
00308
00318 function handleExternalFunctionValue($MM_key='function', $MS_value=NULL) {
00319 $MS_value = is_null($MS_value) ? $this->MOD_SETTINGS[$MM_key] : $MS_value;
00320 $this->extClassConf = $this->getExternalItemConfig($this->MCONF['name'],$MM_key,$MS_value);
00321 if (is_array($this->extClassConf) && $this->extClassConf['path']) {
00322 $this->include_once[]=$this->extClassConf['path'];
00323 }
00324 }
00325
00336 function getExternalItemConfig($modName,$menuKey,$value='') {
00337 return strcmp($value,'')?$GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey][$value]:$GLOBALS['TBE_MODULES_EXT'][$modName]['MOD_MENU'][$menuKey];
00338 }
00339
00350 function checkExtObj() {
00351 if (is_array($this->extClassConf) && $this->extClassConf['name']) {
00352 $this->extObj = t3lib_div::makeInstance($this->extClassConf['name']);
00353 $this->extObj->init($this,$this->extClassConf);
00354
00355 $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);
00356 }
00357 }
00358
00364 function checkSubExtObj() {
00365 if (is_object($this->extObj)) $this->extObj->checkExtObj();
00366 }
00367
00376 function extObjHeader() {
00377 if (is_callable(array($this->extObj,'head'))) $this->extObj->head();
00378 }
00379
00385 function extObjContent() {
00386 $this->extObj->pObj = &$this;
00387 if (is_callable(array($this->extObj, 'main'))) $this->content.=$this->extObj->main();
00388 }
00389 }
00390 ?>
This documentation has been generated automatically from TYPO3 source code using
Doxygen and is provided as is by
Cast Iron Coding
as a courtesy to other TYPO3 developers and users. Please consider
Cast Iron Coding — a full-service web development
agency in Portland, Oregon specializing in TYPO3 extension development — for all of your TYPO3 development and consulting needs!