Пример #1
0
 public function render($content)
 {
     $options = $this->getOptions();
     $element = $this->getElement();
     if (!$element instanceof Zend_Form_Element) {
         return $content;
     }
     if (null === $element->getView()) {
         return $content;
     }
     $translate = new Zend_View_Helper_Translate();
     $separator = $this->getSeparator();
     $placement = $this->getPlacement();
     $errors = $this->getElement()->getMessages();
     $url = $this->getElement()->getAttrib('data-url');
     if (!$url['resource']) {
         $url['resource'] = 'mvc:default.' . $url['controller'] . '.' . $url['action'];
     }
     $output = Zend_Controller_Front::getInstance()->getParam('bootstrap')->getResource('view')->navigation()->menu()->renderPartial(new Zend_Navigation(array(array('label' => $options['name'], 'class' => $options['class'], 'id' => $url['id'], 'controller' => $url['controller'], 'action' => $url['action'], 'resource' => $url['resource'], 'params' => $url['params']))), array('common/href.phtml', 'default'));
     switch ($placement) {
         case self::PREPEND:
             return $output . $separator . $content;
         case self::APPEND:
         default:
             return $content . $separator . $output;
             parent::render($content);
     }
 }
Пример #2
0
 public function render($content)
 {
     $options = $this->getOptions();
     $element = $this->getElement();
     if (!$element instanceof Zend_Form_Element) {
         return $content;
     }
     if (null === $element->getView()) {
         return $content;
     }
     $value = $options['value'];
     if ($value != 0) {
         $checkedString = ' checked="checked"';
     } else {
         $checkedString = '';
     }
     $separator = $this->getSeparator();
     $placement = $this->getPlacement();
     $prefix = $options['prefix'];
     $id = ($prefix ? $prefix . '_' : '') . $this->getElement()->getName();
     $output = '<input type="checkbox" name="' . $id . '" id="' . $id . '" value="1"' . $checkedString . ' class="' . $options['class'] . '" title="' . $options['title'] . '">';
     switch ($placement) {
         case self::PREPEND:
             return $output . $separator . $content;
         case self::APPEND:
         default:
             return $content . $separator . $output;
             parent::render($content);
     }
 }
Пример #3
0
 public function render($content)
 {
     $element = $this->getElement();
     if (!$element instanceof Zend_Form_Element) {
         return $content;
     }
     if (null === $element->getView()) {
         return $content;
     }
     $separator = $this->getSeparator();
     $placement = $this->getPlacement();
     $id = $this->getElement()->getValue();
     $href = $this->getOption('href');
     $output = '<a class="linklabel" href="' . $href . $id . '">Przejdź</a>';
     switch ($placement) {
         case self::PREPEND:
             return $output . $separator . $content;
         case self::APPEND:
         default:
             return $content . $separator . $output;
             parent::render($content);
     }
 }
Пример #4
0
 public function render($content)
 {
     $element = $this->getElement();
     if (!$element instanceof Zend_Form_Element) {
         return $content;
     }
     if (null === $element->getView()) {
         return $content;
     }
     $separator = $this->getSeparator();
     $placement = $this->getPlacement();
     $input = $this->getElement()->getValue();
     $label = $this->getElement()->getLabel();
     $errors = $this->getElement()->getMessages();
     $output = '<a class="mailtolabel" href="mailto:' . $this->getElement()->getValue() . '">Wyślij maila</a>';
     switch ($placement) {
         case self::PREPEND:
             return $output . $separator . $content;
         case self::APPEND:
         default:
             return $content . $separator . $output;
             parent::render($content);
     }
 }