27 public $mModules = [];
28 public $mActionForm =
null;
30 public $mErrorMessage =
null;
32 public function prepare(&$controller, &$xoopsUser)
34 $controller->mRoot->mLanguageManager->loadPageTypeMessageCatalog(
'notification');
35 $controller->mRoot->mLanguageManager->loadModuleMessageCatalog(
'legacy');
38 $this->mActionForm->prepare();
41 public function hasPermission(&$controller, &$xoopsUser)
43 return is_object($xoopsUser);
53 public function execute(&$contoller, &$xoopsUser)
55 $this->mActionForm->fetch();
56 $this->mActionForm->validate();
62 if ($this->mActionForm->hasError()) {
63 return $this->mActionForm->mFatalError ? LEGACY_FRAME_VIEW_ERROR : LEGACY_FRAME_VIEW_INPUT;
70 $handler =& xoops_gethandler(
'notification');
71 foreach ($this->mActionForm->mNotifiyIds as $t_idArr) {
72 $t_notify =& $handler->get($t_idArr[
'id']);
73 if (is_object($t_notify) && $t_notify->get(
'not_uid') == $xoopsUser->get(
'uid') && $t_notify->get(
'not_modid') == $t_idArr[
'modid']) {
74 $successFlag = $successFlag & $handler->delete($t_notify);
78 return $successFlag ? LEGACY_FRAME_VIEW_SUCCESS : LEGACY_FRAME_VIEW_ERROR;
81 public function executeViewInput(&$controller, &$xoopsUser, &$render)
83 $render->setTemplateName(
'legacy_notification_delete.html');
84 $render->setAttribute(
'actionForm', $this->mActionForm);
87 public function executeViewSuccess(&$controller, &$xoopsUser, &$render)
89 $controller->executeForward(XOOPS_URL .
'/notifications.php');
92 public function executeViewError(&$controller, &$xoopsUser, &$render)
94 $controller->executeRedirect(XOOPS_URL .
'/notifications.php', 2, _NOT_NOTHINGTODELETE);