/src/typo3_src-4.2.0alpha1/t3lib/class.t3lib_extobjbase.php

00001 <?php
00002 /***************************************************************
00003 *  Copyright notice
00004 *
00005 *  (c) 1999-2005 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 ***************************************************************/
00145 class t3lib_extobjbase {
00146 
00153         var $pObj;      // parent SC object
00154 
00159         var $thisPath = '';
00160 
00165         var $localLangFile = 'locallang.php';
00166 
00172         var $extClassConf;
00173 
00181         var $function_key = '';
00182 
00183 
00184 
00185 
00186 
00187 
00188 
00189 
00190 
00199         function init(&$pObj,$conf)     {
00200                 global $LANG;
00201 
00202                 $this->pObj = &$pObj;
00203 
00204                         // Path of this script:
00205                 $this->thisPath = dirname($conf['path']);
00206                 if (!@is_dir($this->thisPath))  {
00207                         die('Error: '.$this->thisPath.' was not a directory as expected...');
00208                 }
00209 
00210                         // Local lang:
00211                 $this->incLocalLang();
00212 
00213                         // Setting MOD_MENU items as we need them for logging:
00214                 $this->pObj->MOD_MENU = array_merge($this->pObj->MOD_MENU,$this->modMenu());            // Candidate for t3lib_div::array_merge() if integer-keys will some day make trouble...
00215         }
00216 
00223         function handleExternalFunctionValue()  {
00224                         // Must clean first to make sure the correct key is set...
00225                 $this->pObj->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->pObj->MOD_MENU, t3lib_div::_GP('SET'), $this->pObj->MCONF['name']);
00226                 if ($this->function_key)        {
00227                         $this->extClassConf = $this->pObj->getExternalItemConfig($this->pObj->MCONF['name'],$this->function_key,$this->pObj->MOD_SETTINGS[$this->function_key]);
00228                         if (is_array($this->extClassConf) && $this->extClassConf['path'])       {
00229                                 $this->pObj->include_once[] = $this->extClassConf['path'];
00230                         }
00231                 }
00232         }
00233 
00239         function incLocalLang() {
00240                 global $LANG;
00241                 #if ($this->localLangFile && @is_file($this->thisPath.'/'.$this->localLangFile))        {
00242                 #       include($this->thisPath.'/'.$this->localLangFile);
00243                 if ($this->localLangFile && (@is_file($this->thisPath.'/'.$this->localLangFile) || @is_file($this->thisPath.'/'.substr($this->localLangFile,0,-4).'.xml')))     {
00244                         $LOCAL_LANG = $LANG->includeLLFile($this->thisPath.'/'.$this->localLangFile, FALSE);
00245                         if (is_array($LOCAL_LANG))      $GLOBALS['LOCAL_LANG'] = t3lib_div::array_merge_recursive_overrule($GLOBALS['LOCAL_LANG'],$LOCAL_LANG);
00246                 }
00247         }
00248 
00255         function checkExtObj()  {
00256                 if (is_array($this->extClassConf) && $this->extClassConf['name'])       {
00257                         $this->extObj = t3lib_div::makeInstance($this->extClassConf['name']);
00258                         $this->extObj->init($this->pObj,$this->extClassConf);
00259 
00260                                 // Re-write:
00261                         $this->pObj->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->pObj->MOD_MENU, t3lib_div::_GP('SET'), $this->pObj->MCONF['name']);
00262                 }
00263         }
00264 
00270         function extObjContent()        {
00271                 if (is_object($this->extObj))   return $this->extObj->main();
00272         }
00273 
00281         function modMenu()      {
00282                 return array();
00283         }
00284 }
00285 ?>

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!