Esempio n. 1
0
 /**
  * @param SeznamCaptcha $provider
  */
 public function __construct(SeznamCaptcha $provider)
 {
     parent::__construct();
     $this->provider = $provider;
     $this->validator = new CaptchaValidator($provider);
     $this['image'] = new CaptchaImage('Captcha', $provider);
     $this['code'] = new CaptchaInput('Code');
     $this['hash'] = new CaptchaHash($provider);
 }
Esempio n. 2
0
 /**
  * Form constructor.
  * @param  string
  */
 public function __construct($name = NULL)
 {
     if ($name !== NULL) {
         $this->getElementPrototype()->id = 'frm-' . $name;
         $tracker = new Controls\HiddenField($name);
         $tracker->setOmitted();
         $this[self::TRACKER_ID] = $tracker;
     }
     parent::__construct(NULL, $name);
 }
Esempio n. 3
0
 /**
  * @param callable $factory
  * @param int $createDefault
  * @param bool $forceDefault
  *
  * @throws \Nette\InvalidArgumentException
  */
 public function __construct($factory, $createDefault = 0, $forceDefault = FALSE)
 {
     parent::__construct();
     $this->monitor('Nette\\Application\\UI\\Presenter');
     try {
         $this->factoryCallback = Callback::closure($factory);
     } catch (Nette\InvalidArgumentException $e) {
         $type = is_object($factory) ? 'instanceof ' . get_class($factory) : gettype($factory);
         throw new Nette\InvalidArgumentException('Replicator requires callable factory, ' . $type . ' given.', 0, $e);
     }
     $this->createDefault = (int) $createDefault;
     $this->forceDefault = $forceDefault;
 }
 public function __construct(Nette\Forms\ControlGroup $group = NULL, Brabijan\SeoComponents\Router\Target $target = NULL)
 {
     parent::__construct();
     $this->target = $target;
     if ($group) {
         $this->currentGroup = $group;
     }
     $this->addText("seoTitle", "Title:");
     $this->addTextArea("seoKeywords", "Keywords:");
     $this->addTextArea("seoDescription", "Description:");
     $this->addSelect("seoRobots", "Robots:", array("index" => "index", "noindex" => "noindex"));
     $this->addSelect("sitemapChangeFreq", "Sitemap change frequency:", array("always" => "always", "hourly" => "hourly", "daily" => "daily", "weekly" => "weekly", "monthly" => "monthly", "yearly" => "yearly", "never" => "never"));
     $this->addText("sitemapPriority", "Sitemap priority:")->setType("number")->setRequired()->setAttribute("step", "0.1")->addRule(Nette\Application\UI\Form::FLOAT, "Priority must be number between 0 and 1")->addRule(Nette\Application\UI\Form::RANGE, "Priority must be number between 0 and 1", array(0, 1));
     $this->addText("route", "Route:")->setRequired()->addFilter(function ($val) {
         return ltrim($val, "/");
     });
 }
Esempio n. 5
0
 /**
  * Form constructor.
  * @param  string
  */
 public function __construct($name = NULL)
 {
     $this->element = Nette\Utils\Html::el('form');
     $this->element->action = '';
     // RFC 1808 -> empty uri means 'this'
     $this->element->method = self::POST;
     $this->element->id = $name === NULL ? NULL : 'frm-' . $name;
     $this->monitor(__CLASS__);
     if ($name !== NULL) {
         $tracker = new Controls\HiddenField($name);
         $tracker->unmonitor(__CLASS__);
         $this[self::TRACKER_ID] = $tracker;
     }
     parent::__construct(NULL, $name);
 }
 public function __construct($factory)
 {
     parent::__construct();
     $this->factory = Callback::check($factory);
 }
Esempio n. 7
0
 /**
  * @param callable $callable_set_container
  */
 public function __construct(callable $callable_set_container)
 {
     parent::__construct();
     $this->monitor('Nette\\Application\\UI\\Presenter');
     $this->callable_set_container = $callable_set_container;
 }
Esempio n. 8
0
 public function __construct($containerFactory)
 {
     parent::__construct();
     $this->containerFactory = callback($containerFactory);
     $this->collection = new ArrayCollection();
 }
 public function __construct()
 {
     parent::__construct();
     $this->monitor('Nette\\Forms\\Form');
 }