Index: index.php
===================================================================
--- index.php	(revision 24945)
+++ index.php	(working copy)
@@ -242,8 +242,8 @@
              !$GLOBALS['eZRedirection'] )
 
         {
-            require_once( 'kernel/common/template.php' );
-            $tpl = templateInit();
+            
+            $tpl = eZTemplate::instanceInit();
             $result = "<tr><td>" . $tpl->fetch( 'design:setup/debug_toolbar.tpl' ) . "</td></tr>";
             eZDebug::appendTopReport( "Debug toolbar", $result );
         }
@@ -871,8 +871,8 @@
                                             'text' => eZi18n::translate( 'index.php', 'Some general warnings occured, see debug for more information.' ) ) );
             }
         }
-        require_once( "kernel/common/template.php" );
-        $tpl = templateInit();
+        
+        $tpl = eZTemplate::instanceInit();
         if ( count( $warningList ) == 0 )
             $warningList = false;
         $tpl->setVariable( 'site', $site );
@@ -946,8 +946,7 @@
 eZDebug::setUseExternalCSS( $use_external_css );
 if ( $show_page_layout )
 {
-    require_once( "kernel/common/template.php" );
-    $tpl = templateInit();
+    $tpl = eZTemplate::instanceInit();
     if ( $tpl->hasVariable( 'node' ) )
         $tpl->unsetVariable( 'node' );
 
Index: benchmarks/eztemplate/ezmarktemplatecompiler.php
===================================================================
--- benchmarks/eztemplate/ezmarktemplatecompiler.php	(revision 24945)
+++ benchmarks/eztemplate/ezmarktemplatecompiler.php	(working copy)
@@ -51,8 +51,7 @@
 
     function prime( &$tr )
     {
-        require_once( 'kernel/common/template.php' );
-        $tpl = templateInit();
+        $tpl = eZTemplate::instanceInit();
         $tpl->setIsCachingAllowed( true );
         eZTemplateCompiler::setSettings( array( 'compile' => true,
                                                 'comments' => false,
Index: bin/php/eztc.php
===================================================================
--- bin/php/eztc.php	(revision 24945)
+++ bin/php/eztc.php	(working copy)
@@ -87,9 +87,7 @@
 if ( count( $options['arguments'] ) > 0 )
 {
     $ini = eZINI::instance();
-
-    require_once( 'kernel/common/template.php' );
-    $tpl = templateInit();
+    $tpl = eZTemplate::instanceInit();
 
     $fileList = $options['arguments'];
 
@@ -135,8 +133,8 @@
 
     $designList = array_merge( array( $standardDesign ), $additionalSiteDesignList, array( $siteDesign ) );
 
-    require_once( 'kernel/common/template.php' );
-    $tpl = templateInit();
+
+    $tpl = eZTemplate::instanceInit();
 
     $script->setIterationData( '.', '~' );
     if ( $forceCompile )
Index: bin/php/eztemplatecheck.php
===================================================================
--- bin/php/eztemplatecheck.php	(revision 24945)
+++ bin/php/eztemplatecheck.php	(working copy)
@@ -51,9 +51,7 @@
 if ( count( $options['arguments'] ) > 0 )
 {
     $ini = eZINI::instance();
-
-    require_once( 'kernel/common/template.php' );
-    $tpl = templateInit();
+    $tpl = eZTemplate::instanceInit();
 
     $fileList = array();
 
@@ -112,8 +110,7 @@
 
     $designList = array_merge( array( $standardDesign ), $additionalSiteDesignList, array( $siteDesign ) );
 
-    require_once( 'kernel/common/template.php' );
-    $tpl = templateInit();
+    $tpl = eZTemplate::instanceInit();
 
     $script->setIterationData( '.', '~' );
     $script->setShowVerboseOutput( true );
Index: doc/bc/4.3/changes-4.3.0.txt
===================================================================
--- doc/bc/4.3/changes-4.3.0.txt	(revision 24954)
+++ doc/bc/4.3/changes-4.3.0.txt	(working copy)
@@ -53,6 +53,12 @@
   is no longer part of the hash-structure for each element, and you'll need to access
   it as normal using the node (so $item.node.data_map instead of $item.data_map ).
   
+- templateInit( $name = false )
+
+  Parameter $name is now totally ignored as you have always gotten same instance anyway, so
+  instead make sure you call $tpl->resetVariables(); after you get instance instead.
+  Note: this function has also been deprecated, use eZTemplate::instanceInit()
+  
 
 eZContentClass::instantiate() changes
 -------------------------------------
@@ -76,6 +82,8 @@
   ext_include(), ext_activate(), ext_class(), lib_include(), lib_class() and kernel_class()
   These functions will be removed in a future version.
 
+- kernel/common/template.php: templateInit()
+  Function will be removed in a future version, use eZTemplate::instanceInit() instead.
 
 Renamed methods
 ---------------
@@ -99,3 +107,16 @@
 
 - eZImportLookupTable
   This class is removed after being deprecated since 4.1
+
+Removed globals
+---------------
+
+- eZPublishTemplate & eZPublishTemplate_*
+
+  See above notes on templateInit()
+
+
+- eZTemplateInstance
+
+  eZTemplate::instance() now uses static variable instead.
+
Index: kernel/class/classlist.php
===================================================================
--- kernel/class/classlist.php	(revision 24945)
+++ kernel/class/classlist.php	(working copy)
@@ -70,8 +70,7 @@
 }
 
 $Module->setTitle( eZi18n::translate( 'kernel/class', 'Class list of group' ) . ' ' . $GroupID );
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $user = eZUser::currentUser();
 foreach( $TemplateData as $tpldata )
Index: kernel/class/delete.php
===================================================================
--- kernel/class/delete.php	(revision 24945)
+++ kernel/class/delete.php	(working copy)
@@ -56,8 +56,7 @@
     $Module->redirectTo( '/class/classlist/' . $GroupID );
 }
 $Module->setTitle( "Deletion of class " .$ClassID );
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 
 $tpl->setVariable( "module", $Module );
Index: kernel/class/edit.php
===================================================================
--- kernel/class/edit.php	(revision 24945)
+++ kernel/class/edit.php	(working copy)
@@ -67,8 +67,7 @@
     $class = eZContentClass::fetch( $ClassID, true, eZContentClass::VERSION_STATUS_MODIFIED );
     if ( is_object( $class ) )
     {
-        require_once( 'kernel/common/template.php' );
-        $tpl = templateInit();
+        $tpl = eZTemplate::instanceInit();
         $tpl->setVariable( 'class', $class );
         $tpl->setVariable( "access_type", $GLOBALS['eZCurrentAccess'] );
 
@@ -117,8 +116,7 @@
         if ( $class->attribute( 'modifier_id' ) != $user->attribute( 'contentobject_id' ) &&
              $class->attribute( 'modified' ) + $timeOut > time() )
         {
-            require_once( 'kernel/common/template.php' );
-            $tpl = templateInit();
+            $tpl = eZTemplate::instanceInit();
 
             $res = eZTemplateDesignResource::instance();
             $res->setKeys( array( array( 'class', $class->attribute( 'id' ) ) ) ); // Class ID
@@ -321,9 +319,7 @@
         }
         else
         {
-            require_once( 'kernel/common/template.php' );
-
-            $tpl = templateInit();
+            $tpl = eZTemplate::instanceInit();
 
             $res = eZTemplateDesignResource::instance();
             $res->setKeys( array( array( 'class', $class->attribute( 'id' ) ) ) ); // Class ID
@@ -800,8 +796,7 @@
 $validation = array_merge( $validation, $datatypeValidation );
 
 // Template handling
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $res = eZTemplateDesignResource::instance();
 $res->setKeys( array( array( 'class', $class->attribute( 'id' ) ) ) ); // Class ID
 $tpl->setVariable( 'http', $http );
Index: kernel/class/groupedit.php
===================================================================
--- kernel/class/groupedit.php	(revision 24945)
+++ kernel/class/groupedit.php	(working copy)
@@ -78,8 +78,7 @@
 $Module->setTitle( "Edit class group " . $classgroup->attribute( "name" ) );
 
 // Template handling
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $res = eZTemplateDesignResource::instance();
 $res->setKeys( array( array( "classgroup", $classgroup->attribute( "id" ) ) ) );
Index: kernel/class/grouplist.php
===================================================================
--- kernel/class/grouplist.php	(revision 24945)
+++ kernel/class/grouplist.php	(working copy)
@@ -78,8 +78,7 @@
 }
 
 $Module->setTitle( eZi18n::translate( 'kernel/class', 'Class group list' ) );
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $user = eZUser::currentUser();
 foreach( $TemplateData as $tpldata )
Index: kernel/class/removeclass.php
===================================================================
--- kernel/class/removeclass.php	(revision 24945)
+++ kernel/class/removeclass.php	(working copy)
@@ -114,8 +114,7 @@
 $canRemove = ( $canRemoveCount > 0 );
 
 $Module->setTitle( eZi18n::translate( 'kernel/class', 'Remove classes %class_id', null, array( '%class_id' => $ClassID ) ) );
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'module', $Module );
 $tpl->setVariable( 'GroupID', $GroupID );
Index: kernel/class/removegroup.php
===================================================================
--- kernel/class/removegroup.php	(revision 24945)
+++ kernel/class/removegroup.php	(working copy)
@@ -86,8 +86,7 @@
     $Module->redirectTo( '/class/grouplist/' );
 }
 $Module->setTitle( eZi18n::translate( 'kernel/class', 'Remove class groups' ) . ' ' . $GroupName );
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( "DeleteResult", $deleteResult );
 $tpl->setVariable( "module", $Module );
Index: kernel/class/translation.php
===================================================================
--- kernel/class/translation.php	(revision 24945)
+++ kernel/class/translation.php	(working copy)
@@ -116,9 +116,7 @@
         return $module->redirectToView( 'view', array( $classID ), array( $languageCode ) );
     }
 
-    require_once( "kernel/common/template.php" );
-
-    $tpl = templateInit();
+    $tpl = eZTemplate::instanceInit();
 
     $tpl->setVariable( 'class_id', $classID );
     $tpl->setVariable( 'class', $class );
Index: kernel/class/view.php
===================================================================
--- kernel/class/view.php	(revision 24945)
+++ kernel/class/view.php	(working copy)
@@ -76,9 +76,7 @@
 
 $Module->setTitle( "Edit class " . $class->attribute( "name" ) );
 
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
-
+$tpl = eZTemplate::instanceInit();
 $res = eZTemplateDesignResource::instance();
 $res->setKeys( array( array( 'class', $class->attribute( "id" ) ),
                       array( 'class_identifier', $class->attribute( 'identifier' ) ) ) );
Index: kernel/classes/ezcollaborationitemhandler.php
===================================================================
--- kernel/classes/ezcollaborationitemhandler.php	(revision 24945)
+++ kernel/classes/ezcollaborationitemhandler.php	(working copy)
@@ -172,8 +172,7 @@
         $db->begin();
         if ( $collectionHandling == self::NOTIFICATION_COLLECTION_ONE_FOR_ALL )
         {
-            require_once( 'kernel/common/template.php' );
-            $tpl = templateInit();
+            $tpl = eZTemplate::instanceInit();
             $tpl->resetVariables();
             $tpl->setVariable( 'collaboration_item', $item );
             $result = $tpl->fetch( 'design:notification/handler/ezcollaboration/view/plain.tpl' );
@@ -217,8 +216,7 @@
                 $userCollection[$participantRole][] = $userItem;
             }
 
-            require_once( 'kernel/common/template.php' );
-            $tpl = templateInit();
+            $tpl = eZTemplate::instanceInit();
             $tpl->resetVariables();
             foreach( $userCollection as $participantRole => $collectionItems )
             {
Index: kernel/classes/ezcontentcachemanager.php
===================================================================
--- kernel/classes/ezcontentcachemanager.php	(revision 24945)
+++ kernel/classes/ezcontentcachemanager.php	(working copy)
@@ -810,8 +810,7 @@
                         eZSys::addAccessPath( $changeToSiteAccess );
                     }
     
-                    require_once( 'kernel/common/template.php' );
-                    $tpl = templateInit();
+                    $tpl = eZTemplate::instanceInit();
                     $res = eZTemplateDesignResource::instance();
     
                     // Get the sitedesign and cached view preferences for this siteaccess
Index: kernel/classes/eztrigger.php
===================================================================
--- kernel/classes/eztrigger.php	(revision 24945)
+++ kernel/classes/eztrigger.php	(working copy)
@@ -282,8 +282,7 @@
             case eZWorkflow::STATUS_FETCH_TEMPLATE:
             case eZWorkflow::STATUS_FETCH_TEMPLATE_REPEAT:
             {
-                require_once( 'kernel/common/template.php' );
-                $tpl = templateInit();
+                $tpl = eZTemplate::instanceInit();
                 $result = array();
                 foreach ( array_keys( $workflowProcess->Template['templateVars'] ) as $key )
                 {
Index: kernel/classes/confirmorderhandlers/ezdefaultconfirmorderhandler.php
===================================================================
--- kernel/classes/confirmorderhandlers/ezdefaultconfirmorderhandler.php	(revision 24945)
+++ kernel/classes/confirmorderhandlers/ezdefaultconfirmorderhandler.php	(working copy)
@@ -63,8 +63,7 @@
             $order = $params['order'];
             $email = $params['email'];
 
-            require_once( "kernel/common/template.php" );
-            $tpl = templateInit();
+            $tpl = eZTemplate::instanceInit();
             $tpl->setVariable( 'order', $order );
             $templateResult = $tpl->fetch( 'design:shop/orderemail.tpl' );
 
Index: kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php
===================================================================
--- kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php	(revision 24945)
+++ kernel/classes/datatypes/ezxmltext/ezxmloutputhandler.php	(working copy)
@@ -180,7 +180,7 @@
             return $output;
         }
 
-        $this->Tpl = templateInit();
+        $this->Tpl = eZTemplate::instanceInit();
         $this->Res = eZTemplateDesignResource::instance();
         if ( $this->ContentObjectAttribute )
         {
Index: kernel/classes/datatypes/ezxmltext/ezxmltexttype.php
===================================================================
--- kernel/classes/datatypes/ezxmltext/ezxmltexttype.php	(revision 24945)
+++ kernel/classes/datatypes/ezxmltext/ezxmltexttype.php	(working copy)
@@ -99,7 +99,6 @@
 
 */
 
-require_once( "kernel/common/template.php" );
 class eZXMLTextType extends eZDataType
 {
     const DATA_TYPE_STRING = "ezxmltext";
Index: kernel/classes/notification/handler/ezgeneraldigest/ezgeneraldigesthandler.php
===================================================================
--- kernel/classes/notification/handler/ezgeneraldigest/ezgeneraldigesthandler.php	(revision 24945)
+++ kernel/classes/notification/handler/ezgeneraldigest/ezgeneraldigesthandler.php	(working copy)
@@ -133,8 +133,7 @@
 
             $addressArray = $this->fetchUsersForDigest( $timestamp );
 
-            require_once( 'kernel/common/template.php' );
-            $tpl = templateInit();
+            $tpl = eZTemplate::instanceInit();
 
             foreach ( $addressArray as $address )
             {
Index: kernel/classes/notification/handler/ezsubtree/ezsubtreehandler.php
===================================================================
--- kernel/classes/notification/handler/ezsubtree/ezsubtreehandler.php	(revision 24945)
+++ kernel/classes/notification/handler/ezsubtree/ezsubtreehandler.php	(working copy)
@@ -115,8 +115,7 @@
         {
             return eZNotificationEventHandler::EVENT_SKIPPED;
         }
-        require_once( 'kernel/common/template.php' );
-        $tpl = templateInit();
+        $tpl = eZTemplate::instanceInit();
         $tpl->resetVariables();
 
         $parentNode = $contentNode->attribute( 'parent' );
Index: kernel/collaboration/group.php
===================================================================
--- kernel/collaboration/group.php	(revision 24945)
+++ kernel/collaboration/group.php	(working copy)
@@ -52,8 +52,7 @@
 
 $viewParameters = array( 'offset' => $Offset );
 
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'view_parameters', $viewParameters );
 $tpl->setVariable( 'collab_group', $collabGroup );
Index: kernel/collaboration/item.php
===================================================================
--- kernel/collaboration/item.php	(revision 24945)
+++ kernel/collaboration/item.php	(working copy)
@@ -48,8 +48,7 @@
 
 $viewParameters = array( 'offset' => $Offset );
 
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'view_parameters', $viewParameters );
 $tpl->setVariable( 'collab_item', $collabItem );
Index: kernel/collaboration/view.php
===================================================================
--- kernel/collaboration/view.php	(revision 24945)
+++ kernel/collaboration/view.php	(working copy)
@@ -47,8 +47,8 @@
 
 $viewParameters = array( 'offset' => $Offset );
 
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'view_parameters', $viewParameters );
 
Index: kernel/common/template.php
===================================================================
--- kernel/common/template.php	(revision 24945)
+++ kernel/common/template.php	(working copy)
@@ -26,48 +26,17 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-
+/**
+ * Function to get template instance, load autoloads (operators) and set default settings. 
+ * 
+ * @deprecated Deprecated as of 4.3, use {@see eZTemplate::instanceInit()} instead
+ * @param string $name (Not supported as it was prevoisly set on same instance anyway)
+ * @return eZTemplate
+ */
 function templateInit( $name = false )
 {
-    if ( $name === false &&
-         isset( $GLOBALS['eZPublishTemplate'] ) )
-    {
-        return $GLOBALS['eZPublishTemplate'];
-    }
-    if ( isset( $GLOBALS["eZPublishTemplate_$name"] ) )
-    {
-        return $GLOBALS["eZPublishTemplate_$name"];
-    }
-    $tpl = eZTemplate::instance();
-
-    $ini = eZINI::instance();
-    if ( $ini->variable( 'TemplateSettings', 'Debug' ) == 'enabled' )
-        eZTemplate::setIsDebugEnabled( true );
-
-    $compatAutoLoadPath = $ini->variableArray( 'TemplateSettings', 'AutoloadPath' );
-    $autoLoadPathList = $ini->variable( 'TemplateSettings', 'AutoloadPathList' );
-
-    $extensionAutoloadPath = $ini->variable( 'TemplateSettings', 'ExtensionAutoloadPath' );
-    $extensionPathList = eZExtension::expandedPathList( $extensionAutoloadPath, 'autoloads' );
-
-    $autoLoadPathList = array_unique( array_merge( $compatAutoLoadPath, $autoLoadPathList, $extensionPathList ) );
-
-    $tpl->setAutoloadPathList( $autoLoadPathList );
-    $tpl->autoload();
-
-    $tpl->registerResource( eZTemplateDesignResource::instance() );
-
-    if ( $name === false )
-    {
-        $GLOBALS['eZPublishTemplate'] = $tpl;
-    }
-    else
-    {
-        $GLOBALS["eZPublishTemplate_$name"] = $tpl;
-    }
-
-    return $tpl;
+    return eZTemplate::instanceInit();
 }
 
 
-?>
+?>
\ No newline at end of file
Index: kernel/content/action.php
===================================================================
--- kernel/content/action.php	(revision 24945)
+++ kernel/content/action.php	(working copy)
@@ -114,8 +114,8 @@
         if ( count( $allLanguages ) > 1 &&
              $hasClassInformation )
         {
-            require_once( 'kernel/common/template.php' );
-            $tpl = templateInit();
+            
+            $tpl = eZTemplate::instanceInit();
 
             $tpl->setVariable( 'node_id', $http->postVariable( 'NodeID' ) );
             $tpl->setVariable( 'class_id', $contentClassID );
Index: kernel/content/advancedsearch.php
===================================================================
--- kernel/content/advancedsearch.php	(revision 24945)
+++ kernel/content/advancedsearch.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 
 /*!
  Get search limit
@@ -62,7 +62,7 @@
 if ( $ViewMode == 'offset' )
     $ViewMode = '';
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $ini = eZINI::instance();
 $useSearchCode = $ini->variable( 'SearchSettings', 'SearchViewHandling' ) == 'default';
Index: kernel/content/attribute_edit.php
===================================================================
--- kernel/content/attribute_edit.php	(revision 24945)
+++ kernel/content/attribute_edit.php	(working copy)
@@ -34,7 +34,7 @@
   \param $Module must be set by the code which includes this file
 */
 
-require_once( 'kernel/common/template.php' );
+
 
 if ( isset( $Module ) )
     $Module = $Params['Module'];
@@ -417,7 +417,7 @@
     $tpl = $Params['TemplateObject'];
 
 if ( !isset( $tpl ) || !( $tpl instanceof eZTemplate ) )
-    $tpl = templateInit();
+    $tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'validation', $validation );
 $tpl->setVariable( 'validation_log', $validatedAttributes );
Index: kernel/content/bookmark.php
===================================================================
--- kernel/content/bookmark.php	(revision 24945)
+++ kernel/content/bookmark.php	(working copy)
@@ -30,7 +30,7 @@
 
 /*! \file
 */
-require_once( 'kernel/common/template.php' );
+
 $Module = $Params['Module'];
 $http = eZHTTPTool::instance();
 
@@ -88,7 +88,7 @@
     }
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable('view_parameters', $viewParameters );
 
 $Result = array();
Index: kernel/content/browse.php
===================================================================
--- kernel/content/browse.php	(revision 24945)
+++ kernel/content/browse.php	(working copy)
@@ -26,9 +26,9 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
 
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $http = eZHTTPTool::instance();
 
 $browse = new eZContentBrowse();
Index: kernel/content/collectedinfo.php
===================================================================
--- kernel/content/collectedinfo.php	(revision 24945)
+++ kernel/content/collectedinfo.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 
 $module = $Params['Module'];
 $viewMode = 'full';
@@ -57,7 +57,7 @@
 
 $http = eZHTTPTool::instance();
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $icMap = array();
 if ( $http->hasSessionVariable( 'InformationCollectionMap' ) )
Index: kernel/content/collectinformation.php
===================================================================
--- kernel/content/collectinformation.php	(revision 24945)
+++ kernel/content/collectinformation.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 
 $Module = $Params['Module'];
 $http = eZHTTPTool::instance();
@@ -72,7 +72,7 @@
          ( $userDataHandling == 'unique' and
            $collection ) )
     {
-        $tpl = templateInit();
+        $tpl = eZTemplate::instanceInit();
 
         $attributeHideList = eZInformationCollection::attributeHideList();
         $informationCollectionTemplate = eZInformationCollection::templateForObject( $object );
@@ -242,7 +242,7 @@
 
         if ( $sendEmail )
         {
-            $tpl = templateInit();
+            $tpl = eZTemplate::instanceInit();
 
             $attributeHideList = eZInformationCollection::attributeHideList();
             $informationCollectionTemplate = eZInformationCollection::templateForObject( $object );
Index: kernel/content/copy.php
===================================================================
--- kernel/content/copy.php	(revision 24945)
+++ kernel/content/copy.php	(working copy)
@@ -182,8 +182,8 @@
 function chooseObjectVersionsToCopy( $Module, &$Result, $object )
 {
         $selectedNodeIDArray = eZContentBrowse::result( $Module->currentAction() );
-        require_once( 'kernel/common/template.php' );
-        $tpl = templateInit();
+        
+        $tpl = eZTemplate::instanceInit();
         $tpl->setVariable( 'object', $object );
         $tpl->setVariable( 'selected_node_id', $selectedNodeIDArray[0] );
         $Result['content'] = $tpl->fetch( 'design:content/copy.tpl' );
Index: kernel/content/copysubtree.php
===================================================================
--- kernel/content/copysubtree.php	(revision 24945)
+++ kernel/content/copysubtree.php	(working copy)
@@ -825,8 +825,8 @@
 {
         $selectedNodeIDArray = eZContentBrowse::result( $Module->currentAction() );
 
-        require_once( 'kernel/common/template.php' );
-        $tpl = templateInit();
+        
+        $tpl = eZTemplate::instanceInit();
 
         $tpl->setVariable( 'node', $srcNode );
         $tpl->setVariable( 'selected_node_id', $selectedNodeIDArray[0] );
@@ -843,8 +843,8 @@
 
 function showNotificationAfterCopying( $http, $Module, &$Result, &$Notifications, $srcNode )
 {
-    require_once( 'kernel/common/template.php' );
-    $tpl = templateInit();
+    
+    $tpl = eZTemplate::instanceInit();
 
     if ( $http->hasSessionVariable( "LastAccessesURI" ) )
     {
Index: kernel/content/dashboard.php
===================================================================
--- kernel/content/dashboard.php	(revision 24945)
+++ kernel/content/dashboard.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 
 $ini = eZINI::instance( 'dashboard.ini' );
 $currentUser = eZUser::currentUser();
@@ -99,7 +99,7 @@
 
 $contentInfoArray = array();
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'blocks', $orderedBlocks );
 $tpl->setVariable( 'user', $currentUser );
Index: kernel/content/diff.php
===================================================================
--- kernel/content/diff.php	(revision 24945)
+++ kernel/content/diff.php	(working copy)
@@ -27,7 +27,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 
 $Module = $Params['Module'];
 $objectID = $Params['ObjectID'];
@@ -51,7 +51,7 @@
     return $Module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
 
 $http = eZHTTPTool::instance();
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $res = eZTemplateDesignResource::instance();
 $res->setKeys( array( array( 'object', $contentObject->attribute( 'id' ) ),
Index: kernel/content/draft.php
===================================================================
--- kernel/content/draft.php	(revision 24945)
+++ kernel/content/draft.php	(working copy)
@@ -30,7 +30,7 @@
 
 /*! \file
 */
-require_once( 'kernel/common/template.php' );
+
 $Module = $Params['Module'];
 $http = eZHTTPTool::instance();
 
@@ -75,7 +75,7 @@
     $db->commit();
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable('view_parameters', $viewParameters );
 
Index: kernel/content/edit.php
===================================================================
--- kernel/content/edit.php	(revision 24945)
+++ kernel/content/edit.php	(working copy)
@@ -326,9 +326,9 @@
         }
 
         // No version found, ask the user.
-        require_once( 'kernel/common/template.php' );
+        
 
-        $tpl = templateInit();
+        $tpl = eZTemplate::instanceInit();
 
         $res = eZTemplateDesignResource::instance();
         $res->setKeys( array( array( 'object', $obj->attribute( 'id' ) ),
@@ -394,8 +394,8 @@
                 }
             }
 
-            require_once( 'kernel/common/template.php' );
-            $tpl = templateInit();
+            
+            $tpl = eZTemplate::instanceInit();
 
             $res = eZTemplateDesignResource::instance();
             $res->setKeys( array( array( 'object', $obj->attribute( 'id' ) ),
@@ -438,8 +438,8 @@
                     $mostRecentDraft = $currentDraft;
                 }
             }
-            require_once( 'kernel/common/template.php' );
-            $tpl = templateInit();
+            
+            $tpl = eZTemplate::instanceInit();
 
                 $res = eZTemplateDesignResource::instance();
             $res->setKeys( array( array( 'object', $obj->attribute( 'id' ) ),
@@ -673,8 +673,8 @@
                 $conflictingVersions = $version->hasConflicts( $EditLanguage );
                 if ( $conflictingVersions )
                 {
-                    require_once( 'kernel/common/template.php' );
-                    $tpl = templateInit();
+                    
+                    $tpl = eZTemplate::instanceInit();
 
                     $res = eZTemplateDesignResource::instance();
                     $res->setKeys( array( array( 'object', $object->attribute( 'id' ) ),
Index: kernel/content/error.php
===================================================================
--- kernel/content/error.php	(revision 24945)
+++ kernel/content/error.php	(working copy)
@@ -25,13 +25,13 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 
 $NodeID = $Params['NodeID'];
 $Module = $Params['Module'];
 
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $Module->setTitle( "Error 404 object " . $NodeID . " not found" );
 
Index: kernel/content/history.php
===================================================================
--- kernel/content/history.php	(revision 24945)
+++ kernel/content/history.php	(working copy)
@@ -26,8 +26,8 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $http = eZHTTPTool::instance();
 
 $ObjectID = $Params['ObjectID'];
Index: kernel/content/keyword.php
===================================================================
--- kernel/content/keyword.php	(revision 24945)
+++ kernel/content/keyword.php	(working copy)
@@ -30,7 +30,7 @@
 
 /*! \file
 */
-require_once( 'kernel/common/template.php' );
+
 
 $Module = $Params['Module'];
 $Alphabet = rawurldecode( $Params['Alphabet'] );
@@ -39,7 +39,7 @@
 $ClassID = $Params['ClassID'];
 $viewParameters = array( 'offset' => $Offset, 'classid' => $ClassID );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'view_parameters', $viewParameters );
 $tpl->setVariable( 'alphabet', $Alphabet );
Index: kernel/content/newcontent.php
===================================================================
--- kernel/content/newcontent.php	(revision 24945)
+++ kernel/content/newcontent.php	(working copy)
@@ -27,9 +27,9 @@
 //
 
 
-require_once( 'kernel/common/template.php' );
 
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $user = eZUser::currentUser();
 
 $tpl->setVariable( "view_parameters", $Params['UserParameters'] );
Index: kernel/content/node_edit.php
===================================================================
--- kernel/content/node_edit.php	(revision 24945)
+++ kernel/content/node_edit.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 
 
 function checkNodeAssignments( $module, $class, $object, $version, $contentObjectAttributes, $editVersion, $editLanguage, $FromLanguage, &$validation )
Index: kernel/content/pdf.php
===================================================================
--- kernel/content/pdf.php	(revision 24945)
+++ kernel/content/pdf.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 $NodeID = $Params['NodeID'];
 $Module = $Params['Module'];
 $LanguageCode = $Params['Language'];
@@ -301,7 +301,7 @@
                           array( 'class_group', $object->attribute( 'match_ingroup_id_list' ) ),
                           array( 'class_identifier', $object->attribute( 'class_identifier' ) ) ) );
 
-    $tpl = templateInit();
+    $tpl = eZTemplate::instanceInit();
 
     $tpl->setVariable( 'view_parameters', $viewParameters );
 
Index: kernel/content/pendinglist.php
===================================================================
--- kernel/content/pendinglist.php	(revision 24945)
+++ kernel/content/pendinglist.php	(working copy)
@@ -31,7 +31,7 @@
 /*! \file
 */
 
-require_once( 'kernel/common/template.php' );
+
 $Module = $Params['Module'];
 $http = eZHTTPTool::instance();
 
@@ -42,7 +42,7 @@
 $userID = $user->id();
 
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable('view_parameters', $viewParameters );
 
 $Result = array();
Index: kernel/content/relation_edit.php
===================================================================
--- kernel/content/relation_edit.php	(revision 24945)
+++ kernel/content/relation_edit.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 
 function checkRelationAssignments( $module, $class, $object, $version, $contentObjectAttributes, $editVersion, $editLanguage, $fromLanguage, &$validation )
 {
Index: kernel/content/removeassignment.php
===================================================================
--- kernel/content/removeassignment.php	(revision 24945)
+++ kernel/content/removeassignment.php	(working copy)
@@ -27,7 +27,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 
 $module = $Params['Module'];
 $http   = eZHTTPTool::instance();
@@ -132,7 +132,7 @@
                          'remove_list'    => $removeList );
 $info = array( 'can_remove_all' => $canRemoveAll );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( 'assignment_data', $assignmentData );
 $tpl->setVariable( 'remove_info', $info );
 
Index: kernel/content/removeeditversion.php
===================================================================
--- kernel/content/removeeditversion.php	(revision 24945)
+++ kernel/content/removeeditversion.php	(working copy)
@@ -117,8 +117,8 @@
 
 $Module->setTitle( "Remove Editing Version" );
 
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( "Module", $Module );
 $tpl->setVariable( "object_id", $objectID );
 $tpl->setVariable( "object_version", $version );
Index: kernel/content/removenode.php
===================================================================
--- kernel/content/removenode.php	(revision 24945)
+++ kernel/content/removenode.php	(working copy)
@@ -29,11 +29,11 @@
 /*! \file
 */
 
-require_once( 'kernel/common/template.php' );
+
 
 $http = eZHTTPTool::instance();
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $Module = $Params['Module'];
 $ObjectID = $Params['ObjectID'];
Index: kernel/content/removeobject.php
===================================================================
--- kernel/content/removeobject.php	(revision 24945)
+++ kernel/content/removeobject.php	(working copy)
@@ -27,7 +27,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 
 $Module = $Params['Module'];
 
@@ -217,7 +217,7 @@
     }
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'reverse_related'        , $info['reverse_related_count'] );
 $tpl->setVariable( 'module'                 , $Module );
Index: kernel/content/restore.php
===================================================================
--- kernel/content/restore.php	(revision 24945)
+++ kernel/content/restore.php	(working copy)
@@ -27,7 +27,7 @@
 //
 
 
-require_once( 'kernel/common/template.php' );
+
 
 $objectID = $Params['ObjectID'];
 $module = $Params['Module'];
@@ -229,7 +229,7 @@
     return;
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $res = eZTemplateDesignResource::instance();
 
Index: kernel/content/reverserelatedlist.php
===================================================================
--- kernel/content/reverserelatedlist.php	(revision 24945)
+++ kernel/content/reverserelatedlist.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 $http = eZHTTPTool::instance();
 
 $Module = $Params['Module'];
@@ -149,7 +149,7 @@
 $contentObjectName = $contentObjectTreeNode->attribute('name');
 $viewParameters = array( 'offset' => $Offset );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'children_list', $childrenList );
 $tpl->setVariable( 'view_parameters', $viewParameters );
Index: kernel/content/search.php
===================================================================
--- kernel/content/search.php	(revision 24945)
+++ kernel/content/search.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 
 /*!
  Get search limit
@@ -62,7 +62,7 @@
     $Offset = 0;
 
 $searchPageLimit = 2;
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $ini = eZINI::instance();
 $useSearchCode = $ini->variable( 'SearchSettings', 'SearchViewHandling' ) == 'default';
 $logSearchStats = $ini->variable( 'SearchSettings', 'LogSearchStats' ) == 'enabled';
Index: kernel/content/tipafriend.php
===================================================================
--- kernel/content/tipafriend.php	(revision 24945)
+++ kernel/content/tipafriend.php	(working copy)
@@ -26,14 +26,14 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 
 $http = eZHTTPTool::instance();
 
 $NodeID = (int)$Params['NodeID'];
 $Module = $Params['Module'];
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( 'action', '' );
 
 $error_strings = array();
@@ -151,7 +151,7 @@
         $overrideKeysAreSet = true;
 
         // fetch text from mail template
-        $mailtpl = templateInit();
+        $mailtpl = eZTemplate::instanceInit();
         $mailtpl->setVariable( 'hostname', $hostName );
         $mailtpl->setVariable( 'nodename', $nodeName );
         $mailtpl->setVariable( 'node_id', $NodeID );
Index: kernel/content/translation.php
===================================================================
--- kernel/content/translation.php	(revision 24945)
+++ kernel/content/translation.php	(working copy)
@@ -170,9 +170,9 @@
         return $module->redirectToView( 'view', array( $viewMode, $nodeID, $languageCode ) );
     }
 
-    require_once( "kernel/common/template.php" );
+    
 
-    $tpl = templateInit();
+    $tpl = eZTemplate::instanceInit();
 
     $tpl->setVariable( 'object_id', $objectID );
     $tpl->setVariable( 'object', $object );
Index: kernel/content/translations.php
===================================================================
--- kernel/content/translations.php	(revision 24945)
+++ kernel/content/translations.php	(working copy)
@@ -31,8 +31,8 @@
 /*! \file
 */
 
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $http = eZHTTPTool::instance();
 $Module = $Params['Module'];
 
Index: kernel/content/trash.php
===================================================================
--- kernel/content/trash.php	(revision 24945)
+++ kernel/content/trash.php	(working copy)
@@ -31,7 +31,7 @@
 /*! \file
 */
 
-require_once( 'kernel/common/template.php' );
+
 $Module = $Params['Module'];
 $Offset = $Params['Offset'];
 if ( isset( $Params['UserParameters'] ) )
@@ -116,7 +116,7 @@
     }
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( 'view_parameters', $viewParameters );
 
 $Result = array();
Index: kernel/content/upload.php
===================================================================
--- kernel/content/upload.php	(revision 24945)
+++ kernel/content/upload.php	(working copy)
@@ -26,9 +26,9 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
 
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $http = eZHTTPTool::instance();
 $module = $Params['Module'];
 
Index: kernel/content/urlalias.php
===================================================================
--- kernel/content/urlalias.php	(revision 24945)
+++ kernel/content/urlalias.php	(working copy)
@@ -28,7 +28,7 @@
 
 /*! \file
 */
-require_once( 'kernel/common/template.php' );
+
 $Module = $Params['Module'];
 $http = eZHTTPTool::instance();
 
@@ -38,7 +38,7 @@
 
 eZSSLZone::checkNodeID( 'content', 'urlalias', $NodeID );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $limit = 20;
 
 $node = eZContentObjectTreeNode::fetch( $NodeID );
Index: kernel/content/urlalias_global.php
===================================================================
--- kernel/content/urlalias_global.php	(revision 24945)
+++ kernel/content/urlalias_global.php	(working copy)
@@ -28,14 +28,14 @@
 
 /*! \file
 */
-require_once( 'kernel/common/template.php' );
+
 $Module = $Params['Module'];
 $http = eZHTTPTool::instance();
 
 $Offset = $Params['Offset'];
 $viewParameters = array( 'offset' => $Offset );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $limit = 20;
 
 // TODO: For PHP 5, merge similar code in urlalias.php and urlalias_global.php into a function/class.
Index: kernel/content/urlalias_wildcard.php
===================================================================
--- kernel/content/urlalias_wildcard.php	(revision 24945)
+++ kernel/content/urlalias_wildcard.php	(working copy)
@@ -28,7 +28,7 @@
 
 /*! \file
 */
-require_once( 'kernel/common/template.php' );
+
 
 $Module =& $Params['Module'];
 $http = eZHTTPTool::instance();
@@ -39,7 +39,7 @@
     $Offset = $Module->actionParameter( 'Offset' );
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $limit = 20;
 
 $infoCode = 'no-errors'; // This will be modified if info/warning is given to user.
Index: kernel/content/versions.php
===================================================================
--- kernel/content/versions.php	(revision 24945)
+++ kernel/content/versions.php	(working copy)
@@ -26,9 +26,9 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
 
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $http = eZHTTPTool::instance();
 
 $ObjectID = $Params['ObjectID'];
Index: kernel/content/versionview.php
===================================================================
--- kernel/content/versionview.php	(revision 24945)
+++ kernel/content/versionview.php	(working copy)
@@ -46,8 +46,8 @@
     return $Module->redirectTo( $userRedirectURI );
 }
 
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 // Will be sent from the content/edit page and should be kept
 // incase the user decides to continue editing.
 $FromLanguage = $Params['FromLanguage'];
Index: kernel/content/versionviewframe.php
===================================================================
--- kernel/content/versionviewframe.php	(revision 24945)
+++ kernel/content/versionviewframe.php	(working copy)
@@ -87,8 +87,8 @@
     $conflictingVersions = $versionObject->hasConflicts( $LanguageCode );
     if ( $conflictingVersions )
     {
-        require_once( 'kernel/common/template.php' );
-        $tpl = templateInit();
+        
+        $tpl = eZTemplate::instanceInit();
 
         $res = eZTemplateDesignResource::instance();
         $res->setKeys( array( array( 'object', $contentObject->attribute( 'id' ) ),
Index: kernel/content/view.php
===================================================================
--- kernel/content/view.php	(revision 24945)
+++ kernel/content/view.php	(working copy)
@@ -26,11 +26,11 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 
 $http = eZHTTPTool::instance();
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $ViewMode = $Params['ViewMode'];
 $NodeID = $Params['NodeID'];
Index: kernel/error/view.php
===================================================================
--- kernel/error/view.php	(revision 24945)
+++ kernel/error/view.php	(working copy)
@@ -26,9 +26,9 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
 
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $module = $Params['Module'];
 $errorType = $Params['Type'];
Index: kernel/ezinfo/about.php
===================================================================
--- kernel/ezinfo/about.php	(revision 24945)
+++ kernel/ezinfo/about.php	(working copy)
@@ -29,7 +29,7 @@
 define( 'EZ_ABOUT_CONTRIBUTORS_DIR', 'var/storage/contributors' );
 define( 'EZ_ABOUT_THIRDPARTY_SOFTWARE_FILE', 'var/storage/third_party_software.php' );
 
-require_once( 'kernel/common/template.php' );
+
 /*!
   Returns list of contributors;
   Searches all php files in \a $pathToDir and tries to fetch contributor's info
@@ -165,7 +165,7 @@
                                                 'eZ publish' => '<a href="http://ez.no/ezpublish">eZ Publish</a>' ),
                                          array( $whatIsEzPublish, $license, $contributors, $thirdPartySoftware, $extensions ) );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( 'ezinfo', $ezinfo );
 $tpl->setVariable( 'what_is_ez_publish', $whatIsEzPublish );
 $tpl->setVariable( 'license', $license );
Index: kernel/infocollector/collectionlist.php
===================================================================
--- kernel/infocollector/collectionlist.php	(revision 24945)
+++ kernel/infocollector/collectionlist.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 $http = eZHTTPTool::instance();
 $module = $Params['Module'];
 $objectID = $Params['ObjectID'];
@@ -46,7 +46,7 @@
 
     $collections = count( $collectionIDArray );
 
-    $tpl = templateInit();
+    $tpl = eZTemplate::instanceInit();
     $tpl->setVariable( 'module', $module );
     $tpl->setVariable( 'collections', $collections );
     $tpl->setVariable( 'object_id', $objectID );
@@ -112,7 +112,7 @@
 $viewParameters = array( 'offset' => $offset );
 $objectName = $object->attribute( 'name' );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( 'module', $module );
 $tpl->setVariable( 'limit', $limit );
 $tpl->setVariable( 'view_parameters', $viewParameters );
Index: kernel/infocollector/overview.php
===================================================================
--- kernel/infocollector/overview.php	(revision 24945)
+++ kernel/infocollector/overview.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 $http = eZHTTPTool::instance();
 $module = $Params['Module'];
 $offset = $Params['Offset'];
@@ -49,7 +49,7 @@
         $collections += eZInformationCollection::fetchCollectionCountForObject( $objectID );
     }
 
-    $tpl = templateInit();
+    $tpl = eZTemplate::instanceInit();
     $tpl->setVariable( 'module', $module );
     $tpl->setVariable( 'collections', $collections );
     $tpl->setVariable( 'remove_type', 'objects' );
@@ -150,7 +150,7 @@
 
 $viewParameters = array( 'offset' => $offset );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( 'module', $module );
 $tpl->setVariable( 'limit', $limit );
 $tpl->setVariable( 'view_parameters', $viewParameters );
Index: kernel/infocollector/view.php
===================================================================
--- kernel/infocollector/view.php	(revision 24945)
+++ kernel/infocollector/view.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 
 $http = eZHTTPTool::instance();
 $Module = $Params['Module'];
@@ -55,7 +55,7 @@
 $objectID   = $collection->attribute( 'contentobject_id' );
 $objectName = $object->attribute( 'name' );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( 'module', $Module );
 $tpl->setVariable( 'collection', $collection );
 
Index: kernel/notification/addtonotification.php
===================================================================
--- kernel/notification/addtonotification.php	(revision 24945)
+++ kernel/notification/addtonotification.php	(working copy)
@@ -30,7 +30,7 @@
 
 /*! \file
 */
-require_once( 'kernel/common/template.php' );
+
 $module = $Params['Module'];
 $http = eZHTTPTool::instance();
 
@@ -69,7 +69,7 @@
     return;
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 if ( $http->hasSessionVariable( "LastAccessesURI" ) )
     $tpl->setVariable( 'redirect_url', $http->sessionVariable( "LastAccessesURI" ) );
 //else
Index: kernel/notification/runfilter.php
===================================================================
--- kernel/notification/runfilter.php	(revision 24945)
+++ kernel/notification/runfilter.php	(working copy)
@@ -28,12 +28,12 @@
 
 /*! \file
 */
-require_once( 'kernel/common/template.php' );
+
 
 $http = eZHTTPTool::instance();
 $Module = $Params['Module'];
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'filter_proccessed', false );
 $tpl->setVariable( 'time_event_created', false );
Index: kernel/notification/settings.php
===================================================================
--- kernel/notification/settings.php	(revision 24945)
+++ kernel/notification/settings.php	(working copy)
@@ -31,7 +31,7 @@
 /*! \file
 */
 
-require_once( 'kernel/common/template.php' );
+
 $http = eZHTTPTool::instance();
 
 $Module = $Params['Module'];
@@ -60,7 +60,7 @@
 
 $viewParameters = array( 'offset' => $Params['Offset'] );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( 'user', $user );
 $tpl->setVariable( 'view_parameters', $viewParameters );
 
Index: kernel/package/create.php
===================================================================
--- kernel/package/create.php	(revision 24945)
+++ kernel/package/create.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 $module = $Params['Module'];
 
 $http = eZHTTPTool::instance();
@@ -65,7 +65,7 @@
     }
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $templateName = 'design:package/create.tpl';
 if ( $creator )
Index: kernel/package/install.php
===================================================================
--- kernel/package/install.php	(revision 24945)
+++ kernel/package/install.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 $http = eZHTTPTool::instance();
 
 $module = $Params['Module'];
@@ -61,7 +61,7 @@
 
 $installItemArray = $package->installItemsList( false, eZSys::osType() );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 if ( $module->isCurrentAction( 'SkipPackage' ) )
 {
Index: kernel/package/list.php
===================================================================
--- kernel/package/list.php	(revision 24945)
+++ kernel/package/list.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 $module = $Params['Module'];
 $offset = (int)$Params['Offset'];
 
@@ -77,7 +77,7 @@
     return $module->redirectToView( 'create' );
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $viewParameters = array( 'offset' => $offset );
 
Index: kernel/package/uninstall.php
===================================================================
--- kernel/package/uninstall.php	(revision 24945)
+++ kernel/package/uninstall.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 $http = eZHTTPTool::instance();
 
 $module = $Params['Module'];
@@ -61,7 +61,7 @@
     return $module->redirectToView( 'view', array( 'full', $package->attribute( 'name' ) ) );
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 // Get all uninstall items and reverse array
 $uninstallItems = array_reverse( $package->installItemsList( false, false, false, false ) );
Index: kernel/package/upload.php
===================================================================
--- kernel/package/upload.php	(revision 24945)
+++ kernel/package/upload.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 $module = $Params['Module'];
 
 if ( !eZPackage::canUsePolicyFunction( 'import' ) )
@@ -87,7 +87,7 @@
     return;
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'package', $package );
 $tpl->setVariable( 'error_list', $errorList );
Index: kernel/package/view.php
===================================================================
--- kernel/package/view.php	(revision 24945)
+++ kernel/package/view.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 $module = $Params['Module'];
 $viewMode = $Params['ViewMode'];
 $packageName = $Params['PackageName'];
@@ -57,7 +57,7 @@
 
 $repositoryInformation = $package->currentRepositoryInformation();
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'package_name', $packageName );
 $tpl->setVariable( 'repository_id', $repositoryID );
Index: kernel/pdf/edit.php
===================================================================
--- kernel/pdf/edit.php	(revision 24945)
+++ kernel/pdf/edit.php	(working copy)
@@ -28,7 +28,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 $Module = $Params['Module'];
 $http = eZHTTPTool::instance();
 
@@ -57,7 +57,7 @@
         {
             // TODO: In 3.6
             // // locked editing
-            // $tpl = templateInit();
+            // $tpl = eZTemplate::instanceInit();
             // $tpl->setVariable ...
             // $Result = array();
             // $Result['content'] = $tpl->fetch( 'design:pdf/edit_denied.tpl' );
@@ -172,7 +172,7 @@
     return $Module->redirect( 'pdf', 'list' );
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'set_warning', $setWarning );
 
@@ -211,7 +211,7 @@
     {
         $object = $node->attribute( 'object' );
 
-        $tpl = templateInit();
+        $tpl = eZTemplate::instanceInit();
 
         $tpl->setVariable( 'node', $node );
         $tpl->setVariable( 'generate_toc', 1 );
Index: kernel/pdf/list.php
===================================================================
--- kernel/pdf/list.php	(revision 24945)
+++ kernel/pdf/list.php	(working copy)
@@ -30,7 +30,7 @@
 
 $Module = $Params['Module'];
 
-require_once( 'kernel/common/template.php' );
+
 // Create new PDF Export
 if ( $Module->isCurrentAction( 'NewExport' ) )
 {
@@ -64,7 +64,7 @@
     $exportList[$export->attribute( 'id' )] = $export;
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'pdfexport_list', $exportList );
 
Index: kernel/role/assign.php
===================================================================
--- kernel/role/assign.php	(revision 24945)
+++ kernel/role/assign.php	(working copy)
@@ -103,9 +103,9 @@
 
         case 'section':
         {
-            require_once( 'kernel/common/template.php' );
+            
             $sectionArray = eZSection::fetchList( );
-            $tpl = templateInit();
+            $tpl = eZTemplate::instanceInit();
             $tpl->setVariable( 'section_array', $sectionArray );
             $tpl->setVariable( 'role_id', $roleID );
             $tpl->setVariable( 'limit_ident', $limitIdent );
Index: kernel/role/edit.php
===================================================================
--- kernel/role/edit.php	(revision 24945)
+++ kernel/role/edit.php	(working copy)
@@ -29,9 +29,9 @@
 /*! \file
 */
 
-require_once( 'kernel/common/template.php' );
 
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $Module = $Params['Module'];
 $roleID = $Params['RoleID'];
 
Index: kernel/role/list.php
===================================================================
--- kernel/role/list.php	(revision 24945)
+++ kernel/role/list.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 $http = eZHTTPTool::instance();
 
 
@@ -92,7 +92,7 @@
 }
 
 $viewParameters = array( 'offset' => $offset );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $roles = eZRole::fetchByOffset( $offset, $limit, $asObject = true, $ignoreTemp = true );
 $roleCount = eZRole::roleCount();
Index: kernel/role/policyedit.php
===================================================================
--- kernel/role/policyedit.php	(revision 24945)
+++ kernel/role/policyedit.php	(working copy)
@@ -32,7 +32,7 @@
 */
 
 
-require_once( "kernel/common/template.php" );
+
 $Module = $Params['Module'];
 $policyID = $Params["PolicyID"];
 
@@ -357,7 +357,7 @@
 }
 
 $Module->setTitle( "Edit policy" );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( "Module", $Module );
 $tpl->setVariable( "current_function", $currentFunction );
 $tpl->setVariable( "role_id", $roleID );
Index: kernel/role/view.php
===================================================================
--- kernel/role/view.php	(revision 24945)
+++ kernel/role/view.php	(working copy)
@@ -29,7 +29,7 @@
 /*! \file
 */
 
-require_once( 'kernel/common/template.php' );
+
 
 $http = eZHTTPTool::instance();
 $Module = $Params['Module'];
@@ -117,7 +117,7 @@
     $db->commit();
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $userArray = $role->fetchUserByRole();
 
Index: kernel/rss/edit_export.php
===================================================================
--- kernel/rss/edit_export.php	(revision 24945)
+++ kernel/rss/edit_export.php	(working copy)
@@ -30,7 +30,7 @@
 
 $Module = $Params['Module'];
 
-require_once( 'kernel/common/template.php' );
+
 $http = eZHTTPTool::instance();
 
 $valid = true;
@@ -142,7 +142,7 @@
              $rssExport->attribute( 'modified' ) + $timeOut > time() )
         {
             // locked editing
-            $tpl = templateInit();
+            $tpl = eZTemplate::instanceInit();
 
             $tpl->setVariable( 'rss_export', $rssExport );
             $tpl->setVariable( 'rss_export_id', $rssExportID );
@@ -233,7 +233,7 @@
     $db->commit();
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $config = eZINI::instance( 'site.ini' );
 
 $rssVersionArray = $config->variable( 'RSSSettings', 'AvailableVersionList' );
Index: kernel/rss/edit_import.php
===================================================================
--- kernel/rss/edit_import.php	(revision 24945)
+++ kernel/rss/edit_import.php	(working copy)
@@ -30,7 +30,7 @@
 
 $Module = $Params['Module'];
 
-require_once( "kernel/common/template.php" );
+
 $http = eZHTTPTool::instance();
 
 //Get RSSImport id if it is accessable
@@ -147,7 +147,7 @@
     }
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 // Get classes and class attributes
 $classArray = eZContentClass::fetchList();
@@ -228,7 +228,7 @@
          $rssImport->attribute( 'modified' ) + $timeOut > time() )
     {
         // locked editing
-        $tpl = templateInit();
+        $tpl = eZTemplate::instanceInit();
 
         $tpl->setVariable( 'rss_import', $rssImport );
         $tpl->setVariable( 'rss_import_id', $rssImportID );
Index: kernel/rss/list.php
===================================================================
--- kernel/rss/list.php	(revision 24945)
+++ kernel/rss/list.php	(working copy)
@@ -30,7 +30,7 @@
 
 $Module = $Params['Module'];
 
-require_once( "kernel/common/template.php" );
+
 $http = eZHTTPTool::instance();
 
 if ( $http->hasPostVariable( 'NewExportButton' ) )
@@ -93,7 +93,7 @@
     $importList[$import->attribute( 'id' )] = $import;
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'rssexport_list', $exportList );
 $tpl->setVariable( 'rssimport_list', $importList );
Index: kernel/search/stats.php
===================================================================
--- kernel/search/stats.php	(revision 24945)
+++ kernel/search/stats.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 if ( eZPreferences::value( 'admin_search_stats_limit' ) )
 {
     switch ( eZPreferences::value( 'admin_search_stats_limit' ) )
@@ -56,7 +56,7 @@
 }
 
 $viewParameters = array( 'offset' => $offset, 'limit'  => $limit );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $db = eZDB::instance();
 $query = "SELECT count(*) as count FROM ezsearch_search_phrase";
Index: kernel/section/assign.php
===================================================================
--- kernel/section/assign.php	(revision 24945)
+++ kernel/section/assign.php	(working copy)
@@ -93,8 +93,8 @@
                     }
                     if ( count( $deniedNodeIDList ) > 0 )
                     {
-                        require_once( 'kernel/common/template.php' );
-                        $tpl = templateInit();
+                        
+                        $tpl = eZTemplate::instanceInit();
                         $tpl->setVariable( 'section_name', $section->attribute( 'name' ) );
                         $tpl->setVariable( 'error_number', 1 );
                         $deniedNodes = eZContentObjectTreeNode::fetch( $deniedNodeIDList );
@@ -132,8 +132,8 @@
                 }
                 else
                 {
-                    require_once( 'kernel/common/template.php' );
-                    $tpl = templateInit();
+                    
+                    $tpl = eZTemplate::instanceInit();
                     $tpl->setVariable( 'section_name', $section->attribute( 'name' ) );
                     $tpl->setVariable( 'error_number', 2 );
                     $Result = array();
@@ -148,8 +148,8 @@
         }
         else
         {
-            require_once( 'kernel/common/template.php' );
-            $tpl = templateInit();
+            
+            $tpl = eZTemplate::instanceInit();
             $tpl->setVariable( 'section_name', $section->attribute( 'name' ) );
             $tpl->setVariable( 'error_number', 3 );
             $Result = array();
Index: kernel/section/edit.php
===================================================================
--- kernel/section/edit.php	(revision 24945)
+++ kernel/section/edit.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 
 $http = eZHTTPTool::instance();
 $SectionID = $Params["SectionID"];
@@ -68,7 +68,7 @@
     $Module->redirectTo( $Module->functionURI( 'list' ) );
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( "section", $section );
 
Index: kernel/section/list.php
===================================================================
--- kernel/section/list.php	(revision 24945)
+++ kernel/section/list.php	(working copy)
@@ -26,10 +26,10 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 $http = eZHTTPTool::instance();
 $Module = $Params['Module'];
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( 'module', $Module );
 
 $offset = $Params['Offset'];
Index: kernel/section/view.php
===================================================================
--- kernel/section/view.php	(revision 24945)
+++ kernel/section/view.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 
 $http = eZHTTPTool::instance();
 $SectionID = $Params["SectionID"];
@@ -41,7 +41,7 @@
     return $Module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( "view_parameters", $viewParameters );
 $tpl->setVariable( "section", $section );
Index: kernel/settings/edit.php
===================================================================
--- kernel/settings/edit.php	(revision 24945)
+++ kernel/settings/edit.php	(working copy)
@@ -25,14 +25,14 @@
 //
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
-require_once( "kernel/common/template.php" );
+
 $settingTypeArray = array( 'array' => 'Array',
                            'true/false' => 'True/False',
                            'enable/disable' => 'Enabled/Disabled',
                            'string' => 'String',
                            'numeric' => 'Numeric' );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $http = eZHTTPTool::instance();
 //$ini = eZINI::instance();
 
Index: kernel/settings/view.php
===================================================================
--- kernel/settings/view.php	(revision 24945)
+++ kernel/settings/view.php	(working copy)
@@ -26,9 +26,9 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
 
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $http = eZHTTPTool::instance();
 $ini = eZINI::instance();
 $siteAccessList = $ini->variable( 'SiteAccessSettings', 'RelatedSiteAccessList' );
Index: kernel/setup/cache.php
===================================================================
--- kernel/setup/cache.php	(revision 24945)
+++ kernel/setup/cache.php	(working copy)
@@ -29,9 +29,9 @@
 $http = eZHTTPTool::instance();
 $module = $Params['Module'];
 
-require_once( "kernel/common/template.php" );
+
 $ini = eZINI::instance( );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $cacheList = eZCache::fetchList();
 
Index: kernel/setup/datatype.php
===================================================================
--- kernel/setup/datatype.php	(revision 24945)
+++ kernel/setup/datatype.php	(working copy)
@@ -28,9 +28,9 @@
 
 $module = $Params['Module'];
 
-require_once( "kernel/common/template.php" );
+
 $ini = eZINI::instance();
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $steps = array( 'basic' => array( 'template' => 'datatype_basic.tpl',
                                   'function' => 'datatypeBasic' ),
Index: kernel/setup/extensions.php
===================================================================
--- kernel/setup/extensions.php	(revision 24945)
+++ kernel/setup/extensions.php	(working copy)
@@ -31,8 +31,8 @@
 $http = eZHTTPTool::instance();
 $module = $Params['Module'];
 
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $extensionDir = eZExtension::baseDirectory();
 $availableExtensionArray = eZDir::findSubItems( $extensionDir, 'dl' );
Index: kernel/setup/info.php
===================================================================
--- kernel/setup/info.php	(revision 24945)
+++ kernel/setup/info.php	(working copy)
@@ -35,10 +35,10 @@
     eZExecution::cleanExit();
 }
 
-require_once( "kernel/common/template.php" );
+
 $http = eZHTTPTool::instance();
 $ini = eZINI::instance();
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $db = eZDB::instance();
 
 try
Index: kernel/setup/rad.php
===================================================================
--- kernel/setup/rad.php	(revision 24945)
+++ kernel/setup/rad.php	(working copy)
@@ -28,9 +28,9 @@
 
 $module = $Params['Module'];
 
-require_once( "kernel/common/template.php" );
+
 $ini = eZINI::instance();
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $Result = array();
 $Result['content'] = $tpl->fetch( "design:setup/rad.tpl" );
Index: kernel/setup/session.php
===================================================================
--- kernel/setup/session.php	(revision 24945)
+++ kernel/setup/session.php	(working copy)
@@ -25,9 +25,9 @@
 //
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
-require_once( 'kernel/common/template.php' );
 
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $sessionsRemoved = false;
 $gcSessionsCompleted = true;
 $http = eZHTTPTool::instance();
Index: kernel/setup/setupmenu.php
===================================================================
--- kernel/setup/setupmenu.php	(revision 24945)
+++ kernel/setup/setupmenu.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 
 $Module = $Params['Module'];
 
@@ -35,7 +35,7 @@
 $contentIni = eZINI::instance( 'content.ini' );
 
 $Module->setTitle( eZi18n::translate( 'kernel/setup', 'Setup menu' ) );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $Result = array();
 $Result['content'] = $tpl->fetch( 'design:setup/setupmenu.tpl' );
Index: kernel/setup/systemupgrade.php
===================================================================
--- kernel/setup/systemupgrade.php	(revision 24945)
+++ kernel/setup/systemupgrade.php	(working copy)
@@ -28,10 +28,10 @@
 
 $Module = $Params['Module'];
 
-require_once( "kernel/common/template.php" );
+
 define( 'MD5_SUM_LIST_FILE', 'share/filelist.md5' );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'md5_result', false );
 $tpl->setVariable( 'upgrade_sql', false );
Index: kernel/setup/templateoperator.php
===================================================================
--- kernel/setup/templateoperator.php	(revision 24945)
+++ kernel/setup/templateoperator.php	(working copy)
@@ -28,9 +28,9 @@
 
 $module = $Params['Module'];
 
-require_once( "kernel/common/template.php" );
+
 $ini = eZINI::instance();
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 /*
 - Name
Index: kernel/setup/steps/ezstep_registration.php
===================================================================
--- kernel/setup/steps/ezstep_registration.php	(revision 24945)
+++ kernel/setup/steps/ezstep_registration.php	(working copy)
@@ -150,8 +150,9 @@
             return true;
         }
 
-        require_once( 'kernel/common/template.php' );
-        $mailTpl = templateInit( 'email' );
+        
+        $mailTpl = eZTemplate::instanceInit();
+        $mailTpl->resetVariables();
         $comments = false;
         if ( $this->Http->hasPostVariable( 'eZSetupRegistrationComment' ) )
         {
@@ -187,8 +188,9 @@
             {
                 if ( $this->PersistenceList['email_info']['send'] )
                 {
-                    require_once( 'kernel/common/template.php' );
-                    $mailTpl = templateInit( 'email' );
+                    
+                    $mailTpl = eZTemplate::instanceInit();
+                    $mailTpl->resetVariables();
                     $bodyText = $this->generateRegistration( $mailTpl, $comments );
                     $subject = $mailTpl->variable( 'subject' );
 
@@ -219,9 +221,10 @@
 
     function display()
     {
-        require_once( 'kernel/common/template.php' );
+        
 
-        $mailTpl  = templateInit( 'email' );
+        $mailTpl = eZTemplate::instanceInit();
+        $mailTpl->resetVariables();
 
         $bodyText = $this->generateRegistration( $mailTpl, false );
         $send     = ( isset( $this->PersistenceList['email_info']['send'] ) )     ? $this->PersistenceList['email_info']['send'] : true;
Index: kernel/shop/archivelist.php
===================================================================
--- kernel/shop/archivelist.php	(revision 24945)
+++ kernel/shop/archivelist.php	(working copy)
@@ -26,10 +26,10 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 $module = $Params['Module'];
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $offset = $Params['Offset'];
 $limit = 50;
Index: kernel/shop/archiveorder.php
===================================================================
--- kernel/shop/archiveorder.php	(revision 24945)
+++ kernel/shop/archiveorder.php	(working copy)
@@ -31,7 +31,7 @@
 /*! \file
 */
 
-require_once( "kernel/common/template.php" );
+
 $Module = $Params['Module'];
 $http = eZHTTPTool::instance();
 $archiveIDArray = $http->sessionVariable( "OrderIDArray" );
Index: kernel/shop/basket.php
===================================================================
--- kernel/shop/basket.php	(revision 24945)
+++ kernel/shop/basket.php	(working copy)
@@ -29,7 +29,7 @@
 $http = eZHTTPTool::instance();
 $module = $Params['Module'];
 
-require_once( "kernel/common/template.php" );
+
 $basket = eZBasket::currentBasket();
 $basket->updatePrices(); // Update the prices. Transaction not necessary.
 
@@ -308,7 +308,7 @@
 }
 $basket = eZBasket::currentBasket();
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 if ( isset( $Params['Error'] ) )
 {
     $tpl->setVariable( 'error', $Params['Error'] );
Index: kernel/shop/checkout.php
===================================================================
--- kernel/shop/checkout.php	(revision 24945)
+++ kernel/shop/checkout.php	(working copy)
@@ -99,8 +99,8 @@
                 case eZModuleOperationInfo::STATUS_CANCELLED:
                 {
                     $Result = array();
-                    require_once( "kernel/common/template.php" );
-                    $tpl = templateInit();
+                    
+                    $tpl = eZTemplate::instanceInit();
 
                     $tpl->setVariable( 'operation_result', $operationResult );
 
@@ -136,8 +136,8 @@
                 if ( $attempt < 4)
                 {
                     $Result = array();
-                    require_once( "kernel/common/template.php" );
-                    $tpl = templateInit();
+                    
+                    $tpl = eZTemplate::instanceInit();
                     $tpl->setVariable( 'attempt', $attempt );
                     $tpl->setVariable( 'orderID', $orderID );
                     $Result['content'] = $tpl->fetch( "design:shop/checkoutagain.tpl" ) ;
@@ -151,8 +151,8 @@
                     $http->removeSessionVariable( "CheckoutAttempt" );
 
                     $Result = array();
-                    require_once( "kernel/common/template.php" );
-                    $tpl = templateInit();
+                    
+                    $tpl = eZTemplate::instanceInit();
                     $tpl->setVariable ("ErrorCode", "NO_CALLBACK");
                     $tpl->setVariable ("OrderID", $orderID);
 
Index: kernel/shop/confirmorder.php
===================================================================
--- kernel/shop/confirmorder.php	(revision 24945)
+++ kernel/shop/confirmorder.php	(working copy)
@@ -29,8 +29,8 @@
 $http = eZHTTPTool::instance();
 $module = $Params['Module'];
 
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( "module_name", 'shop' );
 
 $orderID = $http->sessionVariable( 'MyTemporaryOrderID' );
Index: kernel/shop/currencylist.php
===================================================================
--- kernel/shop/currencylist.php	(revision 24945)
+++ kernel/shop/currencylist.php	(working copy)
@@ -29,7 +29,7 @@
 /*! \file
 */
 
-require_once( 'kernel/common/template.php' );
+
 $module = $Params['Module'];
 $offset = $Params['Offset'];
 
@@ -119,7 +119,7 @@
 
 $viewParameters = array( 'offset' => $offset );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'currency_list', $currencyList );
 $tpl->setVariable( 'currency_list_count', $currencyCount );
Index: kernel/shop/customerlist.php
===================================================================
--- kernel/shop/customerlist.php	(revision 24945)
+++ kernel/shop/customerlist.php	(working copy)
@@ -31,14 +31,14 @@
 /*! \file
 */
 
-require_once( "kernel/common/template.php" );
+
 
 $module = $Params["Module"];
 
 $offset = $Params['Offset'];
 $limit = 15;
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $http = eZHTTPTool::instance();
 
Index: kernel/shop/customerorderview.php
===================================================================
--- kernel/shop/customerorderview.php	(revision 24945)
+++ kernel/shop/customerorderview.php	(working copy)
@@ -34,11 +34,11 @@
 $CustomerID = $Params['CustomerID'];
 $Email = $Params['Email'];
 $module = $Params['Module'];
-require_once( "kernel/common/template.php" );
+
 
 $http = eZHTTPTool::instance();
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $Email = urldecode( $Email );
 $productList = eZOrder::productList( $CustomerID, $Email );
Index: kernel/shop/discountgroup.php
===================================================================
--- kernel/shop/discountgroup.php	(revision 24945)
+++ kernel/shop/discountgroup.php	(working copy)
@@ -28,7 +28,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 $module = $Params['Module'];
 
 $http = eZHTTPTool::instance();
@@ -67,7 +67,7 @@
     return;
 }
 $module->setTitle( "View discount group" );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( "discountgroup_array", $discountGroupArray );
 $tpl->setVariable( "module", $module );
 
Index: kernel/shop/discountgroupedit.php
===================================================================
--- kernel/shop/discountgroupedit.php	(revision 24945)
+++ kernel/shop/discountgroupedit.php	(working copy)
@@ -28,7 +28,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 $module = $Params['Module'];
 $discountGroupID = null;
 if ( isset( $Params["DiscountGroupID"] ) )
@@ -63,7 +63,7 @@
 }
 
 $module->setTitle( "Editing discount group" );
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( "module", $module );
 $tpl->setVariable( "discount_group", $discountGroup );
 
