1: <?php
2:
3: if (!defined('XOOPS_ROOT_PATH')) exit();
4:
5: require_once XOOPS_ROOT_PATH."/core/XCube_ActionForm.class.php";
6:
7: 8: 9: 10:
11: class User_AvatarListForm extends XCube_ActionForm
12: {
13: 14: 15: 16:
17: function getTokenName()
18: {
19:
20:
21: if (xoops_getenv('REQUEST_METHOD') == 'POST') {
22: return "module.user.AvatarSettingsForm.TOKEN";
23: }
24: else {
25: return null;
26: }
27: }
28:
29: 30: 31: 32:
33: function getTokenErrorMessage()
34: {
35: return null;
36: }
37:
38: function prepare()
39: {
40:
41: $this->mFormProperties['name'] =new XCube_StringArrayProperty('name');
42: $this->mFormProperties['display'] =new XCube_BoolArrayProperty('display');
43: $this->mFormProperties['weight'] =new XCube_IntArrayProperty('weight');
44: $this->mFormProperties['delete']= new XCube_BoolArrayProperty('delete');
45:
46: $this->mFormProperties['confirm'] =new XCube_BoolProperty('confirm');
47:
48: $this->mFieldProperties['name'] =new XCube_FieldProperty($this);
49: $this->mFieldProperties['name']->setDependsByArray(array('required','maxlength'));
50: $this->mFieldProperties['name']->addMessage('required', _MD_USER_ERROR_REQUIRED, _AD_USER_LANG_AVATAR_NAME, '100');
51: $this->mFieldProperties['name']->addMessage('maxlength', _MD_USER_ERROR_MAXLENGTH, _AD_USER_LANG_AVATAR_NAME, '100');
52: $this->mFieldProperties['name']->addVar('maxlength', 100);
53:
54: $this->mFieldProperties['weight'] =new XCube_FieldProperty($this);
55: $this->mFieldProperties['weight']->setDependsByArray(array('required'));
56: $this->mFieldProperties['weight']->addMessage('required', _MD_USER_ERROR_REQUIRED, _AD_USER_LANG_AVATAR_WEIGHT);
57:
58: }
59: }
60:
61: ?>
62: