diff --git a/library/Unl/View/Helper/WdnTemplate.php b/library/Unl/View/Helper/WdnTemplate.php index 05c25bd2a2929e4729bc08bc3236923e639e165a..e6b510c70851a5b2bb6f4055cf0fa3344a593473 100644 --- a/library/Unl/View/Helper/WdnTemplate.php +++ b/library/Unl/View/Helper/WdnTemplate.php @@ -39,10 +39,6 @@ class Unl_View_Helper_WdnTemplate extends Zend_View_Helper_Abstract $staticBaseUrl .= $_SERVER['HTTP_HOST'] . $baseUrl . '/'; - if (!$layout->template) { - $layout->template = 'Fixed'; - } - if (!$layout->siteTitle) { $layout->siteTitle = 'Site'; } @@ -56,17 +52,32 @@ class Unl_View_Helper_WdnTemplate extends Zend_View_Helper_Abstract 'title' => $layout->siteTitle)); require_once 'UNL/Templates.php'; - Unl_Templates::$options['version'] = UNL_Templates::VERSION3; + require_once 'UNL/Templates/CachingService/Null.php'; + UNL_Templates::setCachingService(new UNL_Templates_CachingService_Null()); + UNL_Templates::$options['version'] = UNL_Templates::VERSION3x1; $config = Unl_Application::getOptions(); if (isset($config['unl']['templates']['options']) && is_array($config['unl']['templates']['options'])) { UNL_Templates::$options = array_merge(UNL_Templates::$options, $config['unl']['templates']['options']); } + + if (!$layout->template) { + if (UNL_Templates::$options['version'] == UNL_Templates::VERSION3x1) { + $layout->template = 'Local'; + } else { + $layout->template = 'Fixed'; + } + } $template = UNL_Templates::factory($layout->template, array('sharedcodepath' => 'sharedcode')); - $template->titlegraphic = '<h1>' . $layout->siteTitle . '</h1>'; - $template->pagetitle = '<h2>' . $layout->pageTitle . '</h2>'; + if (in_array(UNL_Templates::$options['version'], array(UNL_Templates::VERSION3x1, '3x1'))) { + $template->titlegraphic = $layout->siteTitle; + $template->pagetitle = '<h1>' . $layout->pageTitle . '</h1>'; + } else { + $template->titlegraphic = '<h1>' . $layout->siteTitle . '</h1>'; + $template->pagetitle = '<h2>' . $layout->pageTitle . '</h2>'; + } $template->navlinks = $this->_processLinks($layout->navLinks); $template->maincontentarea = $layout->content . "\n"; @@ -112,7 +123,11 @@ class Unl_View_Helper_WdnTemplate extends Zend_View_Helper_Abstract $template->breadcrumbs = $this->_processLinks($breadcrumbs); - $template->doctitle = '<title>' . implode(' | ', $htmlTitle) . '</title>'; + if (in_array(UNL_Templates::$options['version'], array(UNL_Templates::VERSION3x1, '3x1'))) { + $template->doctitle = '<title>' . implode(' | ', array_reverse($htmlTitle)) . '</title>'; + } else { + $template->doctitle = '<title>' . implode(' | ', $htmlTitle) . '</title>'; + } if (!$layout->leftColLinks) { $layout->leftColLinks = array();