1: <?php
2: 3: 4: 5:
6:
7: if (!defined('XOOPS_ROOT_PATH')) exit();
8:
9: require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php";
10: require_once XOOPS_MODULE_PATH . "/legacy/class/Legacy_Validator.class.php";
11:
12: class User_GroupAdminEditForm extends XCube_ActionForm
13: {
14: function getTokenName()
15: {
16: return "module.user.GroupAdminEditForm.TOKEN" . $this->get('groupid');
17: }
18:
19: function prepare()
20: {
21:
22:
23:
24: $this->mFormProperties['groupid'] =new XCube_IntProperty('groupid');
25: $this->mFormProperties['name'] =new XCube_StringProperty('name');
26: $this->mFormProperties['description'] =new XCube_TextProperty('description');
27:
28:
29:
30:
31: $this->mFieldProperties['groupid'] =new XCube_FieldProperty($this);
32: $this->mFieldProperties['groupid']->setDependsByArray(array('required'));
33: $this->mFieldProperties['groupid']->addMessage('required', _MD_USER_ERROR_REQUIRED, _MD_USER_LANG_GROUPID);
34:
35: $this->mFieldProperties['name'] =new XCube_FieldProperty($this);
36: $this->mFieldProperties['name']->setDependsByArray(array('required','maxlength'));
37: $this->mFieldProperties['name']->addMessage('required', _MD_USER_ERROR_REQUIRED, _AD_USER_LANG_GROUP_NAME, '50');
38: $this->mFieldProperties['name']->addMessage('maxlength', _MD_USER_ERROR_MAXLENGTH, _AD_USER_LANG_GROUP_NAME, '50');
39: $this->mFieldProperties['name']->addVar('maxlength', '50');
40: }
41:
42: function load(&$obj)
43: {
44: $this->set('groupid', $obj->get('groupid'));
45: $this->set('name', $obj->get('name'));
46: $this->set('description', $obj->get('description'));
47: }
48:
49: function update(&$obj)
50: {
51: $obj->set('groupid', $this->get('groupid'));
52: $obj->set('name', $this->get('name'));
53: $obj->set('description', $this->get('description'));
54: }
55: }
56:
57: ?>
58: