XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
GroupDeleteAction.class.php
1<?php
7
8if (!defined('XOOPS_ROOT_PATH')) {
9 exit();
10}
11
12require_once XOOPS_MODULE_PATH . '/user/class/AbstractDeleteAction.class.php';
13require_once XOOPS_MODULE_PATH . '/user/admin/forms/GroupAdminDeleteForm.class.php';
14
16{
17 public function _getId()
18 {
19 return xoops_getrequest('groupid');
20 }
21
22 public function &_getHandler()
23 {
24 $handler =& xoops_getmodulehandler('groups');
25 return $handler;
26 }
27
28 public function _setupActionForm()
29 {
30 $this->mActionForm =new User_GroupAdminDeleteForm();
31 $this->mActionForm->prepare();
32 }
33
34 public function _doExecute()
35 {
36 $handler =& xoops_gethandler('group');
37 $group =& $handler->get($this->mObject->get('groupid'));
38
39 $handler =& xoops_gethandler('member');
40
41 if (!$handler->delete($group)) {
42 return USER_FRAME_VIEW_ERROR;
43 }
44
45 $handler =& xoops_gethandler('groupperm');
46 if (!$handler->deleteByGroup($this->mObject->get('groupid'))) {
47 return USER_FRAME_VIEW_ERROR;
48 }
49
50 return USER_FRAME_VIEW_SUCCESS;
51 }
52
53 public function executeViewInput(&$controller, &$xoopsUser, &$render)
54 {
55 $render->setTemplateName('group_delete.html');
56 $render->setAttribute('actionForm', $this->mActionForm);
57 $render->setAttribute('object', $this->mObject);
58 }
59
60 public function executeViewSuccess(&$controller, &$xoopsUser, &$render)
61 {
62 $controller->executeForward('./index.php?action=GroupList');
63 }
64
65 public function executeViewError(&$controller, &$xoopsUser, &$render)
66 {
67 $controller->executeRedirect('./index.php?action=GroupList', 1, _MD_USER_ERROR_DBUPDATE_FAILED);
68 }
69
70 public function executeViewCancel(&$controller, &$xoopsUser, &$render)
71 {
72 $controller->executeForward('./index.php?action=GroupList');
73 }
74}