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 Legacy_ImagecategoryListForm extends XCube_ActionForm
12: {
13: 14: 15: 16:
17: function getTokenName()
18: {
19:
20:
21: if (xoops_getenv('REQUEST_METHOD') == 'POST') {
22: return "module.legacy.ImagecategorySettingsForm.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['maxsize'] =new XCube_IntArrayProperty('maxsize');
43: $this->mFormProperties['maxwidth'] =new XCube_IntArrayProperty('maxwidth');
44: $this->mFormProperties['maxheight'] =new XCube_IntArrayProperty('maxheight');
45: $this->mFormProperties['display'] =new XCube_BoolArrayProperty('display');
46: $this->mFormProperties['weight'] =new XCube_IntArrayProperty('weight');
47: $this->mFormProperties['delete']=new XCube_BoolArrayProperty('delete');
48:
49: $this->mFormProperties['confirm'] =new XCube_BoolProperty('confirm');
50:
51: $this->mFieldProperties['name'] =new XCube_FieldProperty($this);
52: $this->mFieldProperties['name']->setDependsByArray(array('required','maxlength'));
53: $this->mFieldProperties['name']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _AD_LEGACY_LANG_IMGCAT_NAME, '100');
54: $this->mFieldProperties['name']->addMessage('maxlength', _MD_LEGACY_ERROR_MAXLENGTH, _AD_LEGACY_LANG_IMGCAT_NAME, '100');
55: $this->mFieldProperties['name']->addVar('maxlength', '100');
56:
57: $this->mFieldProperties['maxsize'] =new XCube_FieldProperty($this);
58: $this->mFieldProperties['maxsize']->setDependsByArray(array('required'));
59: $this->mFieldProperties['maxsize']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _AD_LEGACY_LANG_IMGCAT_MAXSIZE);
60:
61: $this->mFieldProperties['maxwidth'] =new XCube_FieldProperty($this);
62: $this->mFieldProperties['maxwidth']->setDependsByArray(array('required'));
63: $this->mFieldProperties['maxwidth']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _AD_LEGACY_LANG_IMGCAT_MAXWIDTH);
64:
65: $this->mFieldProperties['maxheight'] =new XCube_FieldProperty($this);
66: $this->mFieldProperties['maxheight']->setDependsByArray(array('required'));
67: $this->mFieldProperties['maxheight']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _AD_LEGACY_LANG_IMGCAT_MAXHEIGHT);
68:
69: $this->mFieldProperties['weight'] =new XCube_FieldProperty($this);
70: $this->mFieldProperties['weight']->setDependsByArray(array('required'));
71: $this->mFieldProperties['weight']->addMessage('required', _MD_LEGACY_ERROR_REQUIRED, _AD_LEGACY_LANG_IMGCAT_WEIGHT);
72:
73: }
74: }
75:
76: ?>
77: