Esempio n. 1
0
 /**
  * Function to allow overloading  of tag rendering only
  *
  * Renders the element tag with it's content into a html string
  *
  * The $view is used to correctly encode and escape the output
  *
  * @param \Zend_View_Abstract $view
  * @return string Correctly encoded and escaped html output
  */
 protected function renderElement(\Zend_View_Abstract $view)
 {
     if (isset($this->_attribs['src'])) {
         if (is_scalar($this->_attribs['src'])) {
             $src = $this->_attribs['src'];
         } else {
             $src = \MUtil_Html::getRenderer()->renderArray($view, array($this->_attribs['src']));
         }
     } else {
         $src = false;
     }
     if ($src || $this->renderWithoutSrc) {
         return parent::renderElement($view);
     }
 }
Esempio n. 2
0
 /**
  * Function to allow overloading  of tag rendering only
  *
  * Renders the element tag with it's content into a html string
  *
  * The $view is used to correctly encode and escape the output
  *
  * @param \Zend_View_Abstract $view
  * @return string Correctly encoded and escaped html output
  */
 protected function renderElement(\Zend_View_Abstract $view)
 {
     $result = parent::renderElement($view);
     if ($this->_onlyWhenChanged) {
         if ($result == $this->_onlyWhenChangedValueStore) {
             return null;
         }
         $this->_onlyWhenChangedValueStore = $result;
     }
     return $result;
 }
Esempio n. 3
0
 /**
  * Function to allow overloading of tag rendering only
  *
  * Renders the element tag with it's content into a html string
  *
  * The $view is used to correctly encode and escape the output
  *
  * @param \Zend_View_Abstract $view
  * @return string Correctly encoded and escaped html output
  */
 protected function renderElement(\Zend_View_Abstract $view)
 {
     if ($this->_lastChild) {
         $this->_lastChild->class = $this->progressTextClass;
         // These style elements inline because they are REQUIRED to make the panel work.
         //
         // Making the child position absolute means it is positioned over the content that
         // the JQuery progress widget displays (the bar itself) and so this solution allows
         // the text to be displayed over the progress bar (when it has a relative position).
         //
         // The elements should be display neutral.
         //
         $this->_lastChild->style = 'left: 0; height: 100%; position: absolute; top: 0; width: 100%;';
         $this->style = 'position: relative;';
     }
     return parent::renderElement($view);
 }
Esempio n. 4
0
 /**
  * Function to allow overloading  of tag rendering only
  *
  * Renders the element tag with it's content into a html string
  *
  * The $view is used to correctly encode and escape the output
  *
  * @param \Zend_View_Abstract $view
  * @return string Correctly encoded and escaped html output
  */
 protected function renderElement(\Zend_View_Abstract $view)
 {
     $this->_currentContent = array();
     // If the label was assigned an element lazy,
     // now is the time to get it's value.
     foreach ($this->_content as $key => $value) {
         if ($value instanceof \MUtil_Lazy_LazyInterface) {
             $value = \MUtil_Lazy::rise($value);
         }
         if ($value instanceof \Zend_Form_Element) {
             if ($value instanceof \Zend_Form_Element_Hidden) {
                 return null;
             }
             // Only a label when a label decorator exists, but we do not use that decorator
             $decorator = $value->getDecorator('Label');
             if ($decorator) {
                 if (false === $decorator->getOption('escape')) {
                     $label = \MUtil_Html::raw($value->getLabel());
                 } else {
                     $label = $value->getLabel();
                 }
                 $class = $this->class ? \MUtil_Html::renderAny($view, $this->class) . ' ' : '';
                 if ($value->isRequired()) {
                     $class .= $this->getRequiredClass();
                     $this->_currentContent[$key] = array($this->getRequiredPrefix(), $label, $this->getRequiredPostfix());
                 } else {
                     $class .= $this->getOptionalClass();
                     $this->_currentContent[$key] = array($this->getOptionalPrefix(), $label, $this->getOptionalPostfix());
                 }
                 parent::__set('class', $class);
                 // Bypass existing property for drawing
                 if ($id = $value->getId()) {
                     parent::__set('for', $id);
                     // Always overrule
                 } else {
                     parent::__unset('for');
                 }
             }
         } elseif ($value instanceof \Zend_Form_DisplayGroup) {
             return null;
         } else {
             $this->_currentContent[$key] = $value;
         }
     }
     return parent::renderElement($view);
 }