/** * */ public function isXhtml($doctype = null) { if (empty($doctype)) { $doctype = $this->view->doctype(); } if (strpos($doctype, 'XHTML')) { return ' xmlns="http://www.w3.org/1999/xhtml"'; } else { return null; } }
/** * Retrieve view object * * @return Zend_View */ public function getView() { if (null === $this->_view) { $options = $this->getOptions(); $this->_view = new Zend_View($options); if (isset($options['doctype'])) { $this->_view->doctype()->setDoctype(strtoupper($options['doctype'])); } } return $this->_view; }
/** * String representation of dojo environment * * @return string */ public function __toString() { if (!$this->isEnabled()) { return ''; } $this->_isXhtml = $this->view->doctype()->isXhtml(); if (Zend_Dojo_View_Helper_Dojo::useDeclarative()) { if (null === $this->getDjConfigOption('parseOnLoad')) { $this->setDjConfigOption('parseOnLoad', true); } } if (!empty($this->_dijits)) { $this->registerDijitLoader(); } $html = $this->_renderStylesheets() . PHP_EOL . $this->_renderDjConfig() . PHP_EOL . $this->_renderDojoScriptTag() . PHP_EOL . $this->_renderLayers() . PHP_EOL . $this->_renderExtras(); return $html; }
/** * Retrieve view object * * @return Zend_View */ public function getView() { if (null === $this->_view) { $options = $this->getOptions(); $this->_view = new Zend_View($options); if (isset($options['doctype'])) { $this->_view->doctype()->setDoctype(strtoupper($options['doctype'])); if (isset($options['charset']) && $this->_view->doctype()->isHtml5()) { $this->_view->headMeta()->setCharset($options['charset']); } } if (isset($options['contentType'])) { $this->_view->headMeta()->appendHttpEquiv('Content-Type', $options['contentType']); } } return $this->_view; }
/** * Retrieve view object * * @return Zend_View */ public function getView() { if (null === $this->_view) { $options = $this->getOptions(); $this->_view = new Zend_View($options); if (isset($options['doctype'])) { $this->_view->doctype()->setDoctype(strtoupper($options['doctype'])); if (isset($options['charset']) && $this->_view->doctype()->isHtml5()) { $this->_view->headMeta()->setCharset($options['charset']); } } if (isset($options['contentType'])) { $this->_view->headMeta()->appendHttpEquiv('Content-Type', $options['contentType']); } if (isset($options['assign']) && is_array($options['assign'])) { foreach ($options['assign'] as $key => $value) { $this->_view->assign($key, $value); } } } return $this->_view; }
/** * Render Bootstrap stylesheet(s) * * @return string */ public function renderStylesheets() { $stylesheet = $this->_getStylesheet(); if ($this->view instanceof \Zend_View_Abstract) { $closingBracket = $this->view->doctype()->isXhtml() ? ' />' : '>'; } else { $closingBracket = ' />'; } // disable the stylesheat loader for bootstrap now that it gets compiled with the style $style = ''; //'<link rel="stylesheet" href="'.$stylesheet.'" type="text/css" media="screen"' . $closingBracket . PHP_EOL; if (\MUtil_Bootstrap::$fontawesome === true) { $fontawesomeStylesheet = $this->_getFontAwesomeStylesheet(); $style .= '<link rel="stylesheet" href="' . $fontawesomeStylesheet . '" type="text/css"' . $closingBracket . PHP_EOL; } return $style; }
/** * Display the captcha * * @param Zend_View_Interface $view * @param mixed $element * @return string */ public function render(Zend_View_Interface $view = null, $element = null) { $endTag = ' />'; if ($view instanceof Zend_View_Abstract && !$view->doctype()->isXhtml()) { $endTag = '>'; } return '<img width="' . $this->getWidth() . '" height="' . $this->getHeight() . '" alt="' . $this->getImgAlt() . '" src="' . $this->getImgUrl() . $this->getId() . $this->getSuffix() . '"' . $endTag; }
/** * Render jQuery stylesheets * * @return string */ protected function _renderStylesheets() { if (($this->getRenderMode() & ZendX_JQuery::RENDER_STYLESHEETS) == 0) { return ''; } foreach ($this->getStylesheets() as $stylesheet) { $stylesheets[] = $stylesheet; } if (empty($stylesheets)) { return ''; } array_reverse($stylesheets); /*$style = '<style type="text/css">' . PHP_EOL . (($this->_isXhtml) ? '<!--' : '<!--') . PHP_EOL; foreach ($stylesheets as $stylesheet) { $style .= ' @import "' . $stylesheet . '";' . PHP_EOL; } $style .= (($this->_isXhtml) ? '-->' : '-->') . PHP_EOL . '</style>';*/ $style = ""; foreach ($stylesheets as $stylesheet) { if ($this->view instanceof Zend_View_Abstract) { $closingBracket = $this->view->doctype()->isXhtml() ? ' />' : '>'; } else { $closingBracket = ' />'; } $style .= '<link rel="stylesheet" href="' . $stylesheet . '" ' . 'type="text/css" media="screen"' . $closingBracket . PHP_EOL; } return $style; }
/** * Render jQuery stylesheets * * @return string */ protected function _renderStylesheets() { if (0 == ($this->getRenderMode() & ZendX_JQuery::RENDER_STYLESHEETS)) { return ''; } foreach ($this->getStylesheets() as $stylesheet) { $stylesheets[] = $stylesheet; } if (empty($stylesheets)) { return ''; } array_reverse($stylesheets); $style = ''; foreach ($stylesheets as $stylesheet) { if ($this->view instanceof Zend_View_Abstract) { $closingBracket = $this->view->doctype()->isXhtml() ? ' />' : '>'; } else { $closingBracket = ' />'; } $style .= '<link rel="stylesheet" href="' . $stylesheet . '" ' . 'type="text/css" media="screen"' . $closingBracket . PHP_EOL; } return $style; }
/** * Creates a hidden element. * * We have this as a common method because other elements often * need hidden elements for their operation. * * @access protected * * @param $name The element name. * * @param $value The element value. * * @param $attribs Attributes for the element. * * @return string A hidden element. */ protected function _hidden($name, $value = null, $attribs = null) { $endTag = $this->view->doctype()->isXhtml() ? ' />' : '>'; return '<input type="hidden"' . ' name="' . $this->view->escape($name) . '"' . ' value="' . $this->view->escape($value) . '"' . $this->_htmlAttribs($attribs) . $endTag; }
/** * String representation of jQuery environment * * @return string */ public function __toString() { if (!$this->isEnabled()) { return ''; } $this->_isXhtml = $this->view->doctype()->isXhtml(); $html = $this->_renderStylesheets() . PHP_EOL . $this->_renderScriptTags() . PHP_EOL . $this->_renderExtras(); return $html; }