/** * Constructor. If nothing else, it also has to call the constructor of the parent * class, BlogAction with the same parameters */ function AdminUpdateLinkCategoryAction($actionInfo, $request) { $this->AdminAction($actionInfo, $request); // data validation $this->registerFieldValidator("linkCategoryName", new StringValidator()); $this->registerFieldValidator("linkCategoryId", new IntegerValidator()); $errorView = new AdminTemplatedView($this->_blogInfo, "editlinkcategory"); $errorView->setErrorMessage($this->_locale->tr("error_updating_link_category")); $this->setValidationErrorView($view); }
/** * Constructor. If nothing else, it also has to call the constructor of the parent * class, BlogAction with the same parameters */ function AdminAddArticleCategoryAction($actionInfo, $request) { $this->AdminAction($actionInfo, $request); // register two validators $this->registerFieldValidator("categoryName", new StringValidator()); $this->registerFieldValidator("categoryDescription", new StringValidator()); $this->registerFieldValidator("categoryInMainPage", new EmptyValidator()); // and the view we should show in case there is a validation error $errorView = new AdminTemplatedView($this->_blogInfo, "newpostcategory"); $errorView->setErrorMessage($this->_locale->tr("error_adding_article_category")); $this->setValidationErrorView($errorView); }
/** * Constructor. If nothing else, it also has to call the constructor of the parent * class, BlogAction with the same parameters */ function AdminUpdateArticleCategoryAction($actionInfo, $request) { $this->AdminAction($actionInfo, $request); // data validation settings $this->registerFieldValidator("categoryName", new StringValidator()); $this->registerFieldValidator("categoryId", new IntegerValidator()); $this->registerFieldValidator("categoryDescription", new StringValidator()); $this->registerFieldValidator("categoryInMainPage", new EmptyValidator()); $errorView = new AdminTemplatedView($this->_blogInfo, "editarticlecategory"); $errorView->setErrorMessage($this->_locale->tr("error_updating_article_category")); $this->setValidationErrorView($errorView); }
function AdminAddBlogUserAction($actionInfo, $request) { $this->BlogOwnerAdminAction($actionInfo, $request); // data validation $this->registerFieldValidator("newBlogUserName", new StringValidator()); $this->_sendNotification = $this->_request->getValue("sendNotification") != ""; if ($this->_sendNotification) { $this->registerFieldValidator("newBlogUserText", new StringValidator()); } else { $this->registerField("newBlogUserText"); } $this->registerField("sendNotification"); $view = new AdminTemplatedView($this->_blogInfo, "addbloguser"); $view->setErrorMessage($this->_locale->tr("error_adding_user")); $this->setValidationErrorView($view); }