Index: kernel/shop/discountgroupmembershipview.php
===================================================================
--- kernel/shop/discountgroupmembershipview.php	(revision 24945)
+++ kernel/shop/discountgroupmembershipview.php	(working copy)
@@ -28,7 +28,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 $module = $Params['Module'];
 $discountGroupID = null;
 if ( isset( $Params["DiscountGroupID"] ) )
@@ -229,7 +229,7 @@
                    "limitation" => $limitation );
     $ruleArray[] = $item;
 }
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( "module", $module );
 $tpl->setVariable( "customers", $customers );
 $tpl->setVariable( "discountgroup", $discountGroup );
Index: kernel/shop/discountruleedit.php
===================================================================
--- kernel/shop/discountruleedit.php	(revision 24945)
+++ kernel/shop/discountruleedit.php	(working copy)
@@ -29,7 +29,7 @@
 // TODO: it was not in the original code, but we may consider to add support for "folder with products",
 //       not only products (i.e. objects with attribute of the ezprice datatype).
 
-require_once( 'kernel/common/template.php' );
+
 $module = $Params['Module'];
 
 if ( !isset( $Params['DiscountGroupID'] ) )
@@ -279,7 +279,7 @@
 
 $sectionList = eZSection::fetchList();
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'module', $module );
 $tpl->setVariable( 'discountgroup_id', $discountGroupID );
