9 public $mObject =
null;
10 public $mObjectHandler =
null;
11 public $mActionForm =
null;
41 $this->mObject = &$this->mObjectHandler->get($id);
44 $this->mObject = &$this->mObjectHandler->create();
68 public function prepare(&$controller, &$xoopsUser, $moduleConfig)
70 $this->mConfig = $moduleConfig;
76 public function getDefaultView(&$controller, &$xoopsUser)
78 if (
null == $this->mObject) {
79 return USER_FRAME_VIEW_ERROR;
82 $this->mActionForm->load($this->mObject);
84 return USER_FRAME_VIEW_INPUT;
87 public function execute(&$controller, &$xoopsUser)
89 if (
null == $this->mObject) {
90 return USER_FRAME_VIEW_ERROR;
93 if (
null != xoops_getrequest(
'_form_control_cancel')) {
94 return USER_FRAME_VIEW_CANCEL;
97 $this->mActionForm->load($this->mObject);
99 $this->mActionForm->fetch();
100 $this->mActionForm->validate();
102 if ($this->mActionForm->hasError()) {
103 return USER_FRAME_VIEW_INPUT;
106 $this->mActionForm->update($this->mObject);
108 return $this->
_doExecute() ? USER_FRAME_VIEW_SUCCESS
109 : USER_FRAME_VIEW_ERROR;
117 return $this->mObjectHandler->insert($this->mObject);