XCL Web Application Platform 2.5.0
The XoopsCube Legacy Project
Loading...
Searching...
No Matches
BlockListForm.class.php
1<?php
11
12if (!defined('XOOPS_ROOT_PATH')) {
13 exit();
14}
15
16require_once XOOPS_ROOT_PATH . '/core/XCube_ActionForm.class.php';
17require_once XOOPS_MODULE_PATH . '/legacy/class/Legacy_Validator.class.php';
18
19/***
20 * @internal
21 * @public
22 * @todo We may rename this class.
23 */
25{
30 public function getTokenName()
31 {
32 //
33 //
34 if ('POST' == xoops_getenv('REQUEST_METHOD')) {
35 return 'module.legacy.BlockListForm.TOKEN';
36 } else {
37 return null;
38 }
39 }
40
45 public function getTokenErrorMessage()
46 {
47 return null;
48 }
49
50 public function prepare()
51 {
52 //
53 // Set form properties
54 //
55 $this->mFormProperties['title'] =new XCube_StringArrayProperty('title');
56 $this->mFormProperties['weight'] =new XCube_IntArrayProperty('weight');
57 $this->mFormProperties['side'] =new XCube_IntArrayProperty('side');
58 $this->mFormProperties['bcachetime'] =new XCube_IntArrayProperty('bcachetime');
59 $this->mFormProperties['uninstall']=new XCube_BoolArrayProperty('uninstall');
60 //to display error-msg at confirm-page
61 $this->mFormProperties['confirm'] =new XCube_BoolProperty('confirm');
62
63 //
64 // Set field properties
65 //
66 $this->mFieldProperties['title'] =new XCube_FieldProperty($this);
67 $this->mFieldProperties['title']->setDependsByArray(['required', 'maxlength']);
68 $this->mFieldProperties['title']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _AD_LEGACY_LANG_TITLE, '191');
69 $this->mFieldProperties['title']->addMessage('maxlength', _MD_LEGACY_ERROR_MAXLENGTH, _AD_LEGACY_LANG_TITLE, '191');
70 $this->mFieldProperties['title']->addVar('maxlength', '191');
71
72 $this->mFieldProperties['weight'] =new XCube_FieldProperty($this);
73 $this->mFieldProperties['weight']->setDependsByArray(['required', 'intRange']);
74 $this->mFieldProperties['weight']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _AD_LEGACY_LANG_WEIGHT);
75 $this->mFieldProperties['weight']->addMessage('intRange', _AD_LEGACY_ERROR_INTRANGE, _AD_LEGACY_LANG_WEIGHT);
76 $this->mFieldProperties['weight']->addVar('min', '0');
77 $this->mFieldProperties['weight']->addVar('max', '65535');
78
79 $this->mFieldProperties['side'] =new XCube_FieldProperty($this);
80 $this->mFieldProperties['side']->setDependsByArray(['required', 'objectExist']);
81 $this->mFieldProperties['side']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _AD_LEGACY_LANG_SIDE);
82 $this->mFieldProperties['side']->addMessage('objectExist', _AD_LEGACY_ERROR_OBJECTEXIST, _AD_LEGACY_LANG_SIDE);
83 $this->mFieldProperties['side']->addVar('handler', 'columnside');
84 $this->mFieldProperties['side']->addVar('module', 'legacy');
85
86 $this->mFieldProperties['bcachetime'] =new XCube_FieldProperty($this);
87 $this->mFieldProperties['bcachetime']->setDependsByArray(['required', 'objectExist']);
88 $this->mFieldProperties['bcachetime']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _AD_LEGACY_LANG_BCACHETIME);
89 $this->mFieldProperties['bcachetime']->addMessage('objectExist', _AD_LEGACY_ERROR_OBJECTEXIST, _AD_LEGACY_LANG_BCACHETIME);
90 $this->mFieldProperties['bcachetime']->addVar('handler', 'cachetime');
91 }
92}
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>.