Index: kernel/shop/editcurrency.php
===================================================================
--- kernel/shop/editcurrency.php	(revision 24945)
+++ kernel/shop/editcurrency.php	(working copy)
@@ -140,8 +140,8 @@
     $pathText = eZi18n::translate( 'kernel/shop', 'Create new currency' );
 }
 
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'error', $error );
 $tpl->setVariable( 'can_edit', $canEdit );
Index: kernel/shop/editvatrule.php
===================================================================
--- kernel/shop/editvatrule.php	(revision 24945)
+++ kernel/shop/editvatrule.php	(working copy)
@@ -219,8 +219,8 @@
 
 $vatTypes = eZVatType::fetchList( true, true );
 
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'error_header', $errorHeader );
 $tpl->setVariable( 'errors', $errors );
Index: kernel/shop/ezshopoperationcollection.php
===================================================================
--- kernel/shop/ezshopoperationcollection.php	(revision 24945)
+++ kernel/shop/ezshopoperationcollection.php	(working copy)
@@ -97,8 +97,8 @@
                            'You can either fill country manually in your account information (if you are a registered user) ' .
                            'or contact site administrator.' );
 
-            require_once( "kernel/common/template.php" );
-            $tpl = templateInit();
+            
+            $tpl = eZTemplate::instanceInit();
             $tpl->setVariable( "error_header",  $header );
             $tpl->setVariable( "error_list", array( $msg ) );
 
