Exemple #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);
     }
 }
Exemple #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);
     }
 }
Exemple #3
0
 public function __construct($options = null)
 {
     if (isset($options['cropoptions']) && $options['cropoptions']) {
         $this->_crop_options = $options['cropoptions'];
     }
     //array ('label'=>'lala', 'width'=>100, 'height'=>50)
     parent::__construct($options);
 }
 /**
  * Get options
  *
  * Merges in element attributes as well.
  *
  * @return array
  */
 public function getOptions()
 {
     $options = parent::getOptions();
     if (null !== ($element = $this->getElement())) {
         $attribs = $element->getAttribs();
         $options = array_merge($attribs, $options);
         $this->setOptions($options);
     }
     return $options;
 }
 public function __construct($options = null, $currencies = null)
 {
     parent::__construct($options);
     $this->_format = "<div class='form-group'>\n            <label class = 'control-label col-sm-1' for = '%s' id = '%s'> %s </label>\n            <div class='col-sm-2' id ='%s'>\n            %s ";
     $this->_format .= "<datalist id = 'currencies' >";
     foreach ($currencies as $currency) {
         $code = $currency->code;
         $this->_format .= "<option value = '{$code}' >";
     }
     $this->_format .= "</datalist></div></div>";
 }
Exemple #6
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);
     }
 }
Exemple #7
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);
     }
 }
Exemple #8
0
 public function __construct($options = null)
 {
     parent::__construct($options);
 }
 public function __construct($options = NULL)
 {
     parent::__construct($options);
     $this->_format = "\n        <a href = '%s'>\n            <span class = '%s' style = '%s'></span>\n        </a>";
 }
 public function __construct($options = NULL)
 {
     parent::__construct($options);
     $this->_format = "\n        <div class='form-group'>\n            <label class = 'control-label col-sm-1' for = '%s'>%s</label>\n            <div class='col-sm-2' id ='%s'>\n                <a href='%s' > %s </a>\n            </div>\n         </div>";
 }
Exemple #11
0
 /**
  * Constructor 
  * @author Thomas Schedler <*****@*****.**>
  * @version 1.0
  */
 public function __construct($options = null)
 {
     $this->core = Zend_Registry::get('Core');
     parent::__construct($options);
 }
 public function __construct($options = NULL)
 {
     parent::__construct($options);
     $this->_format = "\n        <div class='form-group'>\n            <label class = 'control-label col-sm-1' for = '%s'> %s </label>\n            <div class='col-sm-2' id ='%s'>\n                <a href='%s'><img width='150px' src='%s'></a>\n                <a href=\"javascript: delete_field('%s')\">\n                   <span class='glyphicon glyphicon-remove' style='color:red;margin-left:10px;'></span>\n                </a>\n                <input type='hidden' name ='%s' value='%s'>\n            </div>\n         </div>";
 }
Exemple #13
0
 public function __construct($options = null)
 {
     $this->setOption('placement', self::PREPEND);
     parent::__construct($options);
 }