Exemple #1
0
 public function __construct($name, $title = '')
 {
     parent::__construct('text', $name, $title);
     $this->settings['size'] = 10;
     $this->settings['value'] = '';
     $this->settings['readonly'] = False;
 }
Exemple #2
0
 public function getAttributes()
 {
     $this->value && ($this->attributes->checked = 'checked');
     parent::getAttributes();
     $this->attributes->offsetUnset('value');
     return $this->attributes;
 }
Exemple #3
0
 public function render()
 {
     $this->prepareOptions();
     $this->value = $this->label;
     $this->options->label = '';
     $this->code = HTML::input($this->options);
     return parent::render();
 }
Exemple #4
0
 /**
  * Prepare options
  * @return type
  */
 public function prepareOptions()
 {
     $this->options->checked = $this->options->value ? 'checked' : '';
     parent::prepareOptions();
     $this->options->text = $this->options->label;
     $this->options->label = NULL;
     return $this->options;
 }
Exemple #5
0
 public function render()
 {
     $this->getAttributes();
     $this->attributes->value = $this->label;
     $this->attributes->label = '';
     $this->code = HTML::input($this->attributes);
     return parent::render();
 }
Exemple #6
0
 /**
  * Конструктор
  *
  * @param type $options
  */
 public function __construct($options)
 {
     $options['template'] = 'Form/templates/group';
     parent::__construct($options);
     foreach ($this->options->elements as $key => $element) {
         $element->render = FALSE;
         $this->options->form->add($key, $element);
     }
 }
Exemple #7
0
 /**
  * Render
  */
 public function render()
 {
     $this->getAttributes();
     if ($this->value && ($this->value = Url::link(Url::toUri(UPLOADS . $this->value, ROOT, FALSE)))) {
         $tpl = new Template('Form.file');
         $tpl->assign($this->attributes);
         $tpl->value = $this->value;
         $this->code = $tpl->render();
     }
     return parent::render();
 }
Exemple #8
0
 /**
  * Render
  */
 public function render()
 {
     $this->getAttributes();
     $this->attributes->type = 'file';
     $this->attributes->class = 'ajaxed image';
     $tpl = new Template('Upload_Ajax.image');
     $tpl->assign($this->attributes);
     if ($this->value && ($this->value = Url::link(Url::toUri(UPLOADS . $this->value, ROOT, FALSE)))) {
         $tpl->value = $this->value;
         $tpl->image = $this->image;
     }
     $this->code = $tpl->render();
     return Form_Element_Abstract::render();
 }
Exemple #9
0
 /**
  * Конструктор
  * 
  * @param type $options 
  */
 public function __construct($options)
 {
     $options['template'] = 'Form/templates/link';
     $options['wrapper'] = FALSE;
     parent::__construct($options);
 }
Exemple #10
0
 public function __construct($name, $title = '')
 {
     parent::__construct('checkbox', $name, $title);
     $this->settings['value'] = True;
     $this->settings['checked'] = False;
 }
Exemple #11
0
 /**
  * Render
  */
 public function render()
 {
     $this->prepareOptions();
     $this->code = HTML::paired_tag('span', $this->value);
     return parent::render();
 }
Exemple #12
0
 /**
  * Конструктор
  *
  * @param type $options
  */
 public function __construct($options)
 {
     $options['template'] = 'Form/templates/textarea';
     parent::__construct($options);
 }
Exemple #13
0
 public function __construct($name)
 {
     parent::__construct('hidden', $name);
     $this->settings['value'] = '';
 }
Exemple #14
0
 public function __construct($name, $title = '')
 {
     parent::__construct('select', $name, $title);
     $this->settings['selected'] = '';
     $this->settings['size'] = 0;
 }
Exemple #15
0
 /**
  * Render
  */
 public function render()
 {
     $this->getAttributes();
     $this->code = HTML::paired_tag('span', $this->value);
     return parent::render();
 }