Index: kernel/shop/orderlist.php
===================================================================
--- kernel/shop/orderlist.php	(revision 24945)
+++ kernel/shop/orderlist.php	(working copy)
@@ -26,10 +26,10 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 $module = $Params['Module'];
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $offset = $Params['Offset'];
 $limit = 15;
Index: kernel/shop/orderstatistics.php
===================================================================
--- kernel/shop/orderstatistics.php	(revision 24945)
+++ kernel/shop/orderstatistics.php	(working copy)
@@ -31,7 +31,7 @@
 */
 
 
-require_once( "kernel/common/template.php" );
+
 $module = $Params['Module'];
 $year = $Params['Year'];
 $month = $Params['Month'];
@@ -68,7 +68,7 @@
     $monthList[] = array( 'value' => $monthIndex, 'name' => $locale->longMonthName( $monthIndex ) );
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( "year", $year );
 $tpl->setVariable( "month", $month );
 $tpl->setVariable( "year_list", $yearList );
Index: kernel/shop/orderview.php
===================================================================
--- kernel/shop/orderview.php	(revision 24945)
+++ kernel/shop/orderview.php	(working copy)
@@ -28,7 +28,7 @@
 
 $OrderID = $Params['OrderID'];
 $module = $Params['Module'];
-require_once( "kernel/common/template.php" );
+
 
 $ini = eZINI::instance();
 $http = eZHTTPTool::instance();
