XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
AvatarListForm.class.php
1<?php
2
3if (!defined('XOOPS_ROOT_PATH')) {
4 exit();
5}
6
7require_once XOOPS_ROOT_PATH . '/core/XCube_ActionForm.class.php';
8
14{
19 public function getTokenName()
20 {
21 //
22 //
23 if ('POST' == xoops_getenv('REQUEST_METHOD')) {
24 return 'module.user.AvatarSettingsForm.TOKEN';
25 } else {
26 return null;
27 }
28 }
29
34 public function getTokenErrorMessage()
35 {
36 return null;
37 }
38
39 public function prepare()
40 {
41 // set properties
42 $this->mFormProperties['name'] =new XCube_StringArrayProperty('name');
43 $this->mFormProperties['display'] =new XCube_BoolArrayProperty('display');
44 $this->mFormProperties['weight'] =new XCube_IntArrayProperty('weight');
45 $this->mFormProperties['delete']= new XCube_BoolArrayProperty('delete');
46 //to display error-msg at confirm-page
47 $this->mFormProperties['confirm'] =new XCube_BoolProperty('confirm');
48
49 $this->mFieldProperties['name'] =new XCube_FieldProperty($this);
50 $this->mFieldProperties['name']->setDependsByArray(['required', 'maxlength']);
51 $this->mFieldProperties['name']->addMessage('required', _MD_USER_ERROR_REQUIRED, _AD_USER_LANG_AVATAR_NAME, '100');
52 $this->mFieldProperties['name']->addMessage('maxlength', _MD_USER_ERROR_MAXLENGTH, _AD_USER_LANG_AVATAR_NAME, '100');
53 $this->mFieldProperties['name']->addVar('maxlength', 100);
54
55 $this->mFieldProperties['weight'] =new XCube_FieldProperty($this);
56 $this->mFieldProperties['weight']->setDependsByArray(['required']);
57 $this->mFieldProperties['weight']->addMessage('required', _MD_USER_ERROR_REQUIRED, _AD_USER_LANG_AVATAR_WEIGHT);
58 }
59}
prepare()
[Abstract] Set up form properties and field properties.
Represents bool[] property. XCube_GenericArrayProperty<XCube_BoolProperty>.
Represents bool property.
[Abstract] Used for validating member property values of XCube_ActionForm.
Represents int[] property. XCube_GenericArrayProperty<XCube_IntProperty>.
Represents string[] property. XCube_GenericArrayProperty<XCube_StringProperty>.