Example #1
0
	/**
	 * @param  string  caption
	 */
	public function __construct($caption = NULL)
	{
		$this->monitor('Nette\Forms\Form');
		parent::__construct();
		$this->control = Html::el('input');
		$this->label = Html::el('label');
		$this->caption = $caption;
		$this->rules = new Rules($this);
	}
Example #2
0
 /**
  * Data grid column constructor.
  * @param  string  textual caption of column
  * @param  int     maximum number of dislayed characters
  */
 public function __construct($caption = NULL, $maxLength = NULL)
 {
     parent::__construct();
     $this->header = \Nette\Web\Html::el();
     $this->cell = \Nette\Web\Html::el();
     $this->caption = $caption;
     if ($maxLength !== NULL) {
         $this->maxLength = $maxLength;
     }
     $this->monitor('\\DataGrid\\DataGrid');
 }
Example #3
0
 /**
  * Data grid action constructor.
  * @note   for full ajax support, destination should not change module, 
  * @note   presenter or action and must be ended with exclamation mark (!)
  * 
  * @param  string  textual title
  * @param  string  textual link destination
  * @param  Html    element which is added to a generated link
  * @param  bool    use ajax? (add class self::$ajaxClass into generated link)
  * @param  bool    generate link with argument? (variable $keyName must be defined in data grid)
  * @return void
  */
 public function __construct($title, $destination, \Nette\Web\Html $icon = NULL, $useAjax = FALSE, $type = self::WITH_KEY)
 {
     parent::__construct();
     $this->type = $type;
     $this->destination = $destination;
     $a = Html::el('a')->title($title);
     if ($useAjax) {
         $a->class[] = self::$ajaxClass;
     }
     if ($icon !== NULL && $icon instanceof \Nette\Web\Html) {
         $a->add($icon);
     } else {
         $a->setText($title);
     }
     $this->html = $a;
 }
 /**
  * Object cloning.
  */
 public function __clone()
 {
     if ($this->components) {
         $oldMyself = reset($this->components)->getParent();
         $oldMyself->cloning = $this;
         foreach ($this->components as $name => $component) {
             $this->components[$name] = clone $component;
         }
         $oldMyself->cloning = NULL;
     }
     parent::__clone();
 }
 public function __construct()
 {
     parent::__construct();
 }