@@ -79,7 +79,7 @@
 {
      return $module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
 }
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 
 $tpl->setVariable( "order", $order );
Index: kernel/shop/preferredcurrency.php
===================================================================
--- kernel/shop/preferredcurrency.php	(revision 24945)
+++ kernel/shop/preferredcurrency.php	(working copy)
@@ -29,8 +29,8 @@
 /*! \file
 */
 
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $Result = array();
 $Result['path'] = array( array( 'text' => eZi18n::translate( 'kernel/shop', 'Preferred currency' ),
Index: kernel/shop/productcategories.php
===================================================================
--- kernel/shop/productcategories.php	(revision 24945)
+++ kernel/shop/productcategories.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 /*!
   Apply changes made to categories' names.
 
@@ -91,7 +91,7 @@
 
 $module = $Params['Module'];
 $http   = eZHTTPTool::instance();
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $errors = false;
 
 // Remove checked categories.
Index: kernel/shop/productsoverview.php
===================================================================
--- kernel/shop/productsoverview.php	(revision 24945)
+++ kernel/shop/productsoverview.php	(working copy)
@@ -29,7 +29,7 @@
 /*! \file
 */
 
-require_once( 'kernel/common/template.php' );
+
 $module = $Params['Module'];
 $offset = $Params['Offset'];
 $productClassIdentifier = $Params['ProductClass'];
@@ -87,7 +87,7 @@
 
 $viewParameters = array( 'offset' => $offset );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( 'product_class_list', $productClassList );
 $tpl->setVariable( 'product_class', $productClass );
 $tpl->setVariable( 'price_attribute_identifier', $priceAttributeIdentifier );
Index: kernel/shop/register.php
===================================================================
--- kernel/shop/register.php	(revision 24945)
+++ kernel/shop/register.php	(working copy)
@@ -29,8 +29,8 @@
 $http = eZHTTPTool::instance();
 $module = $Params['Module'];
 
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 if ( $module->isCurrentAction( 'Cancel' ) )
 {
Index: kernel/shop/removeorder.php
===================================================================
--- kernel/shop/removeorder.php	(revision 24945)
+++ kernel/shop/removeorder.php	(working copy)
@@ -31,7 +31,7 @@
 /*! \file
 */
 
-require_once( "kernel/common/template.php" );
+
 $Module = $Params['Module'];
 $http = eZHTTPTool::instance();
 $deleteIDArray = $http->sessionVariable( "DeleteOrderIDArray" );
@@ -66,7 +66,7 @@
 
     $Module->setTitle( eZi18n::translate( 'shop', 'Remove orders' ) );
 
-    $tpl = templateInit();
+    $tpl = eZTemplate::instanceInit();
     $tpl->setVariable( "module", $Module );
     $tpl->setVariable( "delete_result", $orderNumbersString );
     $Result = array();
Index: kernel/shop/setstatus.php
===================================================================
--- kernel/shop/setstatus.php	(revision 24945)
+++ kernel/shop/setstatus.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 $module = $Params['Module'];
 $http = eZHTTPTool::instance();
 $user = eZUser::currentUser();
Index: kernel/shop/status.php
===================================================================
--- kernel/shop/status.php	(revision 24945)
+++ kernel/shop/status.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 $module = $Params['Module'];
 $http = eZHTTPTool::instance();
 $messages = array();
@@ -94,7 +94,7 @@
 
 $orderStatusArray = eZOrderStatus::fetchList( true, true );
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( "orderstatus_array", $orderStatusArray );
 $tpl->setVariable( "module", $module );
 $tpl->setVariable( "messages", $messages );
Index: kernel/shop/unarchiveorder.php
===================================================================
--- kernel/shop/unarchiveorder.php	(revision 24945)
+++ kernel/shop/unarchiveorder.php	(working copy)
@@ -31,7 +31,7 @@
 /*! \file
 */
 
-require_once( "kernel/common/template.php" );
+
 $Module = $Params['Module'];
 $http = eZHTTPTool::instance();
 $orderIDArray = $http->sessionVariable( "OrderIDArray" );
Index: kernel/shop/userregister.php
===================================================================
--- kernel/shop/userregister.php	(revision 24945)
+++ kernel/shop/userregister.php	(working copy)
@@ -29,8 +29,8 @@
 $http = eZHTTPTool::instance();
 $module = $Params['Module'];
 
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 if ( $module->isCurrentAction( 'Cancel' ) )
 {
Index: kernel/shop/vatrules.php
===================================================================
--- kernel/shop/vatrules.php	(revision 24945)
+++ kernel/shop/vatrules.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 /**
  * Find errors in VAT charging rules.
  *
@@ -162,7 +162,7 @@
 
 $module = $Params['Module'];
 $http   = eZHTTPTool::instance();
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 if ( $http->hasPostVariable( "AddRuleButton" ) )
 {
Index: kernel/shop/vattype.php
===================================================================
--- kernel/shop/vattype.php	(revision 24945)
+++ kernel/shop/vattype.php	(working copy)
@@ -28,10 +28,10 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 $module = $Params['Module'];
 $http = eZHTTPTool::instance();
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $errors = false;
 
 /*!
Index: kernel/shop/wishlist.php
===================================================================
--- kernel/shop/wishlist.php	(revision 24945)
+++ kernel/shop/wishlist.php	(working copy)
@@ -240,9 +240,9 @@
         return;
     }
 }
-require_once( "kernel/common/template.php" );
 
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $wishList = eZWishList::currentWishList();
 
Index: kernel/state/assign.php
===================================================================
--- kernel/state/assign.php	(revision 24945)
+++ kernel/state/assign.php	(working copy)
@@ -67,8 +67,8 @@
     // '/state/assign/<object_id>'
     if ( ( $object = eZContentObject::fetch( $objectID ) ) !== null  )
     {
-        require_once( 'kernel/common/template.php' );
-        $tpl = templateInit();
+        
+        $tpl = eZTemplate::instanceInit();
         $tpl->setVariable( 'node', $object->attribute( 'main_node' ) );
         $Result['content'] = $tpl->fetch( 'design:state/assign.tpl' );
     }
Index: kernel/state/edit.php
===================================================================
--- kernel/state/edit.php	(revision 24945)
+++ kernel/state/edit.php	(working copy)
@@ -49,9 +49,9 @@
 }
 
 $redirectUrl = "state/group/$GroupIdentifier";
-require_once( 'kernel/common/template.php' );
 
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $currentAction = $Module->currentAction();
 
Index: kernel/state/group.php
===================================================================
--- kernel/state/group.php	(revision 24945)
+++ kernel/state/group.php	(working copy)
@@ -36,9 +36,9 @@
     return $Module->handleError( eZError::KERNEL_NOT_FOUND, 'kernel' );
 }
 
-require_once 'kernel/common/template.php';
 
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $currentAction = $Module->currentAction();
 
Index: kernel/state/group_edit.php
===================================================================
--- kernel/state/group_edit.php	(revision 24945)
+++ kernel/state/group_edit.php	(working copy)
@@ -40,9 +40,9 @@
     return $Module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
 }
 
-require_once( 'kernel/common/template.php' );
 
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $currentAction = $Module->currentAction();
 
Index: kernel/state/groups.php
===================================================================
--- kernel/state/groups.php	(revision 24945)
+++ kernel/state/groups.php	(working copy)
@@ -40,9 +40,9 @@
 
 $languages = eZContentLanguage::fetchList();
 
-require_once( 'kernel/common/template.php' );
 
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 eZDebug::writeDebug( $Module->currentAction() );
 if ( $Module->isCurrentAction( 'Remove' ) && $Module->hasActionParameter( 'RemoveIDList' ) )
Index: kernel/state/view.php
===================================================================
--- kernel/state/view.php	(revision 24945)
+++ kernel/state/view.php	(working copy)
@@ -56,9 +56,9 @@
     $state->setCurrentLanguage( $LanguageCode );
 }
 
-require_once 'kernel/common/template.php';
 
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( 'group', $group );
 $tpl->setVariable( 'state', $state );
 
Index: kernel/trigger/list.php
===================================================================
--- kernel/trigger/list.php	(revision 24945)
+++ kernel/trigger/list.php	(working copy)
@@ -36,7 +36,7 @@
     return $triggerArray;
 }
 
-require_once( 'kernel/common/template.php' );
+
 $http = eZHTTPTool::instance();
 
 $Module = $Params['Module'];
@@ -168,7 +168,7 @@
 }
 
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $triggers = eZTrigger::fetchList( array(
                                        'module' => $moduleName,
Index: kernel/url/edit.php
===================================================================
--- kernel/url/edit.php	(revision 24945)
+++ kernel/url/edit.php	(working copy)
@@ -69,8 +69,8 @@
 $Module->setTitle( "Edit link " . $url->attribute( "id" ) );
 
 // Template handling
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( "Module", $Module );
 $tpl->setVariable( "url", $url );
Index: kernel/url/list.php
===================================================================
--- kernel/url/list.php	(revision 24945)
+++ kernel/url/list.php	(working copy)
@@ -101,8 +101,8 @@
 
 $viewParameters = array( 'offset' => $offset, 'limit'  => $limit );
 
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'view_parameters', $viewParameters );
 $tpl->setVariable( 'url_list', $list );
Index: kernel/url/view.php
===================================================================
--- kernel/url/view.php	(revision 24945)
+++ kernel/url/view.php	(working copy)
@@ -107,8 +107,8 @@
     }
 }
 
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'Module', $Module );
 $tpl->setVariable( 'url_object', $url );
Index: kernel/user/activate.php
===================================================================
--- kernel/user/activate.php	(revision 24945)
+++ kernel/user/activate.php	(working copy)
@@ -97,8 +97,8 @@
 }
 
 // Template handling
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'module', $Module );
 $tpl->setVariable( 'account_activated', $accountActivated );
Index: kernel/user/edit.php
===================================================================
--- kernel/user/edit.php	(revision 24945)
+++ kernel/user/edit.php	(working copy)
@@ -93,8 +93,8 @@
     return $Module->handleError( eZError::KERNEL_ACCESS_DENIED, 'kernel' );
 }
 
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( "module", $Module );
 $tpl->setVariable( "http", $http );
 $tpl->setVariable( "userID", $UserID );
Index: kernel/user/forgotpassword.php
===================================================================
--- kernel/user/forgotpassword.php	(revision 24945)
+++ kernel/user/forgotpassword.php	(working copy)
@@ -30,8 +30,8 @@
 */
 
 
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( 'generated', false );
 $tpl->setVariable( 'wrong_email', false );
 $tpl->setVariable( 'link', false );
@@ -72,13 +72,13 @@
             eZUserOperationCollection::password( $userID, $newPassword );
         }
 
-        require_once( "kernel/common/template.php" );
+        
         $receiver = $email;
         $mail = new eZMail();
         if ( !$mail->validate( $receiver ) )
         {
         }
-        $tpl = templateInit();
+        $tpl = eZTemplate::instanceInit();
 
         $tpl->setVariable( 'user', $userToSendEmail );
         $tpl->setVariable( 'object', $userToSendEmail->attribute( 'contentobject' ) );
@@ -155,14 +155,14 @@
             }
 
             $userToSendEmail = $user;
-            require_once( "kernel/common/template.php" );
+            
             $receiver = $email;
 
             $mail = new eZMail();
             if ( !$mail->validate( $receiver ) )
             {
             }
-            $tpl = templateInit();
+            $tpl = eZTemplate::instanceInit();
             $tpl->setVariable( 'user', $userToSendEmail );
             $tpl->setVariable( 'object', $userToSendEmail->attribute( 'contentobject' ) );
             $tpl->setVariable( 'password', $password );
Index: kernel/user/login.php
===================================================================
--- kernel/user/login.php	(revision 24945)
+++ kernel/user/login.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( 'kernel/common/template.php' );
+
 //$Module->setExitStatus( EZ_MODULE_STATUS_SHOW_LOGIN_PAGE );
 
 $Module = $Params['Module'];
@@ -306,7 +306,7 @@
         $userIsNotAllowedToLogin = true;
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'login', $userLogin, 'User' );
 $tpl->setVariable( 'post_data', $postData, 'User' );
Index: kernel/user/password.php
===================================================================
--- kernel/user/password.php	(revision 24945)
+++ kernel/user/password.php	(working copy)
@@ -145,8 +145,8 @@
 
 $Module->setTitle( "Edit user information" );
 // Template handling
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( "module", $Module );
 $tpl->setVariable( "http", $http );
 $tpl->setVariable( "userID", $UserID );
Index: kernel/user/register.php
===================================================================
--- kernel/user/register.php	(revision 24945)
+++ kernel/user/register.php	(working copy)
@@ -44,8 +44,8 @@
 $Params['TemplateName'] = "design:user/register.tpl";
 $EditVersion = 1;
 
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( 'view_parameters', $viewParameters );
 
 $Params['TemplateObject'] = $tpl;
@@ -210,9 +210,9 @@
             if ( !$mail->validate( $receiver ) )
             {
             }
-            require_once( "kernel/common/template.php" );
+            
             $ini = eZINI::instance();
-            $tpl = templateInit();
+            $tpl = eZTemplate::instanceInit();
             $tpl->setVariable( 'user', $user );
             $tpl->setVariable( 'object', $object );
             $hostname = eZSys::hostname();
Index: kernel/user/setting.php
===================================================================
--- kernel/user/setting.php	(revision 24945)
+++ kernel/user/setting.php	(working copy)
@@ -89,8 +89,8 @@
 
 $Module->setTitle( "Edit user settings" );
 // Template handling
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( "module", $Module );
 $tpl->setVariable( "http", $http );
 $tpl->setVariable( "userID", $UserID );
Index: kernel/user/success.php
===================================================================
--- kernel/user/success.php	(revision 24945)
+++ kernel/user/success.php	(working copy)
@@ -28,8 +28,8 @@
 $Module = $Params['Module'];
 $Module->setTitle( "Successful registration" );
 // Template handling
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( "module", $Module );
 $ini = eZINI::instance();
 $verifyUserEmail = $ini->variable( 'UserSettings', 'VerifyUserEmail' );
Index: kernel/visual/menuconfig.php
===================================================================
--- kernel/visual/menuconfig.php	(revision 24945)
+++ kernel/visual/menuconfig.php	(working copy)
@@ -31,9 +31,9 @@
 $http = eZHTTPTool::instance();
 $module = $Params['Module'];
 
-require_once( "kernel/common/template.php" );
+
 $ini = eZINI::instance();
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 if ( $module->isCurrentAction( 'SelectCurrentSiteAccess' ) )
 {
Index: kernel/visual/templatecreate.php
===================================================================
--- kernel/visual/templatecreate.php	(revision 24945)
+++ kernel/visual/templatecreate.php	(working copy)
@@ -33,9 +33,9 @@
 $overrideKeys = array( 'nodeID' => $Params['NodeID'],
                        'classID' => $Params['ClassID'] );
 
-require_once( "kernel/common/template.php" );
+
 $ini = eZINI::instance();
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 // Todo: read from siteaccess settings
 $siteAccess = $Params['SiteAccess'];
Index: kernel/visual/templateedit.php
===================================================================
--- kernel/visual/templateedit.php	(revision 24945)
+++ kernel/visual/templateedit.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 $http = eZHTTPTool::instance();
 $module = $Params['Module'];
 $parameters = $Params["Parameters"];
@@ -37,7 +37,7 @@
 }
 
 $ini = eZINI::instance();
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $Result = array();
 $Result['path'] = array( array( 'url' => false,
Index: kernel/visual/templatelist.php
===================================================================
--- kernel/visual/templatelist.php	(revision 24945)
+++ kernel/visual/templatelist.php	(working copy)
@@ -44,9 +44,9 @@
         $doFiltration = true;
 }
 
-require_once( "kernel/common/template.php" );
+
 $ini = eZINI::instance();
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $siteAccess = $http->sessionVariable( 'eZTemplateAdminCurrentSiteAccess' );
 
Index: kernel/visual/templateview.php
===================================================================
--- kernel/visual/templateview.php	(revision 24945)
+++ kernel/visual/templateview.php	(working copy)
@@ -30,9 +30,9 @@
 $module = $Params['Module'];
 $parameters = $Params["Parameters"];
 
-require_once( "kernel/common/template.php" );
+
 $ini = eZINI::instance();
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $template = "";
 
Index: kernel/visual/toolbar.php
===================================================================
--- kernel/visual/toolbar.php	(revision 24945)
+++ kernel/visual/toolbar.php	(working copy)
@@ -37,7 +37,7 @@
 $currentSiteAccess = ( $Params['SiteAccess'] ) ? $Params['SiteAccess'] : false;
 $toolbarPosition = ( $Params['Position'] ) ? $Params['Position'] : false;
 
-require_once( "kernel/common/template.php" );
+
 $http = eZHTTPTool::instance();
 
 $siteini = eZINI::instance();
@@ -368,7 +368,7 @@
     $availableToolArray = $toolbarIni->variable( "Tool", "AvailableToolArray" );
 }
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'toolbar_position', $toolbarPosition );
 $tpl->setVariable( 'tool_list', $toolList );
