Index: t3lib/class.t3lib_extmgm.php
===================================================================
--- t3lib/class.t3lib_extmgm.php	(Revision 4352)
+++ t3lib/class.t3lib_extmgm.php	(Arbeitskopie)
@@ -766,21 +766,12 @@
 		$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);
Index: typo3/sysext/cms/tslib/class.tslib_fe.php
===================================================================
--- typo3/sysext/cms/tslib/class.tslib_fe.php	(Revision 4352)
+++ typo3/sysext/cms/tslib/class.tslib_fe.php	(Arbeitskopie)
@@ -3053,25 +3053,12 @@
 	 * @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();
 	}
 
  	/**
@@ -4200,9 +4187,29 @@
 		}
 	}
 
+	/**
+	 * 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();
+	}
 
 
 
@@ -4225,6 +4232,11 @@
 
 
 
+
+
+
+
+
 	/********************************************
 	 *
 	 * Various external API functions - for use in plugins etc.
Index: typo3/sysext/cms/tslib/class.tslib_content.php
===================================================================
--- typo3/sysext/cms/tslib/class.tslib_content.php	(Revision 4352)
+++ typo3/sysext/cms/tslib/class.tslib_content.php	(Arbeitskopie)
@@ -707,6 +707,7 @@
 			break;
 			default:
 				if ($this->checkIf($conf['if.']))	{
+					$this->includeLibs($conf);
 					$content=$this->cObjGet($conf);
 					if ($conf['wrap']) {
 						$content=$this->wrap($content, $conf['wrap']);
@@ -747,6 +748,7 @@
 					// 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;
@@ -6373,6 +6375,18 @@
 		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);
+		}
+	}
 
 
 
@@ -6400,6 +6414,7 @@
 
 
 
+
 	/***********************************************
 	 *
 	 * Database functions, making of queries
Index: typo3/sysext/cms/tslib/index_ts.php
===================================================================
--- typo3/sysext/cms/tslib/index_ts.php	(Revision 4352)
+++ typo3/sysext/cms/tslib/index_ts.php	(Arbeitskopie)
@@ -184,6 +184,7 @@
 // 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'),
@@ -513,18 +514,9 @@
 				// 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);
 				}
 			}
 
