Main Page | Directories | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages | Examples

class.t3lib_extobjbase.php

Go to the documentation of this file.
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 ***************************************************************/
00145 class t3lib_extobjbase {
00146 
00151    var $pObj;  // parent SC object
00152 
00157    var $thisPath = '';
00158 
00163    var $localLangFile = 'locallang.php';
00164 
00170    var $extClassConf;
00171 
00179    var $function_key = '';
00180 
00181 
00182 
00183 
00184 
00185 
00186 
00187 
00188 
00197    function init(&$pObj,$conf)   {
00198       global $LANG;
00199 
00200       $this->pObj = &$pObj;
00201 
00202          // Path of this script:
00203       $this->thisPath = dirname($conf['path']);
00204       if (!@is_dir($this->thisPath))   {
00205          die('Error: '.$this->thisPath.' was not a directory as expected...');
00206       }
00207 
00208          // Local lang:
00209       $this->incLocalLang();
00210 
00211          // Setting MOD_MENU items as we need them for logging:
00212       $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...
00213    }
00214 
00221    function handleExternalFunctionValue() {
00222          // Must clean first to make sure the correct key is set...
00223       $this->pObj->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->pObj->MOD_MENU, t3lib_div::_GP('SET'), $this->pObj->MCONF['name']);
00224       if ($this->function_key)   {
00225          $this->extClassConf = $this->pObj->getExternalItemConfig($this->pObj->MCONF['name'],$this->function_key,$this->pObj->MOD_SETTINGS[$this->function_key]);
00226          if (is_array($this->extClassConf) && $this->extClassConf['path']) {
00227             $this->pObj->include_once[] = $this->extClassConf['path'];
00228          }
00229       }
00230    }
00231 
00237    function incLocalLang() {
00238       global $LANG;
00239       #if ($this->localLangFile && @is_file($this->thisPath.'/'.$this->localLangFile)) {
00240       #  include($this->thisPath.'/'.$this->localLangFile);
00241       if ($this->localLangFile && (@is_file($this->thisPath.'/'.$this->localLangFile) || @is_file($this->thisPath.'/'.substr($this->localLangFile,0,-4).'.xml'))) {
00242          $LOCAL_LANG = $LANG->includeLLFile($this->thisPath.'/'.$this->localLangFile, FALSE);
00243          if (is_array($LOCAL_LANG)) $GLOBALS['LOCAL_LANG'] = t3lib_div::array_merge_recursive_overrule($GLOBALS['LOCAL_LANG'],$LOCAL_LANG);
00244       }
00245    }
00246 
00253    function checkExtObj()  {
00254       if (is_array($this->extClassConf) && $this->extClassConf['name']) {
00255          $this->extObj = t3lib_div::makeInstance($this->extClassConf['name']);
00256          $this->extObj->init($this->pObj,$this->extClassConf);
00257 
00258             // Re-write:
00259          $this->pObj->MOD_SETTINGS = t3lib_BEfunc::getModuleData($this->pObj->MOD_MENU, t3lib_div::_GP('SET'), $this->pObj->MCONF['name']);
00260       }
00261    }
00262 
00268    function extObjContent()   {
00269       if (is_object($this->extObj)) return $this->extObj->main();
00270    }
00271 
00279    function modMenu()   {
00280       return array();
00281    }
00282 }
00283 ?>

Generated on Sun Oct 3 01:05:48 2004 for TYPO3core 3.7.0 dev by  doxygen 1.3.8-20040913