/**
  * Když není RequestButton požadavek, tak se tento button nezobrazuje.
  *
  * @param IPresenter
  */
 protected function attached($parent)
 {
     if ($parent instanceof \Nette\Application\IPresenter) {
         $backlinkId = $this->form->presenter->getParam(RequestButton::BACKLINK_KEY);
         if (!$backlinkId or !RequestButtonStorage::is($backlinkId)) {
             $this->setDisabled(true);
             $this->getParent()->removeComponent($this);
         }
     }
     parent::attached($parent);
 }
Example #2
0
 /**
  * Uloží stav formuláře a přesměruje.
  *
  * @throw AbortException
  */
 public function saveRequestAndRedirect()
 {
     $key = RequestButtonStorage::save($this->form->presenter->backlink(), $this->form->presenter->getParam(), $this->lookupPath('Nette\\Application\\UI\\Presenter', TRUE), $this->form->lookupPath('Nette\\Application\\UI\\Presenter', TRUE), $this->form->getValues());
     $this->form->presenter->redirect($this->getDestination(), array(RequestButton::BACKLINK_KEY => $key) + $this->getDestinationArgs());
 }