Project

General

Profile

Feature #19510 ยป 0009654_v2.patch

Administrator Admin, 2008-10-27 20:01

View differences:

t3lib/class.t3lib_extmgm.php (Arbeitskopie)
$cN = t3lib_extMgm::getCN($key);
// General plugin:
if ($cached) {
$pluginContent = trim('
includeLibs.'.$cN.$prefix.' = '.$TYPO3_LOADED_EXT[$key]['siteRelPath'].$classFile.'
plugin.'.$cN.$prefix.' = USER
$pluginContent = trim('
plugin.'.$cN.$prefix.' = USER' . ($cached ? '' : '_INT') . '
plugin.'.$cN.$prefix.' {
userFunc = '.$cN.$prefix.'->main
}');
} else {
$pluginContent = trim('
plugin.'.$cN.$prefix.' = USER_INT
plugin.'.$cN.$prefix.' {
includeLibs = '.$TYPO3_LOADED_EXT[$key]['siteRelPath'].$classFile.'
userFunc = '.$cN.$prefix.'->main
}');
}
t3lib_extMgm::addTypoScript($key, 'setup', '
# Setting '.$key.' plugin TypoScript
'.$pluginContent);
typo3/sysext/cms/tslib/class.tslib_fe.php (Arbeitskopie)
* @see INTincScript()
*/
protected function INTincScript_includeLibs($INTiS_config) {
global $TYPO3_CONF_VARS;
$GLOBALS['TT']->push('Include libraries');
foreach($INTiS_config as $INTiS_cPart) {
if ($INTiS_cPart['conf']['includeLibs']) {
$INTiS_resourceList = t3lib_div::trimExplode(',', $INTiS_cPart['conf']['includeLibs'],1);
$GLOBALS['TT']->setTSlogMessage('Files for inclusion: "'.implode(', ', $INTiS_resourceList).'"');
foreach($INTiS_resourceList as $INTiS_theLib) {
$INTiS_incFile = $this->tmpl->getFileName($INTiS_theLib);
if ($INTiS_incFile) {
require_once('./'.$INTiS_incFile);
} else {
$GLOBALS['TT']->setTSlogMessage('Include file "'.$INTiS_theLib.'" did not exist!', 2);
}
}
foreach($INTiS_config as $INTiS_cPart) {
if (isset($INTiS_cPart['conf']['includeLibs']) && $INTiS_cPart['conf']['includeLibs']) {
$INTiS_resourceList = t3lib_div::trimExplode(',', $INTiS_cPart['conf']['includeLibs'], true);
$this->includeLibraries($INTiS_resourceList);
}
}
$GLOBALS['TT']->pull();
}
/**
......
}
}
/**
* Includes a comma-separated list of library files by PHP function include_once.
*
* @param array $libraries: The libraries to be included.
* @return void
*/
public function includeLibraries(array $libraries) {
global $TYPO3_CONF_VARS;
$GLOBALS['TT']->push('Include libraries');
$GLOBALS['TT']->setTSlogMessage('Files for inclusion: "' . implode(', ', $libraries) . '"');
foreach ($libraries as $library) {
$file = $GLOBALS['TSFE']->tmpl->getFileName($library);
if ($file) {
include_once('./' . $file);
} else {
$GLOBALS['TT']->setTSlogMessage('Include file "' . $file . '" did not exist!', 2);
}
}
$GLOBALS['TT']->pull();
}
......
/********************************************
*
* Various external API functions - for use in plugins etc.
typo3/sysext/cms/tslib/class.tslib_content.php (Arbeitskopie)
break;
default:
if ($this->checkIf($conf['if.'])) {
$this->includeLibs($conf);
$content=$this->cObjGet($conf);
if ($conf['wrap']) {
$content=$this->wrap($content, $conf['wrap']);
......
// Come here only if we are not called from $TSFE->INTincScript_process()!
$this->userObjectType = self::OBJECTTYPE_USER;
}
$this->includeLibs($conf);
$tempContent = $this->callUserFunction($conf['userFunc'], $conf, '');
if ($this->doConvertToUserIntObject) {
$this->doConvertToUserIntObject = false;
......
return $JSPart;
}
/**
* Includes resources if the config property 'includeLibs' is set.
*
* @param array $config: TypoScript configuration
* @return void
*/
protected function includeLibs(array $config) {
if (isset($config['includeLibs']) && $config['includeLibs']) {
$libraries = t3lib_div::trimExplode(',', $config['includeLibs'], true);
$GLOBALS['TSFE']->includeLibraries($libraries);
}
}
......
/***********************************************
*
* Database functions, making of queries
typo3/sysext/cms/tslib/index_ts.php (Arbeitskopie)
// Connecting to database
// ***********************************
$temp_TSFEclassName = t3lib_div::makeInstanceClassName('tslib_fe');
/* @var $TSFE tslib_fe */
$TSFE = new $temp_TSFEclassName(
$TYPO3_CONF_VARS,
t3lib_div::_GP('id'),
......
// Special feature: Include libraries
reset($EXTiS_config);
while(list(,$EXTiS_cPart)=each($EXTiS_config)) {
if ($EXTiS_cPart['conf']['includeLibs']) {
$EXTiS_resourceList = t3lib_div::trimExplode(',',$EXTiS_cPart['conf']['includeLibs'],1);
$TT->setTSlogMessage('Files for inclusion: "'.implode(', ',$EXTiS_resourceList).'"');
reset($EXTiS_resourceList);
while(list(,$EXTiS_theLib) = each($EXTiS_resourceList)) {
$EXTiS_incFile = $TSFE->tmpl->getFileName($EXTiS_theLib);
if ($EXTiS_incFile) {
require_once($EXTiS_incFile);
} else {
$TT->setTSlogMessage('Include file "'.$EXTiS_theLib.'" did not exist!',2);
}
}
if (isset($EXTiS_cPart['conf']['includeLibs']) && $EXTiS_cPart['conf']['includeLibs']) {
$EXTiS_resourceList = t3lib_div::trimExplode(',',$EXTiS_cPart['conf']['includeLibs'], true);
$TSFE->includeLibraries($EXTiS_resourceList);
}
}
    (1-1/1)