Пример #1
0
 function _initPlaceHolders(&$options)
 {
     if (!empty($options['docType'])) {
         $helper = new Zend_View_Helper_Doctype();
         $helper->doctype($options['docType']);
     }
     if (!empty($options['css'])) {
         $helper = new Zend_View_Helper_HeadLink();
         if (is_array($options['css'])) {
             foreach ($options['css'] as $css) {
                 $helper->appendStylesheet($css);
             }
         } else {
             $helper->appendStylesheet($options['css']);
         }
     }
     if (!empty($options['headMeta'])) {
         $meta = $options['headMeta'];
         $helper = new Zend_View_Helper_HeadMeta();
         if (!empty($meta['http-equiv'])) {
             $equiv = $meta['http-equiv'];
             foreach ($equiv as $key => $value) {
                 $helper->appendHttpEquiv($key, $value);
             }
         }
     }
 }
Пример #2
0
 /**
  * @group ZF-11835
  */
 public function testConditional() 
 {
     $html = $this->helper->appendHttpEquiv('foo', 'bar', array('conditional' => 'lt IE 7'))->toString();
     
     $this->assertRegExp("|^<!--\[if lt IE 7\]>|", $html);
     $this->assertRegExp("|<!\[endif\]-->$|", $html);
 }
Пример #3
0
 /**
  * @group GH-515
  */
 public function testConditionalNoIEWidthSpace()
 {
     $html = $this->helper->appendHttpEquiv('foo', 'bar', array('conditional' => '! IE'))->toString();
     $this->assertContains('<!--[if ! IE]><!--><', $html);
     $this->assertContains('<!--<![endif]-->', $html);
 }
Пример #4
0
 * Let's fire 'er up!
 */
Zend_Session::start();
$currentUser = new Zend_Session_Namespace('currentUser');
/*
 * 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;