Index: t3lib/class.t3lib_div.php =================================================================== --- t3lib/class.t3lib_div.php (revision 5022) +++ t3lib/class.t3lib_div.php (working copy) @@ -4682,13 +4682,22 @@ } // Get final classname - $className = t3lib_div::makeInstanceClassName($className); + $className = self::getClassName($className); if (isset($instances[$className])) { // it's a singleton, get the existing instance $instance = $instances[$className]; } else { - $instance = new $className; + if (func_num_args() > 1) { + // removing the method's first argument (the class name) + $constructorArguments = func_get_args(); + array_shift($constructorArguments); + + $reflectionObject = new ReflectionClass($className); + $instance = $reflectionObject->newInstanceArgs($constructorArguments); + } else { + $instance = new $className; + } if ($instance instanceof t3lib_Singleton) { // it's a singleton, save the instance for later reuse @@ -4712,6 +4721,17 @@ } /** + * Return classname for new instance, takes the class-extensions API + * of TYPO3 into account. + * + * @param string Base Class name to evaluate + * @return string Final class name to instantiate with "new [classname]" + */ + protected function getClassName($className) { + return class_exists('ux_'.$className) ? self::getClassName('ux_'.$className) : $className; + } + + /** * Find the best service and check if it works. * Returns object of the service class. * Index: typo3/backend.php =================================================================== --- typo3/backend.php (revision 5022) +++ typo3/backend.php (working copy) @@ -140,9 +140,7 @@ ); foreach($coreToolbarItems as $toolbarItemName => $toolbarItemClassName) { - // Get name of XCLASS (if any): - $toolbarItemClassName = t3lib_div::makeInstanceClassName($toolbarItemClassName); - $toolbarItem = new $toolbarItemClassName($this); + $toolbarItem = t3lib_div::makeInstance($toolbarItemClassName, $this); if(!($toolbarItem instanceof backend_toolbarItem)) { throw new UnexpectedValueException('$toolbarItem "'.$toolbarItemName.'" must implement interface backend_toolbarItem', 1195126772);