XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
MessageSettingsForm.class.php
1<?php
12
13if (!defined('XOOPS_ROOT_PATH')) {
14 exit();
15}
16require_once XOOPS_ROOT_PATH.'/core/XCube_ActionForm.class.php';
17require_once XOOPS_MODULE_PATH.'/legacy/class/Legacy_Validator.class.php';
18
20{
21
22 public function getTokenName()
23 {
24 return 'module.message.Settings.TOKEN';
25 }
26
27 public function prepare()
28 {
29 $this->mFormProperties['usepm'] = new XCube_BoolProperty('usepm');
30 $this->mFormProperties['tomail'] = new XCube_BoolProperty('tomail');
31 $this->mFormProperties['viewmsm'] = new XCube_BoolProperty('viewmsm');
32 $this->mFormProperties['pagenum'] = new XCube_IntProperty('pagenum');
33 $this->mFormProperties['blacklist'] = new XCube_StringProperty('blacklist');
34 }
35
36 public function fetchBlacklist()
37 {
38 $blacklist = $this->get('blacklist');
39 if ('' == $blacklist) {
40 return;
41 }
42
43 if (false !== strpos($blacklist, ',')) {
44 $lists = explode(',', $blacklist);
45 $lists = array_map('intval', $lists);
46 $lists = array_unique($lists);
47 $this->set('blacklist', implode(',', $lists));
48 } else {
49 $this->set('blacklist', (int)$blacklist);
50 }
51 }
52
53 public function update(&$obj)
54 {
55 $root = XCube_Root::getSingleton();
56 $obj->set('uid', $root->mContext->mXoopsUser->get('uid'));
57 $obj->set('usepm', $this->get('usepm'));
58 $obj->set('tomail', $this->get('tomail'));
59 $obj->set('viewmsm', $this->get('viewmsm'));
60 $obj->set('pagenum', $this->get('pagenum'));
61 $obj->set('blacklist', $this->get('blacklist'));
62 }
63
64 public function load(&$obj)
65 {
66 $this->set('usepm', $obj->get('usepm'));
67 $this->set('tomail', $obj->get('tomail'));
68 $this->set('viewmsm', $obj->get('viewmsm'));
69 $this->set('pagenum', $obj->get('pagenum'));
70 $this->set('blacklist', $obj->get('blacklist'));
71 }
72}
update(&$obj)
[Abstract] Updates an object with properties values.
getTokenName()
Gets the token name of this actionform's token.
prepare()
[Abstract] Set up form properties and field properties.
load(&$obj)
[Abstract] Initializes properties' values from an object.
Represents bool property.
Represents int property.
Represents string property.