Пример #1
0
 public function __construct($name, $storage = 'null:null', array $properties = array(), array $settings = array())
 {
     $this->settings['error_wrap'] = function ($output, $errors) {
         return sprintf('<ol class="_control_error_list"><li>%2$s</li></ol>', $output, implode('</li><li>', $errors));
     };
     parent::__construct($name, $storage, $properties, $settings);
 }
Пример #2
0
 public function __construct($forcedValue = NULL)
 {
     parent::__construct();
     $this->control->type = 'hidden';
     $this->value = (string) $forcedValue;
     $this->forcedValue = $forcedValue;
 }
Пример #3
0
 public function __construct($forcedValue = NULL)
 {
     parent::__construct();
     $this->control->type = 'hidden';
     $this->control->data['nette-rules'] = FALSE;
     $this->value = (string) $forcedValue;
     $this->forcedValue = $forcedValue;
 }
Пример #4
0
 /**
  * @param  string  label
  * @param  int  width of the control
  * @param  int  maximum number of characters the user may enter
  */
 public function __construct($label, $format = null)
 {
     parent::__construct($label);
     if (null === $format) {
         $format = self::$defaultFormat;
     }
     $this->format = $format;
 }
Пример #5
0
 /**
  * @param  string  label
  * @param  array   items from which to choose
  * @param  int     number of rows that should be visible
  */
 public function __construct($label = NULL, array $items = NULL, $size = NULL)
 {
     parent::__construct($label);
     $this->control->setName('select');
     $this->control->size = $size > 1 ? (int) $size : NULL;
     if ($items !== NULL) {
         $this->setItems($items);
     }
 }
Пример #6
0
 /**
  * @param  string  label
  * @param  array   options from which to choose
  */
 public function __construct($label = NULL, array $items = NULL)
 {
     parent::__construct($label);
     $this->control->type = 'radio';
     $this->container = Html::el();
     $this->separator = Html::el('br');
     if ($items !== NULL) {
         $this->setItems($items);
     }
 }
Пример #7
0
 /**
  * @param  string  label
  * @param  array   items from which to choose
  * @param  int     number of rows that should be visible
  */
 public function __construct($label = NULL, array $items = NULL, $size = NULL)
 {
     parent::__construct($label);
     $this->control->setName('select');
     $this->control->size = $size > 1 ? (int) $size : NULL;
     $this->control->onfocus = 'this.onmousewheel=function(){return false}';
     // prevents accidental change in IE
     $this->label->onclick = 'document.getElementById(this.htmlFor).focus();return false';
     // prevents deselect in IE 5 - 6
     if ($items !== NULL) {
         $this->setItems($items);
     }
 }
Пример #8
0
 public function __construct($value, $name = null)
 {
     parent::__construct($name);
     $this->value($value);
 }
Пример #9
0
 /**
  * @param  string  label
  */
 public function __construct($label)
 {
     $this->monitor('Nette\\Forms\\Form');
     parent::__construct($label);
     $this->control->type = 'file';
 }
Пример #10
0
 /**
  * @param  string  caption
  */
 public function __construct($caption = NULL)
 {
     parent::__construct($caption);
     $this->control->type = 'button';
     $this->value = FALSE;
 }
Пример #11
0
 /**
  * @param  string  label
  */
 public function __construct($label)
 {
     parent::__construct($label);
     $this->control->type = 'checkbox';
     $this->value = FALSE;
 }
Пример #12
0
 /**
  * Called upon construct.  Sets default control properties
  */
 public function __construct($name, $storage = 'null:null', array $properties = array(), array $settings = array())
 {
     $this->properties['type'] = 'text';
     parent::__construct($name, $storage, $properties, $settings);
 }
Пример #13
0
 /**
  * @param  string  label
  */
 public function __construct($label = NULL)
 {
     parent::__construct($label);
     $this->control->type = 'file';
 }
Пример #14
0
 /**
  * @param  string  label
  */
 public function __construct($label = NULL)
 {
     parent::__construct($label);
     $this->control->type = 'file';
     $this->control->data['nette-rules'] = FALSE;
 }
Пример #15
0
 public function __construct($controlType, $controlId, $labelText)
 {
     parent::__construct($controlType, $controlId, $labelText);
     $this->setHidden();
 }
Пример #16
0
 /**
  * FormControlText constructor - set initial settings of the control
  *
  * @param string $storage The storage location for this control
  * @param string $default The default value of the control
  * @param string $caption The caption used as the label when displaying a control
  */
 public function __construct()
 {
     $args = func_get_args();
     list($name, $storage, $caption, $template) = array_merge($args, array_fill(0, 4, null));
     parent::__construct($name, $storage, $caption, $template);
     $this->properties['type'] = 'text';
 }