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