XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
RanksListForm.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.RanksSettingsForm.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['title'] =new XCube_StringArrayProperty('title');
43 $this->mFormProperties['min'] =new XCube_IntArrayProperty('min');
44 $this->mFormProperties['max'] =new XCube_IntArrayProperty('max');
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['title'] =new XCube_FieldProperty($this);
50 $this->mFieldProperties['title']->setDependsByArray(['required', 'maxlength']);
51 $this->mFieldProperties['title']->addMessage('required', _MD_USER_ERROR_REQUIRED, _AD_USER_LANG_RANK_TITLE, '50');
52 $this->mFieldProperties['title']->addMessage('maxlength', _MD_USER_ERROR_MAXLENGTH, _AD_USER_LANG_RANK_TITLE, '50');
53 $this->mFieldProperties['title']->addVar('maxlength', 50);
54
55 $this->mFieldProperties['min'] =new XCube_FieldProperty($this);
56 $this->mFieldProperties['min']->setDependsByArray(['required', 'min']);
57 $this->mFieldProperties['min']->addMessage('required', _MD_USER_ERROR_REQUIRED, _AD_USER_LANG_RANK_MIN);
58 $this->mFieldProperties['min']->addMessage('min', _AD_USER_ERROR_MIN, _AD_USER_LANG_RANK_MIN, 0);
59 $this->mFieldProperties['min']->addVar('min', 0);
60
61 $this->mFieldProperties['max'] =new XCube_FieldProperty($this);
62 $this->mFieldProperties['max']->setDependsByArray(['required', 'min']);
63 $this->mFieldProperties['max']->addMessage('required', _MD_USER_ERROR_REQUIRED, _AD_USER_LANG_RANK_MAX);
64 $this->mFieldProperties['max']->addMessage('min', _AD_USER_ERROR_MIN, _AD_USER_LANG_RANK_MAX, 0);
65 $this->mFieldProperties['max']->addVar('min', 0);
66 }
67}
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>.