Feature #19510 ยป 0009654_v2.patch

Administrator Admin, 2008-10-27 20:01

View differences:

t3lib/class.t3lib_extmgm.php (Arbeitskopie)
766 766
		$cN = t3lib_extMgm::getCN($key);
767 767

  
768 768
			// General plugin:
769
		if ($cached) {
770
			$pluginContent = trim('
771
includeLibs.'.$cN.$prefix.' = '.$TYPO3_LOADED_EXT[$key]['siteRelPath'].$classFile.'
772
plugin.'.$cN.$prefix.' = USER
769
		$pluginContent = trim('
770
plugin.'.$cN.$prefix.' = USER' . ($cached ? '' : '_INT') . '
773 771
plugin.'.$cN.$prefix.' {
774
  userFunc = '.$cN.$prefix.'->main
775
}');
776
		} else {
777
			$pluginContent = trim('
778
plugin.'.$cN.$prefix.' = USER_INT
779
plugin.'.$cN.$prefix.' {
780 772
  includeLibs = '.$TYPO3_LOADED_EXT[$key]['siteRelPath'].$classFile.'
781 773
  userFunc = '.$cN.$prefix.'->main
782 774
}');
783
		}
784 775
		t3lib_extMgm::addTypoScript($key, 'setup', '
785 776
# Setting '.$key.' plugin TypoScript
786 777
'.$pluginContent);
typo3/sysext/cms/tslib/class.tslib_fe.php (Arbeitskopie)
3053 3053
	 * @see		INTincScript()
3054 3054
	 */
3055 3055
	protected function INTincScript_includeLibs($INTiS_config) {
3056
		global $TYPO3_CONF_VARS;
3057

  
3058
		$GLOBALS['TT']->push('Include libraries');
3059
		foreach($INTiS_config as $INTiS_cPart)	{
3060
			if ($INTiS_cPart['conf']['includeLibs'])	{
3061
				$INTiS_resourceList = t3lib_div::trimExplode(',', $INTiS_cPart['conf']['includeLibs'],1);
3062
				$GLOBALS['TT']->setTSlogMessage('Files for inclusion: "'.implode(', ', $INTiS_resourceList).'"');
3063

  
3064
				foreach($INTiS_resourceList as $INTiS_theLib)	{
3065
					$INTiS_incFile = $this->tmpl->getFileName($INTiS_theLib);
3066
					if ($INTiS_incFile)	{
3067
						require_once('./'.$INTiS_incFile);
3068
					} else {
3069
						$GLOBALS['TT']->setTSlogMessage('Include file "'.$INTiS_theLib.'" did not exist!', 2);
3070
					}
3071
				}
3056
		foreach($INTiS_config as $INTiS_cPart) {
3057
			if (isset($INTiS_cPart['conf']['includeLibs']) && $INTiS_cPart['conf']['includeLibs']) {
3058
				$INTiS_resourceList = t3lib_div::trimExplode(',', $INTiS_cPart['conf']['includeLibs'], true);
3059
				$this->includeLibraries($INTiS_resourceList);
3072 3060
			}
3073 3061
		}
3074
		$GLOBALS['TT']->pull();
3075 3062
	}
3076 3063

  
3077 3064
 	/**
......
4200 4187
		}
4201 4188
	}
4202 4189

  
4190
	/**
4191
	 * Includes a comma-separated list of library files by PHP function include_once.
4192
	 *
4193
	 * @param	array		$libraries: The libraries to be included.
4194
	 * @return	void
4195
	 */
4196
	public function includeLibraries(array $libraries) {
4197
		global $TYPO3_CONF_VARS;
4203 4198

  
4199
		$GLOBALS['TT']->push('Include libraries');
4200
		$GLOBALS['TT']->setTSlogMessage('Files for inclusion: "' . implode(', ', $libraries) . '"');
4204 4201

  
4202
		foreach ($libraries as $library) {
4203
			$file = $GLOBALS['TSFE']->tmpl->getFileName($library);
4204
			if ($file) {
4205
				include_once('./' . $file);
4206
			} else {
4207
				$GLOBALS['TT']->setTSlogMessage('Include file "' . $file . '" did not exist!', 2);
4208
			}
4209
		}
4205 4210

  
4211
		$GLOBALS['TT']->pull();
4212
	}
4206 4213

  
4207 4214

  
4208 4215

  
......
4225 4232

  
4226 4233

  
4227 4234

  
4235

  
4236

  
4237

  
4238

  
4239

  
4228 4240
	/********************************************
4229 4241
	 *
4230 4242
	 * Various external API functions - for use in plugins etc.
typo3/sysext/cms/tslib/class.tslib_content.php (Arbeitskopie)
707 707
			break;
708 708
			default:
709 709
				if ($this->checkIf($conf['if.']))	{
710
					$this->includeLibs($conf);
710 711
					$content=$this->cObjGet($conf);
711 712
					if ($conf['wrap']) {
712 713
						$content=$this->wrap($content, $conf['wrap']);
......
747 748
					// Come here only if we are not called from $TSFE->INTincScript_process()!
748 749
					$this->userObjectType = self::OBJECTTYPE_USER;
749 750
				}
751
				$this->includeLibs($conf);
750 752
				$tempContent = $this->callUserFunction($conf['userFunc'], $conf, '');
751 753
				if ($this->doConvertToUserIntObject) {
752 754
					$this->doConvertToUserIntObject = false;
......
6373 6375
		return $JSPart;
6374 6376
	}
6375 6377

  
6378
	/**
6379
	 * Includes resources if the config property 'includeLibs' is set.
6380
	 *
6381
	 * @param	array		$config: TypoScript configuration
6382
	 * @return	void
6383
	 */
6384
	protected function includeLibs(array $config) {
6385
		if (isset($config['includeLibs']) && $config['includeLibs']) {
6386
			$libraries = t3lib_div::trimExplode(',', $config['includeLibs'], true);
6387
			$GLOBALS['TSFE']->includeLibraries($libraries);
6388
		}
6389
	}
6376 6390

  
6377 6391

  
6378 6392

  
......
6400 6414

  
6401 6415

  
6402 6416

  
6417

  
6403 6418
	/***********************************************
6404 6419
	 *
6405 6420
	 * Database functions, making of queries
typo3/sysext/cms/tslib/index_ts.php (Arbeitskopie)
184 184
// Connecting to database
185 185
// ***********************************
186 186
$temp_TSFEclassName = t3lib_div::makeInstanceClassName('tslib_fe');
187
/* @var $TSFE tslib_fe */
187 188
$TSFE = new $temp_TSFEclassName(
188 189
	$TYPO3_CONF_VARS,
189 190
	t3lib_div::_GP('id'),
......
513 514
				// Special feature: Include libraries
514 515
			reset($EXTiS_config);
515 516
			while(list(,$EXTiS_cPart)=each($EXTiS_config))	{
516
				if ($EXTiS_cPart['conf']['includeLibs'])	{
517
					$EXTiS_resourceList = t3lib_div::trimExplode(',',$EXTiS_cPart['conf']['includeLibs'],1);
518
					$TT->setTSlogMessage('Files for inclusion: "'.implode(', ',$EXTiS_resourceList).'"');
519
					reset($EXTiS_resourceList);
520
					while(list(,$EXTiS_theLib) = each($EXTiS_resourceList))	{
521
						$EXTiS_incFile = $TSFE->tmpl->getFileName($EXTiS_theLib);
522
						if ($EXTiS_incFile)	{
523
							require_once($EXTiS_incFile);
524
						} else {
525
							$TT->setTSlogMessage('Include file "'.$EXTiS_theLib.'" did not exist!',2);
526
						}
527
					}
517
				if (isset($EXTiS_cPart['conf']['includeLibs']) && $EXTiS_cPart['conf']['includeLibs']) {
518
					$EXTiS_resourceList = t3lib_div::trimExplode(',',$EXTiS_cPart['conf']['includeLibs'], true);
519
					$TSFE->includeLibraries($EXTiS_resourceList);
528 520
				}
529 521
			}
530 522

  
    (1-1/1)