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
00227 var $doc;
00228
00234 var $extObj;
00235
00236
00237
00238
00239
00240
00241
00242
00249 function init() {
00250
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
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
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
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 ?>