XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
BannerEditAction.class.php
1<?php
6
7if (!defined('XOOPS_ROOT_PATH')) {
8 exit();
9}
10
11require_once XOOPS_MODULE_PATH . '/legacyRender/class/AbstractEditAction.class.php';
12require_once XOOPS_MODULE_PATH . '/legacyRender/admin/forms/BannerAdminEditForm.class.php';
13
15{
16 public function _getId()
17 {
18 return xoops_getrequest('bid');
19 }
20
21 public function &_getHandler()
22 {
23 $handler =& xoops_getmodulehandler('banner');
24 return $handler;
25 }
26
27 public function _setupObject()
28 {
29 parent::_setupObject();
30 if (is_object($this->mObject) && $this->mObject->isNew()) {
31 $this->mObject->set('cid', xoops_getrequest('cid'));
32 }
33 }
34
35 public function _setupActionForm()
36 {
37 $this->mActionForm =new LegacyRender_BannerAdminEditForm();
38 $this->mActionForm->prepare();
39 }
40
41 public function executeViewInput(&$controller, &$xoopsUser, &$render)
42 {
43 $render->setTemplateName('banner_edit.html');
44 $render->setAttribute('actionForm', $this->mActionForm);
45 $this->mObject->loadBannerclient();
46 $render->setAttribute('object', $this->mObject);
47
48 $bannerclientHandler =& xoops_getmodulehandler('bannerclient');
49 $bannerclientArr =& $bannerclientHandler->getObjects();
50 foreach (array_keys($bannerclientArr) as $key) {
51 $bannerclientArr[$key]->loadBanner();
52 }
53 $render->setAttribute('bannerclientArr', $bannerclientArr);
54 }
55
56 public function executeViewSuccess(&$controller, &$xoopsUser, &$render)
57 {
58 $controller->executeForward('./index.php?action=BannerList');
59 }
60
61 public function executeViewError(&$controller, &$xoopsUser, &$render)
62 {
63 $controller->executeRedirect('./index.php?action=BannerList', 1, _AD_LEGACYRENDER_ERROR_DBUPDATE_FAILED);
64 }
65
66 public function executeViewCancel(&$controller, &$xoopsUser, &$render)
67 {
68 $controller->executeForward('./index.php?action=BannerList');
69 }
70}