public function __construct($label = NULL, array $items = NULL) { parent::__construct($label); if ($items !== NULL) { $this->setItems($items); } }
/** * @return ShiftPatternDate */ public function __construct(Template $template, DateTime $date, $templateFileName) { parent::__construct(null); $this->addRule(__CLASS__ . '::validatePattern', 'Shift pattern is invalid.'); $this->_template = $template; $this->_template->setFile(__DIR__ . "/{$templateFileName}"); $this->_template->registerHelper('dayName', function ($dayNumber) { return DateTime::dayName($dayNumber); }); $this->_template->registerHelper('padTime', function ($t) { if ($t < 10) { return '0' . $t; } return $t; }); $this->_template->registerHelper('selectOption', function ($timeUnit, $time, $type) { $timeUnit = (int) $timeUnit; list($hour, $minute) = explode(':', $time); $hour = (int) $hour; $minute = (int) $minute; if ($type === 'h') { return $timeUnit === $hour ? 'selected="selected"' : ''; } if ($type === 'm') { return $timeUnit === $minute ? 'selected="selected"' : ''; } }); // returns curren formated date and moves date one day forward $this->_template->registerHelper('day', function ($date) { $day = $date->format('j F'); $date->addDay(); return $day; }); $this->_date = $date; }
/** * Class constructor. * * @param string date format * @param string label */ public function __construct($format = self::W3C_DATE_FORMAT, $language = self::DEFAULT_LANGUAGE, $label = NULL) { parent::__construct($label); $this->control->type = 'text'; $this->format = $format; $this->language = $language; }
/** * Constructor * * @param string $label * @param string|Template $content */ public function __construct($label, $content) { parent::__construct($label); $this->setDisabled(TRUE); $this->setOmitted(TRUE); $this->setContent($content); }
public function __construct($label = null, array $entity = NULL, array $config = NULL) { parent::__construct($label); $this->entity = $entity; $this->labelName = $label; $this->options = $config; }
/** * @param string label * @param bool allows to upload multiple files */ public function __construct($label = NULL, $multiple = FALSE) { parent::__construct($label); $this->control->type = 'file'; $this->control->multiple = (bool) $multiple; $this->setOption('type', 'file'); }
public function __construct($caption, $publicKey, $privateKey) { $this->monitor('Nette\\Forms\\Form'); parent::__construct($caption); $this->publicKey = $publicKey; $this->privateKey = $privateKey; }
/** * @param null $label * @param $config * @param null $display * @param null $remote */ public function __construct($label, $config, $display = NULL, $remote = NULL) { parent::__construct($label); $this->monitor('Nette\\Application\\UI\\Presenter'); $this->remote = $remote; $this->display = $display; }
/** * @param string label */ public function __construct($label = NULL) { parent::__construct($label); $this->control->type = 'checkbox'; $this->wrapper = Nette\Utils\Html::el(); $this->setOption('type', 'checkbox'); }
/** * @param string $siteKey * @param string $label */ public function __construct($siteKey, $label = NULL) { parent::__construct($label); $this->siteKey = $siteKey; $this->control = Html::el('div'); $this->control->addClass('g-recaptcha'); }
/** * @param string $label * @param CaptchaProvider $provider */ public function __construct($label, CaptchaProvider $provider) { parent::__construct($label); $this->provider = $provider; $this->control = Html::el('img'); $this->control->addClass('captcha-image seznam-captcha-image'); }
/** * @param string label * @param array items from which to choose * @param int number of rows that should be visible */ public function __construct($type, $label = NULL, $size = NULL) { parent::__construct($label); $this->control->setName('select'); $this->control->size = $size > 1 ? (int) $size : NULL; $this->type = $type; }
public function __construct($caption = NULL, $side, $border) { $this->monitor('Nette\\Forms\\Form'); parent::__construct($caption); $this->side = $side; $this->border = $border; }
public function __construct($caption = NULL, $min, $max) { $this->monitor('Nette\\Forms\\Form'); parent::__construct($caption); $this->min = $min; $this->max = $max; }
public function __construct($forcedValue = NULL) { parent::__construct(); $this->control->type = 'hidden'; $this->value = (string) $forcedValue; $this->forcedValue = $forcedValue; }
/** * @param ReCaptcha $reCaptcha * @param Http\Request $httpRequest * @param string $caption */ public function __construct(ReCaptcha $reCaptcha, Http\Request $httpRequest, $caption = NULL) { parent::__construct($caption); $this->setOmitted(); $this->reCaptcha = $reCaptcha; $this->httpRequest = $httpRequest; $this->control = $reCaptcha->getHtml(); }
public function __construct($label = NULL) { parent::__construct($label); $this->baseNetteGMap = new \BaseNetteGMap(array(), $this); if ($this->baseNetteGMap->getZoom() === NULL) { $this->baseNetteGMap->setZoom(12); } }
/** * @param string label * @param bool allows to upload multiple files */ public function __construct($label = NULL, $multiple = FALSE) { parent::__construct($label); $this->control->type = 'file'; $this->control->multiple = (bool) $multiple; $this->setOption('type', 'file'); $this->addCondition(Forms\Form::FILLED)->addRule([$this, 'isOk'], Forms\Validator::$messages[self::VALID]); }
public function __construct($label = null, $type = self::TYPE_DATETIME_LOCAL) { if (!isset(self::$formats[$type])) { throw new \InvalidArgumentException("invalid type '{$type}' given."); } parent::__construct($label); $this->control->type = $this->type = $type; }
/** * Constructor * * @param string $label * @param mixed $content * @param string $wrapper */ public function __construct($label, $content, $wrapper = NULL) { parent::__construct($label); $this->setDisabled(TRUE); $this->setOmitted(TRUE); $this->setContent($content); $this->wrapper = Html::el($wrapper); }
public function __construct(IManager $mediaManager, $namespace, $label = null, $withPrimary = false) { parent::__construct($label); $this->mediaManager = $mediaManager; $this->namespace = $namespace; $this->fileFilter = FileFilter::create()->getByNamespace($this->namespace); $this->withPrimary = $withPrimary; }
/** * @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); } }
/** * @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); } }
/** * @param string|NULL * @param string */ public function __construct($label = NULL, $invalidDateMessage = self::DEFAULT_INVALID_DATE_MESSAGE) { parent::__construct($label); $this->invalidDateMessage = $invalidDateMessage; $this->setMask($this->useTime ? self::DEFAULT_MASK_DATETIME : self::DEFAULT_MASK_DATE); $this->addCondition(Form::FILLED)->addRule($this->validateDate, $this->invalidDateMessage); $this->parseDateCallback = array($this, 'parseDate'); $this->formatDateCallback = array($this, 'formatDate'); }
/** * @param string $label * @param string $value */ public function __construct($value = NULL, $label = NULL) { parent::__construct($label); $this->container = Html::el(); if ($value !== NULL) { $this->setValue($value); } $this->setOmitted(); }
public function __construct($persistentValue = NULL) { parent::__construct(); $this->control->type = 'hidden'; if ($persistentValue !== NULL) { $this->unmonitor(Nette\Forms\Form::class); $this->persistValue = TRUE; $this->value = (string) $persistentValue; } }
/** * @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); } }
/** * @param string $siteKey * @param string $theme * @param string|NULL $caption */ public function __construct($siteKey, $theme, $type, $size, $caption = NULL) { parent::__construct($caption); $this->siteKey = $siteKey; $this->theme = $theme; $this->type = $type; $this->size = $size; $this->control = Html::el('div')->addAttributes(['class' => 'g-recaptcha', 'data-sitekey' => $this->siteKey, 'data-theme' => $this->theme, 'data-type' => $this->type, 'data-size' => $this->size]); $this->setOmitted(); }
/** * @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->itemContainer = Html::el('div')->addClass('radio'); if ($items !== NULL) { $this->setItems($items); } }
/** * @param null $label * @param $config */ public function __construct($label, $config) { parent::__construct($label, $config); $this->control->type = 'text'; foreach ($config as $key => $value) { if ($key == 'language') { $this->setLanguage($value); } } }