Index: kernel/visual/toolbarlist.php
===================================================================
--- kernel/visual/toolbarlist.php	(revision 24945)
+++ kernel/visual/toolbarlist.php	(working copy)
@@ -31,7 +31,7 @@
 /*! \file
 */
 
-require_once( "kernel/common/template.php" );
+
 $http = eZHTTPTool::instance();
 
 $currentSiteAccess = false;
@@ -64,7 +64,7 @@
 {
     $toolbarArray =  $toolbarIni->variable( "Toolbar", "AvailableToolBarArray" );
 }
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'toolbar_list', $toolbarArray );
 $tpl->setVariable( 'siteaccess_list', $siteAccessList );
Index: kernel/workflow/edit.php
===================================================================
--- kernel/workflow/edit.php	(revision 24945)
+++ kernel/workflow/edit.php	(working copy)
@@ -338,8 +338,8 @@
 $Module->setTitle( eZi18n::translate( 'kernel/workflow', 'Edit workflow' ) . ' ' . $workflow->attribute( "name" ) );
 
 // Template handling
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $res = eZTemplateDesignResource::instance();
 
Index: kernel/workflow/groupedit.php
===================================================================
--- kernel/workflow/groupedit.php	(revision 24945)
+++ kernel/workflow/groupedit.php	(working copy)
@@ -96,8 +96,8 @@
                    $workflowGroup->attribute( "name" ) );
 
 // Template handling
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $res = eZTemplateDesignResource::instance();
 $res->setKeys( array( array( "workflow_group", $workflowGroup->attribute( "id" ) ) ) ); // WorkflowGroup ID
