/**
  * Strategy pattern: Initialize the configuration.
  *
  * Change the title web page according the configuration pararmeters
  *
  * See {@link \Zend_View}
  * See {@link \Zend_View_Helper_HeadTitle}
  *
  * @param \Zend_Controller_Request_Abstract $request
  */
 public function init(\Zend_Controller_Request_Abstract $request)
 {
     $this->_headTitle = $this->_getView()->headTitle($this->_options['title'], $this->_type);
     $this->_headTitle->setSeparator($this->_separator);
     if ($this->_translate) {
         $this->_headTitle->enableTranslation();
     } else {
         $this->_headTitle->disableTranslation();
     }
 }
 public function getHeadTitle()
 {
     if ($this->_headTitle === null) {
         parent::init();
         $options = $this->getOptions();
         $this->_headTitle = $this->_getView()->headTitle($options['title'], $this->_type);
         $this->_headTitle->setSeparator($this->_separator);
         if ($this->_translate) {
             $this->_headTitle->enableTranslation();
         } else {
             $this->_headTitle->disableTranslation();
         }
     }
     return $this->_headTitle;
 }
Esempio n. 3
0
/*
 * Pull global site settings
 */
$config = new Zend_Config_Ini(CONFIG_PATH . '/settings.ini', 'production');
Zend_Registry::set('config', $config);
/*
 * Set view helpers
 */
$doctypeHelper = new Zend_View_Helper_Doctype();
$doctypeHelper->doctype('XHTML1_TRANSITIONAL');
$metaHelper = new Zend_View_Helper_HeadMeta();
$metaHelper->appendHttpEquiv('Content-Type', 'text/html; charset=UTF-8');
$metaHelper->appendHttpEquiv('pragma', 'no-cache');
$metaHelper->appendHttpEquiv('Cache-Control', 'no-cache');
$titleHelper = new Zend_View_Helper_HeadTitle();
$titleHelper->setSeparator(' - ');
$titleHelper->headTitle($config->defaults->title);
/*
 * Set up translators.
 */
$language = $currentUser->language == null ? $config->defaults->language : $currentUser->language;
$translate = new Zend_Translate('csv', LANGUAGE_PATH . '/' . $language . '.csv', $language);
Zend_Registry::set('Zend_Translate', $translate);
/*
 * Set the skin. If the skin doesn't exist then set the default skin.
 */
$skin = $currentUser->skin == null ? $config->defaults->skin : $currentUser->skin;
try {
    require_once APPLICATION_PATH . '/models/Skin.php';
    $skinTest = new Model_Skin($skin);
    unset($skinTest);