1: <?php
2: if (!defined('XOOPS_ROOT_PATH')) exit();
3:
4: class deleteAction extends AbstractAction
5: {
6: private $mActionForm;
7: private $inout = 'inbox';
8:
9: public function __construct()
10: {
11: parent::__construct();
12: }
13:
14: public function execute()
15: {
16: if ( $this->root->mContext->mRequest->getRequest('inout') == 'in' ) {
17: $this->inout = 'inbox';
18: } else {
19: $this->inout = 'outbox';
20: }
21:
22: $boxid = intval($this->root->mContext->mRequest->getRequest($this->inout));
23: $modHand = xoops_getmodulehandler($this->inout, _MY_DIRNAME);
24: $modObj = $modHand->get($boxid);
25: if ( !is_object($modObj) ) {
26: $this->setErr(_MD_MESSAGE_ACTIONMSG1);
27: return;
28: }
29:
30: if ( $modObj->get('uid') != $this->root->mContext->mXoopsUser->get('uid') ) {
31: $this->setErr(_MD_MESSAGE_ACTIONMSG2);
32: return;
33: }
34: if ( $modHand->delete($modObj) ) {
35: $this->setErr(_MD_MESSAGE_ACTIONMSG3);
36: } else {
37: $this->setErr(_MD_MESSAGE_ACTIONMSG4);
38: }
39: }
40:
41: public function executeView(&$render)
42: {
43: }
44: }
45: ?>