Index: kernel/workflow/grouplist.php
===================================================================
--- kernel/workflow/grouplist.php	(revision 24945)
+++ kernel/workflow/grouplist.php	(working copy)
@@ -98,8 +98,8 @@
 }
 
 $Module->setTitle( eZi18n::translate( 'kernel/workflow', 'Workflow group list' ) );
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $user = eZUser::currentUser();
 foreach( $TemplateData as $tpldata )
Index: kernel/workflow/list.php
===================================================================
--- kernel/workflow/list.php	(revision 24945)
+++ kernel/workflow/list.php	(working copy)
@@ -58,8 +58,8 @@
 
 $Module->setTitle( 'Workflow list' );
 
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( 'workflow_list', $workflowList );
 $tpl->setVariable( 'group_list', $groupList );
Index: kernel/workflow/process.php
===================================================================
--- kernel/workflow/process.php	(revision 24945)
+++ kernel/workflow/process.php	(working copy)
@@ -54,8 +54,8 @@
 }
 
 // Template handling
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $workflow = eZWorkflow::fetch( $process->attribute( "workflow_id" ) );
 $workflowEvent = false;
Index: kernel/workflow/processlist.php
===================================================================
--- kernel/workflow/processlist.php	(revision 24945)
+++ kernel/workflow/processlist.php	(working copy)
@@ -102,8 +102,8 @@
 }
 
 // Template handling
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $tpl->setVariable( "module", $Module );
 $tpl->setVariable( "trigger_list", $outList2 );
