static public warningConfirmMessage ( $sHeader, $sDescription, $sActionUrl, $sActionLabel, $sCancelUrl, $sCancelLabel = "Cancel" ) |
protected function actionDelete() { $aParams = $this->getParams(); $iModel = intval($aParams["delete"]); if ($this->actionDeleteConfirmed() !== false) { # catching Exception thrown when model already destroyed # happens when user refreshes page on delete-URL, for instance try { $oModel = new \Baikal\Model\AddressBook($iModel); $oModel->destroy(); } catch (\Exception $e) { # already deleted; silently discarding } # Redirecting to admin home \Flake\Util\Tools::redirectUsingMeta($this->linkHome()); } else { $oModel = new \Baikal\Model\AddressBook($iModel); $this->aMessages[] = \Formal\Core\Message::warningConfirmMessage("Check twice, you're about to delete " . $oModel->label() . "</strong> from the database !", "<p>You are about to delete a contact book and all it's visiting cards. This operation cannot be undone.</p><p>So, now that you know all that, what shall we do ?</p>", $this->linkDeleteConfirm($oModel), "Delete <strong><i class='" . $oModel->icon() . " icon-white'></i> " . $oModel->label() . "</strong>", $this->linkHome()); } }