/** * @param boolean $visible * @return self */ public function setVisible($visible = TRUE, $openRequired = FALSE) { if ($visible) { if (self::$ACTIVE_MODAL !== NULL && self::$ACTIVE_MODAL !== $this) { self::$ACTIVE_MODAL->setVisible(FALSE); } self::$ACTIVE_MODAL = $this; } else { if (self::$ACTIVE_MODAL == $this) { self::$ACTIVE_MODAL = NULL; } self::$CLOSE_REQUIRED = TRUE; } $this->visible = $visible; $this->openRequired = $openRequired; return $this; }
protected function beforeRender() { parent::beforeRender(); $this->template->title = $this->title; $this->template->content = $this->content; $this->template->parentTemplate = $this->template->getFile(); $this->template->setFile(__DIR__ . '/templates/ConfirmationModal/default.latte'); }
/** * @param Presenter $presenter */ public function updateModal(Presenter $presenter) { $presenter->getTemplate()->modal = $activeModal = Modal::getActiveModal(); if ($presenter->isAjax()) { // close the previous modal if (Modal::isCloseRequired()) { $presenter->getPayload()->closeModal = TRUE; } $redrawModal = $activeModal && $activeModal->isOpenRequired() || Modal::isCloseRequired(); $presenter->redrawControl('modal', $redrawModal); } }