Index: kernel/workflow/run.php
===================================================================
--- kernel/workflow/run.php	(revision 24945)
+++ kernel/workflow/run.php	(working copy)
@@ -52,8 +52,8 @@
 //                       $Module->attribute( "name" ), "run" );
 
 // Template handling
-require_once( "kernel/common/template.php" );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 
 $workflow = eZWorkflow::fetch( $process->attribute( "workflow_id" ) );
 
Index: kernel/workflow/view.php
===================================================================
--- kernel/workflow/view.php	(revision 24945)
+++ kernel/workflow/view.php	(working copy)
@@ -26,7 +26,7 @@
 // ## END COPYRIGHT, LICENSE AND WARRANTY NOTICE ##
 //
 
-require_once( "kernel/common/template.php" );
+
 
 $Module = $Params['Module'];
 $http = eZHTTPTool::instance();
@@ -59,7 +59,7 @@
 
 $event_list = $workflow->fetchEvents();
 
-$tpl = templateInit();
+$tpl = eZTemplate::instanceInit();
 $res = eZTemplateDesignResource::instance();
 $res->setKeys( array( array( "workflow", $workflow->attribute( "id" ) ) ) );
 
Index: kernel/workflow/workflowlist.php
===================================================================
--- kernel/workflow/workflowlist.php	(revision 24945)
+++ kernel/workflow/workflowlist.php	(working copy)
@@ -157,8 +157,8 @@
     return $Module->handleError( eZError::KERNEL_NOT_AVAILABLE, 'kernel' );
 }
 
-require_once( 'kernel/common/template.php' );
-$tpl = templateInit();
+
+$tpl = eZTemplate::instanceInit();
 $tpl->setVariable( "temp_workflow_list", $temp_list );
 $tpl->setVariable( "group_id", $WorkflowGroupID );
 $WorkflowGroupName = $WorkflowgroupInfo->attribute("name");
Index: lib/eztemplate/classes/eztemplate.php
===================================================================
--- lib/eztemplate/classes/eztemplate.php	(revision 24945)
+++ lib/eztemplate/classes/eztemplate.php	(working copy)
@@ -2326,20 +2326,55 @@
      *
      * @return eZTemplate
      */
-    static function instance()
+    public static function instance()
     {
-        if ( !isset( $GLOBALS['eZTemplateInstance'] ) )
+        if ( self::$instance === null )
         {
-            $GLOBALS['eZTemplateInstance'] = new eZTemplate();
+            self::$instance = new eZTemplate();
         }
+        return self::$instance;
+    }
+    
+    /**
+     * Returns a shared instance of the eZTemplate class with
+     * default settings applied, like:
+     * - Autoload operators loaded
+     * - Debug mode set
+     * - eZTemplateDesignResource::instance registered
+     *
+     * @since 4.3
+     * @return eZTemplate
+     */
+    public static function instanceInit()
+    {
+        if ( self::$initInstance === null )
+        {
+            self::$initInstance = self::instance();
 
-        return $GLOBALS['eZTemplateInstance'];
+            $ini = eZINI::instance();
+            if ( $ini->variable( 'TemplateSettings', 'Debug' ) == 'enabled' )
+                eZTemplate::setIsDebugEnabled( true );
+        
+            $compatAutoLoadPath = $ini->variableArray( 'TemplateSettings', 'AutoloadPath' );
+            $autoLoadPathList = $ini->variable( 'TemplateSettings', 'AutoloadPathList' );
+        
+            $extensionAutoloadPath = $ini->variable( 'TemplateSettings', 'ExtensionAutoloadPath' );
+            $extensionPathList = eZExtension::expandedPathList( $extensionAutoloadPath, 'autoloads' );
+        
+            $autoLoadPathList = array_unique( array_merge( $compatAutoLoadPath, $autoLoadPathList, $extensionPathList ) );
+        
+            self::$initInstance->setAutoloadPathList( $autoLoadPathList );
+            self::$initInstance->autoload();
+        
+            self::$initInstance->registerResource( eZTemplateDesignResource::instance() );
+        }
+        return self::$initInstance;
     }
 
     /*!
      Returns the INI object for the template.ini file.
     */
-    function ini()
+    public function ini()
     {
         return eZINI::instance( "template.ini" );
     }
@@ -2612,6 +2647,20 @@
 
     // Flag for setting compilation in test mode
     public $TestCompile;
+    
+    /**
+     * Singelton instance of eZTemplate
+     * 
+     * @var null|eZTemplate
+     */
+    protected static $instance = null;
+
+    /**
+     * Singelton instance of eZTemplate with default settings loaded and applied
+     * 
+     * @var null|eZTemplate
+     */
+    protected static $initInstance = null;
 
 //     public $CurrentRelatedResource;
 //     public $CurrentRelatedTemplateName;
Index: tests/tests/kernel/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput_regression.php
===================================================================
--- tests/tests/kernel/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput_regression.php	(revision 24945)
+++ tests/tests/kernel/datatypes/ezxmltext/handlers/output/ezxhtmlxmloutput_regression.php	(working copy)
@@ -24,7 +24,7 @@
      */
     public function testRenderParagraph()
     {
-        require_once( 'kernel/common/template.php' );
+        
 
         $XMLString = '<?xml version="1.0" encoding="utf-8"?> <section xmlns:image="http://ez.no/namespaces/ezpublish3/image/"
                     xmlns:xhtml="http://ez.no/namespaces/ezpublish3/xhtml/"
Index: tests/tests/lib/eztemplate/eztemplatetextoperator_regression.php
===================================================================
--- tests/tests/lib/eztemplate/eztemplatetextoperator_regression.php	(revision 24945)
+++ tests/tests/lib/eztemplate/eztemplatetextoperator_regression.php	(working copy)
@@ -35,11 +35,11 @@
      */
     public function testIssue15852()
     {
-        require_once( 'kernel/common/template.php' );
+        
         
         set_error_handler( 'testErrorHandler' );
         
-        $tpl = templateInit();
+        $tpl = eZTemplate::instanceInit();
         $templateDirectory = dirname( __FILE__ ) . DIRECTORY_SEPARATOR;
         
         // Static variable test
