21 private \MessageSettingsForm $mActionForm;
24 public function __construct()
26 parent::__construct();
28 $this->mActionForm->prepare();
31 public function execute()
33 $modHand = xoops_getmodulehandler(
'settings', _MY_DIRNAME);
34 $modObj = $modHand->get($this->root->mContext->mXoopsUser->get(
'uid'));
35 if (!is_object($modObj)) {
36 $modObj = $modHand->create();
38 $this->mActionForm->load($modObj);
39 if (
'POST' == $_SERVER[
'REQUEST_METHOD']) {
40 $this->mActionForm->fetch();
41 $this->mActionForm->validate();
42 if ($this->mActionForm->hasError()) {
43 $this->setErr($this->mActionForm->getErrorMessages());
45 $this->setUrl(
'index.php?action=settings');
46 $this->mActionForm->update($modObj);
47 if (!$modHand->insert($modObj)) {
48 $this->setErr(_MD_MESSAGE_SETTINGS_MSG4);
50 $this->setErr(_MD_MESSAGE_SETTINGS_MSG3);
55 $this->mService = $this->root->mServiceManager->getService(
'UserSearch');
58 public function executeView(&$render)
60 $render->setTemplateName(
'message_settings.html');
61 $render->setAttribute(
'mActionForm', $this->mActionForm);
62 $render->setAttribute(
'purgedays', $this->root->mContext->mModuleConfig[
'savedays']);
63 $render->setAttribute(
'purgetype', $this->root->mContext->mModuleConfig[
'dletype']);
64 $render->setAttribute(
'UserSearch', $this->mService);
65 $render->setAttribute(
'message_url', XOOPS_URL.
'/modules/message/index.php');