XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
GroupAdminEditForm.class.php
1<?php
7
8if (!defined('XOOPS_ROOT_PATH')) {
9 exit();
10}
11
12require_once XOOPS_ROOT_PATH . '/core/XCube_ActionForm.class.php';
13require_once XOOPS_MODULE_PATH . '/legacy/class/Legacy_Validator.class.php';
14
16{
17 public function getTokenName()
18 {
19 return 'module.user.GroupAdminEditForm.TOKEN' . $this->get('groupid');
20 }
21
22 public function prepare()
23 {
24 //
25 // Set form properties
26 //
27 $this->mFormProperties['groupid'] =new XCube_IntProperty('groupid');
28 $this->mFormProperties['name'] =new XCube_StringProperty('name');
29 $this->mFormProperties['description'] =new XCube_TextProperty('description');
30
31 //
32 // Set field properties
33 //
34 $this->mFieldProperties['groupid'] =new XCube_FieldProperty($this);
35 $this->mFieldProperties['groupid']->setDependsByArray(['required']);
36 $this->mFieldProperties['groupid']->addMessage('required', _MD_USER_ERROR_REQUIRED, _MD_USER_LANG_GROUPID);
37
38 $this->mFieldProperties['name'] =new XCube_FieldProperty($this);
39 $this->mFieldProperties['name']->setDependsByArray(['required', 'maxlength']);
40 $this->mFieldProperties['name']->addMessage('required', _MD_USER_ERROR_REQUIRED, _AD_USER_LANG_GROUP_NAME, '50');
41 $this->mFieldProperties['name']->addMessage('maxlength', _MD_USER_ERROR_MAXLENGTH, _AD_USER_LANG_GROUP_NAME, '50');
42 $this->mFieldProperties['name']->addVar('maxlength', '50');
43 }
44
45 public function load(&$obj)
46 {
47 $this->set('groupid', $obj->get('groupid'));
48 $this->set('name', $obj->get('name'));
49 $this->set('description', $obj->get('description'));
50 }
51
52 public function update(&$obj)
53 {
54 $obj->set('groupid', $this->get('groupid'));
55 $obj->set('name', $this->get('name'));
56 $obj->set('description', $this->get('description'));
57 }
58}
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.
[Abstract] Used for validating member property values of XCube_ActionForm.
Represents int property.
Represents string property.
Represents string property which allows CR and LF.