Minahito
minah****@users*****
2006年 10月 14日 (土) 23:55:21 JST
Index: xoops2jp/html/modules/legacy/admin/forms/SmilesFilterForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/SmilesFilterForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/SmilesFilterForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,59 @@ +<?php + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_MODULE_PATH . "/base/class/AbstractFilterForm.class.php"; + +define('SMILES_SORT_KEY_ID', 1); +define('SMILES_SORT_KEY_CODE', 2); +define('SMILES_SORT_KEY_SMILE_URL', 3); +define('SMILES_SORT_KEY_EMOTION', 4); +define('SMILES_SORT_KEY_DISPLAY', 5); + +define('SMILES_SORT_KEY_DEFAULT', -SMILES_SORT_KEY_DISPLAY); +define('SMILES_SORT_KEY_MAXVALUE', 5); + +class Legacy_SmilesFilterForm extends Legacy_AbstractFilterForm +{ + var $mSortKeys = array( + SMILES_SORT_KEY_ID => 'id', + SMILES_SORT_KEY_CODE => 'code', + SMILES_SORT_KEY_SMILE_URL => 'smile_url', + SMILES_SORT_KEY_EMOTION => 'emotion', + SMILES_SORT_KEY_DISPLAY => 'display' + ); + + function getDefaultSortKey() + { + return SMILES_SORT_KEY_DEFAULT; + } + + function fetch() + { + parent::fetch(); + + if (isset($_REQUEST['code'])) { + $this->mNavi->addExtra('code', xoops_getrequest('code')); + $this->_mCriteria->add(new Criteria('code', xoops_getrequest('code'))); + } + + if (isset($_REQUEST['smile_url'])) { + $this->mNavi->addExtra('smile_url', xoops_getrequest('smile_url')); + $this->_mCriteria->add(new Criteria('smile_url', xoops_getrequest('smile_url'))); + } + + if (isset($_REQUEST['emotion'])) { + $this->mNavi->addExtra('emotion', xoops_getrequest('emotion')); + $this->_mCriteria->add(new Criteria('emotion', xoops_getrequest('emotion'))); + } + + if (isset($_REQUEST['display'])) { + $this->mNavi->addExtra('display', xoops_getrequest('display')); + $this->_mCriteria->add(new Criteria('display', xoops_getrequest('display'))); + } + + $this->_mCriteria->addSort($this->getSort(), $this->getOrder()); + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/SmilesAdminEditForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/SmilesAdminEditForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/SmilesAdminEditForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,91 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; + +class Legacy_SmilesAdminEditForm extends XCube_ActionForm +{ + var $mOldFileName = null; + var $_mIsNew = null; + var $mFormFile = null; + + function getTokenName() + { + return "module.base.SmilesAdminEditForm.TOKEN" . $this->get('id'); + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['id'] =& new XCube_IntProperty('id'); + $this->mFormProperties['code'] =& new XCube_StringProperty('code'); + $this->mFormProperties['smile_url'] =& new XCube_ImageFileProperty('smile_url'); + $this->mFormProperties['emotion'] =& new XCube_StringProperty('emotion'); + $this->mFormProperties['display'] =& new XCube_BoolProperty('display'); + + // + // Set field properties + // + $this->mFieldProperties['id'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['id']->setDependsByArray(array('required')); + $this->mFieldProperties['id']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_ID); + + $this->mFieldProperties['code'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['code']->setDependsByArray(array('required','maxlength')); + $this->mFieldProperties['code']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _MD_BASE_LANG_CODE, '50'); + $this->mFieldProperties['code']->addMessage('maxlength', _MD_BASE_ERROR_MAXLENGTH, _MD_BASE_LANG_CODE, '50'); + $this->mFieldProperties['code']->addVar('maxlength', '50'); + + $this->mFieldProperties['smile_url'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['smile_url']->setDependsByArray(array('extension')); + $this->mFieldProperties['smile_url']->addMessage('extension', _AD_BASE_ERROR_EXTENSION); + $this->mFieldProperties['smile_url']->addVar('extension', 'jpg,gif,png'); + + $this->mFieldProperties['emotion'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['emotion']->setDependsByArray(array('required','maxlength')); + $this->mFieldProperties['emotion']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _MD_BASE_LANG_EMOTION, '75'); + $this->mFieldProperties['emotion']->addMessage('maxlength', _MD_BASE_ERROR_MAXLENGTH, _MD_BASE_LANG_EMOTION, '75'); + $this->mFieldProperties['emotion']->addVar('maxlength', '75'); + } + + function validateSmile_url() + { + if ($this->_mIsNew && $this->get('smile_url') == null) { + $this->addErrorMessage(XCube_Utils::formatMessage(_MD_BASE_ERROR_REQUIRED, _MD_BASE_LANG_SMILE_URL)); + } + } + + function load(&$obj) + { + $this->set('id', $obj->get('id')); + $this->set('code', $obj->get('code')); + $this->set('emotion', $obj->get('emotion')); + $this->set('display', $obj->get('display')); + + $this->_mIsNew = $obj->isNew(); + $this->mOldFileName = $obj->get('smile_url'); + } + + function update(&$obj) + { + $obj->set('id', $this->get('id')); + $obj->set('code', $this->get('code')); + $obj->set('emotion', $this->get('emotion')); + $obj->set('display', $this->get('display')); + + $this->mFormFile = $this->get('smile_url'); + if ($this->mFormFile != null) { + $this->mFormFile->setRandomToBodyName('smil'); // Fix your prefix + $obj->set('smile_url', $this->mFormFile->getFileName()); + } + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/ImageAdminDeleteForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/ImageAdminDeleteForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/ImageAdminDeleteForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,45 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; +require_once XOOPS_MODULE_PATH . "/base/class/Legacy_Validator.class.php"; + +class Legacy_ImageAdminDeleteForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.base.ImageAdminDeleteForm.TOKEN" . $this->get('image_id'); + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['image_id'] =& new XCube_IntProperty('image_id'); + + // + // Set field properties + // + $this->mFieldProperties['image_id'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['image_id']->setDependsByArray(array('required')); + $this->mFieldProperties['image_id']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_IMAGE_ID); + } + + function load(&$obj) + { + $this->set('image_id', $obj->get('image_id')); + } + + function update(&$obj) + { + $obj->set('image_id', $this->get('image_id')); + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/ThemeSelectForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/ThemeSelectForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/ThemeSelectForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,63 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; + +/** + * This class is generated by makeActionForm tool. + */ +class Legacy_ThemeSelectForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.base.ThemeSelectForm.TOKEN"; + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['select'] =& new XCube_BoolArrayProperty('select'); + $this->mFormProperties['choose'] =& new XCube_StringArrayProperty('choose'); + } + + /** + * @access public + */ + function getChooseTheme() + { + foreach ($this->get('choose') as $dirname => $dmy) { + return $dirname; + } + + return null; + } + + function getSelectableTheme() + { + $ret = array(); + + foreach ($this->get('select') as $themeName => $isSelect) { + if ($isSelect == 1) { + $ret[] = $themeName; + } + } + + return $ret; + } + + function load(&$themeArr) + { + foreach ($themeArr as $themeName) { + $this->set('select', $themeName, 1); + } + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/BlockInstallFilterForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/BlockInstallFilterForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/BlockInstallFilterForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,19 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_MODULE_PATH . "/base/admin/forms/BlockFilterForm.class.php"; + +class Legacy_BlockInstallFilterForm extends Legacy_BlockFilterForm +{ + function _getVisible() + { + return 0; + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/ModuleListForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/ModuleListForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/ModuleListForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,63 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH."/core/XCube_ActionForm.class.php"; + +/** + * This class is generated by makeActionForm tool. + * @auchor makeActionForm + */ +class Legacy_ModuleListForm extends XCube_ActionForm +{ + /** + * If the request is GET, never return token name. + * By this logic, a action can have three page in one action. + */ + function getTokenName() + { + // + // + if ($_SERVER['REQUEST_METHOD'] == 'POST') { + return "module.legacy.ModuleSettingsForm.TOKEN"; + } + else { + return null; + } + } + + /** + * For displaying the confirm-page, don't show CSRF error. + * Always return null. + */ + function getTokenErrorMessage() + { + return null; + } + + function prepare() + { + // set properties + $this->mFormProperties['name']=new XCube_StringArrayProperty('name'); + $this->mFormProperties['weight']=new XCube_IntArrayProperty('weight'); + $this->mFormProperties['isactive']=new XCube_BoolArrayProperty('isactive'); + + // set fields + $this->mFieldProperties['name']=new XCube_FieldProperty($this); + $this->mFieldProperties['name']->setDependsByArray(array('required','maxlength')); + $this->mFieldProperties['name']->addMessage("required",_MD_BASE_ERROR_REQUIRED,_AD_BASE_LANG_NAME,"140"); + $this->mFieldProperties['name']->addMessage("maxlength",_MD_BASE_ERROR_MAXLENGTH,_AD_BASE_LANG_NAME,"140"); + $this->mFieldProperties['name']->addVar("maxlength",140); + + $this->mFieldProperties['weight']=new XCube_FieldProperty($this); + $this->mFieldProperties['weight']->setDependsByArray(array('required','min')); + $this->mFieldProperties['weight']->addMessage("min",_AD_BASE_ERROR_MIN,_AD_BASE_LANG_WEIGHT,"0"); + $this->mFieldProperties['weight']->addVar("min",0); + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/BlockFilterForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/BlockFilterForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/BlockFilterForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,122 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_MODULE_PATH . "/base/class/AbstractFilterForm.class.php"; + +define('NEWBLOCKS_SORT_KEY_BID', 1); +define('NEWBLOCKS_SORT_KEY_MID', 2); +define('NEWBLOCKS_SORT_KEY_FUNC_NUM', 3); +define('NEWBLOCKS_SORT_KEY_OPTIONS', 4); +define('NEWBLOCKS_SORT_KEY_NAME', 5); +define('NEWBLOCKS_SORT_KEY_TITLE', 6); +define('NEWBLOCKS_SORT_KEY_CONTENT', 7); +define('NEWBLOCKS_SORT_KEY_SIDE', 8); +define('NEWBLOCKS_SORT_KEY_WEIGHT', 9); +define('NEWBLOCKS_SORT_KEY_VISIBLE', 10); +define('NEWBLOCKS_SORT_KEY_BLOCK_TYPE', 11); +define('NEWBLOCKS_SORT_KEY_C_TYPE', 12); +define('NEWBLOCKS_SORT_KEY_ISACTIVE', 13); +define('NEWBLOCKS_SORT_KEY_DIRNAME', 14); +define('NEWBLOCKS_SORT_KEY_FUNC_FILE', 15); +define('NEWBLOCKS_SORT_KEY_SHOW_FUNC', 16); +define('NEWBLOCKS_SORT_KEY_EDIT_FUNC', 17); +define('NEWBLOCKS_SORT_KEY_TEMPLATE', 18); +define('NEWBLOCKS_SORT_KEY_BCACHETIME', 19); +define('NEWBLOCKS_SORT_KEY_LAST_MODIFIED', 20); + +define('NEWBLOCKS_SORT_KEY_DEFAULT', NEWBLOCKS_SORT_KEY_SIDE); +define('NEWBLOCKS_SORT_KEY_MAXVALUE', 20); + +class Legacy_BlockFilterForm extends Legacy_AbstractFilterForm +{ + var $mSortKeys = array( + NEWBLOCKS_SORT_KEY_BID => 'bid', + NEWBLOCKS_SORT_KEY_MID => 'mid', + NEWBLOCKS_SORT_KEY_FUNC_NUM => 'func_num', + NEWBLOCKS_SORT_KEY_NAME => 'name', + NEWBLOCKS_SORT_KEY_TITLE => 'title', + NEWBLOCKS_SORT_KEY_SIDE => 'side', + NEWBLOCKS_SORT_KEY_WEIGHT => 'weight', + NEWBLOCKS_SORT_KEY_BLOCK_TYPE => 'block_type', + NEWBLOCKS_SORT_KEY_C_TYPE => 'c_type', + NEWBLOCKS_SORT_KEY_DIRNAME => 'dirname', + NEWBLOCKS_SORT_KEY_TEMPLATE => 'template', + NEWBLOCKS_SORT_KEY_BCACHETIME => 'bcachetime', + NEWBLOCKS_SORT_KEY_LAST_MODIFIED => 'last_modified' + ); + + function getDefaultSortKey() + { + return NEWBLOCKS_SORT_KEY_DEFAULT; + } + + function fetch() + { + parent::fetch(); + + if (isset($_REQUEST['mid'])) { + $this->mNavi->addExtra('mid', xoops_getrequest('mid')); + $this->_mCriteria->add(new Criteria('mid', xoops_getrequest('mid'))); + } + + if (isset($_REQUEST['side'])) { + $this->mNavi->addExtra('side', xoops_getrequest('side')); + $this->_mCriteria->add(new Criteria('side', xoops_getrequest('side'))); + } + + if (isset($_REQUEST['weight'])) { + $this->mNavi->addExtra('weight', xoops_getrequest('weight')); + $this->_mCriteria->add(new Criteria('weight', xoops_getrequest('weight'))); + } + + if (isset($_REQUEST['block_type'])) { + $this->mNavi->addExtra('block_type', xoops_getrequest('block_type')); + $this->_mCriteria->add(new Criteria('block_type', xoops_getrequest('block_type'))); + } + + if (isset($_REQUEST['c_type'])) { + $this->mNavi->addExtra('c_type', xoops_getrequest('c_type')); + $this->_mCriteria->add(new Criteria('c_type', xoops_getrequest('c_type'))); + } + + if (isset($_REQUEST['dirname'])) { + $this->mNavi->addExtra('dirname', xoops_getrequest('dirname')); + $this->_mCriteria->add(new Criteria('dirname', xoops_getrequest('dirname'))); + } + + $this->_mCriteria->add(new Criteria('visible', $this->_getVisible())); + $this->_mCriteria->add(new Criteria('isactive', 1)); + + // + // Set sort conditions. + // + $this->_mCriteria->addSort($this->getSort(), $this->getOrder()); + + // + // If the sort key is mid, set c_type to second sort key for list display. + // + if (abs($this->mSort) == NEWBLOCKS_SORT_KEY_MID) { + $this->_mCriteria->addSort('c_type', $this->getOrder()); + } + + if (abs($this->mSort) != NEWBLOCKS_SORT_KEY_SIDE) { + $this->_mCriteria->addSort('side', $this->getOrder()); + } + + if (abs($this->mSort) != NEWBLOCKS_SORT_KEY_WEIGHT) { + $this->_mCriteria->addSort('weight', $this->getOrder()); + } + } + + function _getVisible() + { + return 1; + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/CommentAdminDeleteForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/CommentAdminDeleteForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/CommentAdminDeleteForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,47 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; + +/** + * This class is generated by makeActionForm tool. + */ +class Legacy_CommentAdminDeleteForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.base.XoopscommentsAdminDeleteForm.TOKEN" . $this->get('com_id'); + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['com_id'] =& new XCube_IntProperty('com_id'); + + // + // Set field properties + // + $this->mFieldProperties['com_id'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['com_id']->setDependsByArray(array('required')); + $this->mFieldProperties['com_id']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _MD_BASE_LANG_COM_ID); + } + + function load(&$obj) + { + $this->setVar('com_id', $obj->get('com_id')); + } + + function update(&$obj) + { + $obj->setVar('com_id', $this->get('com_id')); + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/BlockEditForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/BlockEditForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/BlockEditForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,141 @@ +<?php + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; +require_once XOOPS_MODULE_PATH . "/base/class/Legacy_Validator.class.php"; + +class Legacy_BlockEditForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.base.BlockEditForm.TOKEN" . $this->get('bid'); + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['bid'] =& new XCube_IntProperty('bid'); + $this->mFormProperties['options'] =& new XCube_StringArrayProperty('options'); + $this->mFormProperties['title'] =& new XCube_StringProperty('title'); + $this->mFormProperties['side'] =& new XCube_IntProperty('side'); + $this->mFormProperties['weight'] =& new XCube_IntProperty('weight'); + $this->mFormProperties['bcachetime'] =& new XCube_IntProperty('bcachetime'); + $this->mFormProperties['bmodule'] =& new XCube_IntArrayProperty('bmodule'); + $this->mFormProperties['groupid'] =& new XCube_IntArrayProperty('groupid'); + + // + // Set field properties + // + $this->mFieldProperties['bid'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['bid']->setDependsByArray(array('required')); + $this->mFieldProperties['bid']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_BID); + + $this->mFieldProperties['title'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['title']->setDependsByArray(array('required','maxlength')); + $this->mFieldProperties['title']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_TITLE, '255'); + $this->mFieldProperties['title']->addMessage('maxlength', _MD_BASE_ERROR_MAXLENGTH, _AD_BASE_LANG_TITLE, '255'); + $this->mFieldProperties['title']->addVar('maxlength', '255'); + + $this->mFieldProperties['side'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['side']->setDependsByArray(array('required', 'objectExist')); + $this->mFieldProperties['side']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_SIDE); + $this->mFieldProperties['side']->addMessage('objectExist', _AD_BASE_ERROR_OBJECTEXIST, _AD_BASE_LANG_SIDE); + $this->mFieldProperties['side']->addVar('handler', 'columnside'); + $this->mFieldProperties['side']->addVar('module', 'base'); + + $this->mFieldProperties['weight'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['weight']->setDependsByArray(array('required', 'intRange')); + $this->mFieldProperties['weight']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_WEIGHT); + $this->mFieldProperties['weight']->addMessage('intRange', _AD_BASE_ERROR_INTRANGE, _AD_BASE_LANG_WEIGHT); + $this->mFieldProperties['weight']->addVar('min', '0'); + $this->mFieldProperties['weight']->addVar('max', '255'); + + $this->mFieldProperties['bcachetime'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['bcachetime']->setDependsByArray(array('required', 'objectExist')); + $this->mFieldProperties['bcachetime']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_BCACHETIME); + $this->mFieldProperties['bcachetime']->addMessage('objectExist', _AD_BASE_ERROR_OBJECTEXIST, _AD_BASE_LANG_BCACHETIME); + $this->mFieldProperties['bcachetime']->addVar('handler', 'cachetime'); + + $this->mFieldProperties['groupid'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['groupid']->setDependsByArray(array('objectExist')); + $this->mFieldProperties['groupid']->addMessage('objectExist', _AD_BASE_ERROR_OBJECTEXIST, _AD_BASE_LANG_GROUPID); + $this->mFieldProperties['groupid']->addVar('handler', 'group'); + } + + function validateBmodule() + { + $bmodule = $this->get('bmodule'); + if (!(count($bmodule))) { + $this->addErrorMessage(_AD_BASE_ERROR_BMODULE); + } + else { + $handler =& xoops_gethandler('module'); + foreach ($this->get('bmodule') as $mid) { + $module =& $handler->get($mid); + if ($mid != -1 && $mid != 0 && !is_object($module)) { + $this->addErrorMessage(XCube_Utils::formatMessage(_AD_BASE_ERROR_OBJECTEXIST, _AD_BASE_LANG_BMODULE)); + } + } + } + } + + function validateGroupid() + { + $groupid = $this->get('groupid'); + if (!(count($groupid))) { + $this->addErrorMessage(_AD_BASE_ERROR_GROUPID); + } + } + + function load(&$obj) + { + $this->set('bid', $obj->get('bid')); + $this->set('title', $obj->get('title')); + $this->set('side', $obj->get('side')); + $this->set('weight', $obj->get('weight')); + $this->set('bcachetime', $obj->get('bcachetime')); + + $i = 0; + foreach ($obj->mBmodule as $module) { + $this->set('bmodule', $i++, $module->get('module_id')); + } + + $i = 0; + foreach ($obj->mGroup as $group) { + $this->set('groupid', $i++, $group->get('groupid')); + } + } + + function update(&$obj) + { + $obj->set('bid', $this->get('bid')); + $obj->set('options', implode('|', $this->get('options'))); + $obj->set('title', $this->get('title')); + $obj->set('side', $this->get('side')); + $obj->set('weight', $this->get('weight')); + $obj->set('bcachetime', $this->get('bcachetime')); + + $obj->set('last_modified', time()); + + $obj->mBmodule = array(); + $handler =& xoops_getmodulehandler('block_module_link', 'base'); + foreach ($this->get('bmodule') as $mid) { + $t_obj =& $handler->create(); + $t_obj->set('block_id', $this->get('bid')); + $t_obj->set('module_id', $mid); + $obj->mBmodule[] =& $t_obj; + unset($t_obj); + } + + $obj->mGroup = array(); + $handler =& xoops_gethandler('group'); + foreach ($this->get('groupid') as $groupid) { + $obj->mGroup[] =& $handler->get($groupid); + } + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/PreferenceEditForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/PreferenceEditForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/PreferenceEditForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,145 @@ +<?php + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; + +class Legacy_PreferenceEditForm extends XCube_ActionForm +{ + var $mKeyName = "confcat_id"; + var $mKeyValue = 0; + + function Legacy_PreferenceEditForm(&$category) + { + parent::XCube_ActionForm(); + $this->mKeyValue = $category->get('confcat_id'); + } + + function getTokenName() + { + return "module.base.PreferenceEditForm.TOKEN" . $this->getCategoryId(); + } + + function getCategoryId() + { + return $this->mKeyValue; + } + + function getModuleId() + { + return 0; + } + + function prepare(&$configArr) + { + // + // Set form properties + // + foreach ($configArr as $config) { + switch ($config->get('conf_valuetype')) { + case 'text': + case 'string': + if ($config->get('conf_formtype') == 'textarea') { + $this->mFormProperties[$config->get('conf_name')] =& new XCube_TextProperty($config->get('conf_name')); + } + else { + $this->mFormProperties[$config->get('conf_name')] =& new XCube_StringProperty($config->get('conf_name')); + } + $this->set($config->get('conf_name'), $config->get('conf_value')); + break; + + case 'float': + $this->mFormProperties[$config->get('conf_name')] =& new XCube_FloatProperty($config->get('conf_name')); + $this->set($config->get('conf_name'), $config->get('conf_value')); + + $this->mFieldProperties[$config->get('conf_name')] =& new XCube_FieldProperty($this); + $this->mFieldProperties[$config->get('conf_name')]->setDependsByArray(array('required')); + $this->mFieldProperties[$config->get('conf_name')]->addMessage('required', _MD_BASE_ERROR_REQUIRED, $config->get('conf_title')); + break; + + case 'int': + $this->mFormProperties[$config->get('conf_name')] =& new XCube_IntProperty($config->get('conf_name')); + $this->set($config->get('conf_name'), $config->get('conf_value')); + + $this->mFieldProperties[$config->get('conf_name')] =& new XCube_FieldProperty($this); + $this->mFieldProperties[$config->get('conf_name')]->setDependsByArray(array('required')); + $this->mFieldProperties[$config->get('conf_name')]->addMessage('required', _MD_BASE_ERROR_REQUIRED, $config->get('conf_title')); + break; + + case 'other': + $this->mFormProperties[$config->get('conf_name')] =& new XCube_StringProperty($config->get('conf_name')); + $this->set($config->get('conf_name'), $config->get('conf_value')); + break; + + case 'array': + if($config->get('conf_formtype') == 'textarea') { + $this->mFormProperties[$config->get('conf_name')] =& new XCube_StringProperty($config->get('conf_name')); + $this->set($config->get('conf_name'), implode("|", unserialize($config->get('conf_value')))); + } + else { + $this->mFormProperties[$config->get('conf_name')] =& new XCube_StringArrayProperty($config->get('conf_name')); + $t_arr = unserialize($config->get('conf_value')); + if (is_array($t_arr)) { + foreach ($t_arr as $_key => $_value) { + $this->set($config->get('conf_name'), $_key, $_value); + } + } + } + break; + } + } + } + + function getImploadValue($key) + { + $value = $this->get($key); + return is_array($value) ? implode("|", $value) : $value; + } + + function update(&$configArr) + { + foreach (array_keys($configArr) as $key) { + $value = $this->get($configArr[$key]->get('conf_name')); + + if ($configArr[$key]->get('conf_valuetype') == 'array') { + if (is_array($value)) { + $configArr[$key]->set('conf_value', serialize($value)); + } + else { + $configArr[$key]->set('conf_value', serialize(explode("|", $value))); + } + } + else { + $configArr[$key]->set('conf_value', $value); + } + } + } +} + +class Legacy_ModulePreferenceEditForm extends Legacy_PreferenceEditForm +{ + var $mKeyName = "confmod_id"; + + function Legacy_ModulePreferenceEditForm(&$module) + { + parent::XCube_ActionForm(); + $this->mKeyValue = $module->get('mid'); + } + + function getTokenName() + { + return "module.base.ModulePreferenceEditForm.TOKEN" . $this->getModuleId(); + } + + function getCategoryId() + { + return 0; + } + + function getModuleId() + { + return $this->mKeyValue; + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/ModuleUpdateForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/ModuleUpdateForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/ModuleUpdateForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,34 @@ +<?php + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; + +class Legacy_ModuleUpdateForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.legacy.ModuleUpdateForm.TOKEN." . $this->get('dirname'); + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['dirname'] =& new XCube_StringProperty('dirname'); + $this->mFormProperties['force'] =& new XCube_BoolProperty('force'); + } + + function load(&$obj) + { + $this->set('dirname', $obj->get('dirname')); + } + + function update(&$obj) + { + $obj->set('dirname', $this->get('dirname')); + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/BlockListForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/BlockListForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/BlockListForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,56 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; +require_once XOOPS_MODULE_PATH . "/base/class/Legacy_Validator.class.php"; + +/** + * @todo We may rename this class. + */ +class Legacy_BlockListForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.base.BlockListForm.TOKEN"; + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['weight'] =& new XCube_IntArrayProperty('weight'); + $this->mFormProperties['side'] =& new XCube_IntArrayProperty('side'); + $this->mFormProperties['bcachetime'] =& new XCube_IntArrayProperty('bcachetime'); + + // + // Set field properties + // + $this->mFieldProperties['weight'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['weight']->setDependsByArray(array('required','intRange')); + $this->mFieldProperties['weight']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_WEIGHT); + $this->mFieldProperties['weight']->addMessage('intRange', _AD_BASE_ERROR_INTRANGE, _AD_BASE_LANG_WEIGHT); + $this->mFieldProperties['weight']->addVar('min', '0'); + $this->mFieldProperties['weight']->addVar('max', '255'); + + $this->mFieldProperties['side'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['side']->setDependsByArray(array('required','objectExist')); + $this->mFieldProperties['side']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_SIDE); + $this->mFieldProperties['side']->addMessage('objectExist', _AD_BASE_ERROR_OBJECTEXIST, _AD_BASE_LANG_SIDE); + $this->mFieldProperties['side']->addVar('handler', 'columnside'); + $this->mFieldProperties['side']->addVar('module', 'base'); + + $this->mFieldProperties['bcachetime'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['bcachetime']->setDependsByArray(array('required','objectExist')); + $this->mFieldProperties['bcachetime']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_BCACHETIME); + $this->mFieldProperties['bcachetime']->addMessage('objectExist', _AD_BASE_ERROR_OBJECTEXIST, _AD_BASE_LANG_BCACHETIME); + $this->mFieldProperties['bcachetime']->addVar('handler', 'cachetime'); + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/ImageAdminEditForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/ImageAdminEditForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/ImageAdminEditForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,80 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; +require_once XOOPS_MODULE_PATH . "/base/class/Legacy_Validator.class.php"; +require_once XOOPS_MODULE_PATH . "/base/forms/ImageUploadForm.class.php"; + +class Legacy_ImageAdminCreateForm extends Legacy_ImageUploadForm +{ + var $_mImgcatId = 0; + + function getTokenName() + { + return "module.base.ImageAdminEditForm.TOKEN" . $this->get('image_id'); + } + + function prepare() + { + parent::prepare(); + + // + // Set form properties + // + $this->mFormProperties['image_id'] =& new XCube_IntProperty('image_id'); + $this->mFormProperties['image_display'] =& new XCube_BoolProperty('image_display'); + $this->mFormProperties['image_weight'] =& new XCube_IntProperty('image_weight'); + + // + // Set field properties + // + $this->mFieldProperties['image_id'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['image_id']->setDependsByArray(array('required')); + $this->mFieldProperties['image_id']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_IMAGE_ID); + + $this->mFieldProperties['image_weight'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['image_weight']->setDependsByArray(array('required')); + $this->mFieldProperties['image_weight']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_IMAGE_WEIGHT); + } + + function load(&$obj) + { + parent::load($obj); + $this->set('image_id', $obj->get('image_id')); + $this->set('image_display', $obj->get('image_display')); + $this->set('image_weight', $obj->get('image_weight')); + + $this->_mImgcatId = $obj->get('imgcat_id'); + } + + function update(&$obj) + { + parent::update($obj); + $obj->set('image_id', $this->get('image_id')); + $obj->set('image_display', $this->get('image_display')); + $obj->set('image_weight', $this->get('image_weight')); + } +} + +class Legacy_ImageAdminEditForm extends Legacy_ImageAdminCreateForm +{ + function validateImgcat_id() + { + parent::validateImgcat_id(); + + $handler =& xoops_getmodulehandler('imagecategory', 'base'); + $currentCategory =& $handler->get($this->_mImgcatId); + + $specificCategory =& $handler->get($this->get('imgcat_id')); + if ($currentCategory->get('imgcat_storetype') != $specificCategory->get('imgcat_storetype')) { + $this->set('imgcat_id', $this->_mImgcatId); + } + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/ModuleUninstallForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/ModuleUninstallForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/ModuleUninstallForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,34 @@ +<?php + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; + +class Legacy_ModuleUninstallForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.legacy.ModuleUninstallForm.TOKEN." . $this->get('dirname'); + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['dirname'] =& new XCube_StringProperty('dirname'); + $this->mFormProperties['force'] =& new XCube_BoolProperty('force'); + } + + function load(&$obj) + { + $this->set('dirname', $obj->get('dirname')); + } + + function update(&$obj) + { + $obj->set('dirname', $this->get('dirname')); + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/InstallWizardForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/InstallWizardForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/InstallWizardForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,46 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; + +class Legacy_InstallWizardForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.base.InstallWizardForm.TOKEN." . $this->get('dirname'); + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['dirname'] =& new XCube_StringProperty('dirname'); + $this->mFormProperties['agree'] =& new XCube_BoolProperty('agree'); + + // + // Set field properties + // + $this->mFieldProperties['agree'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['agree']->setDependsByArray(array('min')); + $this->mFieldProperties['agree']->addMessage('min', _AD_BASE_ERROR_PLEASE_AGREE); + $this->mFieldProperties['agree']->addVar('min', '1'); + } + + function load(&$obj) + { + $this->set('dirname', $obj->get('dirname')); + } + + function update(&$obj) + { + $obj->set('dirname', $this->get('dirname')); + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/ImagecategoryAdminDeleteForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/ImagecategoryAdminDeleteForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/ImagecategoryAdminDeleteForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,45 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; +require_once XOOPS_MODULE_PATH . "/base/class/Legacy_Validator.class.php"; + +class Legacy_ImagecategoryAdminDeleteForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.base.ImagecategoryAdminDeleteForm.TOKEN" . $this->get('imgcat_id'); + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['imgcat_id'] =& new XCube_IntProperty('imgcat_id'); + + // + // Set field properties + // + $this->mFieldProperties['imgcat_id'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['imgcat_id']->setDependsByArray(array('required')); + $this->mFieldProperties['imgcat_id']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_IMGCAT_ID); + } + + function load(&$obj) + { + $this->set('imgcat_id', $obj->get('imgcat_id')); + } + + function update(&$obj) + { + $obj->set('imgcat_id', $this->get('imgcat_id')); + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/BlockUninstallForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/BlockUninstallForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/BlockUninstallForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,26 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_MODULE_PATH . "/base/admin/forms/CustomBlockDeleteForm.class.php"; + +class Legacy_BlockUninstallForm extends Legacy_CustomBlockDeleteForm +{ + function getTokenName() + { + return "module.base.BlockUninstallForm.TOKEN" . $this->get('bid'); + } + + function update(&$obj) + { + parent::update($obj); + $obj->set('last_modified', time()); + $obj->set('visible', false); + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/CommentAdminEditForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/CommentAdminEditForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/CommentAdminEditForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,121 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; + +class Legacy_AbstractCommentAdminEditForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.base.CommentAdminEditForm.TOKEN" . $this->get('com_id'); + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['com_id'] =& new XCube_IntProperty('com_id'); + $this->mFormProperties['com_icon'] =& new XCube_StringProperty('com_icon'); + $this->mFormProperties['com_title'] =& new XCube_StringProperty('com_title'); + $this->mFormProperties['com_text'] =& new XCube_TextProperty('com_text'); + $this->mFormProperties['com_sig'] =& new XCube_BoolProperty('com_sig'); + $this->mFormProperties['com_status'] =& new XCube_IntProperty('com_status'); + $this->mFormProperties['dohtml'] =& new XCube_BoolProperty('dohtml'); + $this->mFormProperties['dosmiley'] =& new XCube_BoolProperty('dosmiley'); + $this->mFormProperties['doxcode'] =& new XCube_BoolProperty('doxcode'); + $this->mFormProperties['doimage'] =& new XCube_BoolProperty('doimage'); + $this->mFormProperties['dobr'] =& new XCube_BoolProperty('dobr'); + + // + // Set field properties + // + + $this->mFieldProperties['com_id'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['com_id']->setDependsByArray(array('required')); + $this->mFieldProperties['com_id']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _MD_BASE_LANG_COM_ID); + + $this->mFieldProperties['com_icon'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['com_icon']->setDependsByArray(array('maxlength')); + $this->mFieldProperties['com_icon']->addMessage('maxlength', _MD_BASE_ERROR_MAXLENGTH, _MD_BASE_LANG_COM_ICON, '25'); + $this->mFieldProperties['com_icon']->addVar('maxlength', '25'); + + $this->mFieldProperties['com_title'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['com_title']->setDependsByArray(array('required','maxlength')); + $this->mFieldProperties['com_title']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _MD_BASE_LANG_COM_TITLE, '255'); + $this->mFieldProperties['com_title']->addMessage('maxlength', _MD_BASE_ERROR_MAXLENGTH, _MD_BASE_LANG_COM_TITLE, '255'); + $this->mFieldProperties['com_title']->addVar('maxlength', '255'); + + $this->mFieldProperties['com_text'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['com_text']->setDependsByArray(array('required')); + $this->mFieldProperties['com_text']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _MD_BASE_LANG_COM_TEXT); + } + + function load(&$obj) + { + $this->set('com_id', $obj->get('com_id')); + $this->set('com_icon', $obj->get('com_icon')); + $this->set('com_title', $obj->get('com_title')); + $this->set('com_text', $obj->get('com_text')); + $this->set('com_sig', $obj->get('com_sig')); + $this->set('com_status', $obj->get('com_status')); + $this->set('dohtml', $obj->get('dohtml')); + $this->set('dosmiley', $obj->get('dosmiley')); + $this->set('doxcode', $obj->get('doxcode')); + $this->set('doimage', $obj->get('doimage')); + $this->set('dobr', $obj->get('dobr')); + } + + function update(&$obj) + { + $obj->set('com_id', $this->get('com_id')); + $obj->set('com_icon', $this->get('com_icon')); + $obj->set('com_title', $this->get('com_title')); + $obj->set('com_text', $this->get('com_text')); + $obj->set('com_sig', $this->get('com_sig')); + $obj->set('com_status', $this->get('com_status')); + $obj->set('dohtml', $this->get('dohtml')); + $obj->set('dosmiley', $this->get('dosmiley')); + $obj->set('doxcode', $this->get('doxcode')); + $obj->set('doimage', $this->get('doimage')); + $obj->set('dobr', $this->get('dobr')); + } +} + +class Legacy_PendingCommentAdminEditForm extends Legacy_AbstractCommentAdminEditForm +{ + function prepare() + { + parent::prepare(); + + $this->mFieldProperties['com_status'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['com_status']->setDependsByArray(array('required','intRange')); + $this->mFieldProperties['com_status']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_COM_STATUS); + $this->mFieldProperties['com_status']->addMessage('intRange', _AD_BASE_ERROR_INTRANGE, _AD_BASE_LANG_COM_STATUS); + $this->mFieldProperties['com_status']->addVar('min', '1'); + $this->mFieldProperties['com_status']->addVar('max', '3'); + } +} + +class Legacy_ApprovalCommentAdminEditForm extends Legacy_AbstractCommentAdminEditForm +{ + function prepare() + { + parent::prepare(); + + $this->mFieldProperties['com_status'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['com_status']->setDependsByArray(array('required','intRange')); + $this->mFieldProperties['com_status']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_COM_STATUS); + $this->mFieldProperties['com_status']->addMessage('intRange', _AD_BASE_ERROR_INTRANGE, _AD_BASE_LANG_COM_STATUS); + $this->mFieldProperties['com_status']->addVar('min', '2'); + $this->mFieldProperties['com_status']->addVar('max', '3'); + } +} + + +?> Index: xoops2jp/html/modules/legacy/admin/forms/CommentFilterForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/CommentFilterForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/CommentFilterForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,107 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_MODULE_PATH . "/base/class/AbstractFilterForm.class.php"; + +define('COMMENT_SORT_KEY_COM_ID', 1); +define('COMMENT_SORT_KEY_COM_PID', 2); +define('COMMENT_SORT_KEY_COM_ROOTID', 3); +define('COMMENT_SORT_KEY_COM_MODID', 4); +define('COMMENT_SORT_KEY_COM_ITEMID', 5); +define('COMMENT_SORT_KEY_COM_ICON', 6); +define('COMMENT_SORT_KEY_COM_CREATED', 7); +define('COMMENT_SORT_KEY_COM_MODIFIED', 8); +define('COMMENT_SORT_KEY_COM_UID', 9); +define('COMMENT_SORT_KEY_COM_IP', 10); +define('COMMENT_SORT_KEY_COM_TITLE', 11); +define('COMMENT_SORT_KEY_COM_TEXT', 12); +define('COMMENT_SORT_KEY_COM_SIG', 13); +define('COMMENT_SORT_KEY_COM_STATUS', 14); +define('COMMENT_SORT_KEY_COM_EXPARAMS', 15); +define('COMMENT_SORT_KEY_DOHTML', 16); +define('COMMENT_SORT_KEY_DOSMILEY', 17); +define('COMMENT_SORT_KEY_DOXCODE', 18); +define('COMMENT_SORT_KEY_DOIMAGE', 19); +define('COMMENT_SORT_KEY_DOBR', 20); + +define('COMMENT_SORT_KEY_DEFAULT', COMMENT_SORT_KEY_COM_ID); +define('COMMENT_SORT_KEY_MAXVALUE', 20); + +class Legacy_CommentFilterForm extends Legacy_AbstractFilterForm +{ + var $mSortKeys = array( + COMMENT_SORT_KEY_COM_ID => 'com_id', + COMMENT_SORT_KEY_COM_PID => 'com_pid', + COMMENT_SORT_KEY_COM_ROOTID => 'com_rootid', + COMMENT_SORT_KEY_COM_MODID => 'com_modid', + COMMENT_SORT_KEY_COM_ITEMID => 'com_itemid', + COMMENT_SORT_KEY_COM_ICON => 'com_icon', + COMMENT_SORT_KEY_COM_CREATED => 'com_created', + COMMENT_SORT_KEY_COM_MODIFIED => 'com_modified', + COMMENT_SORT_KEY_COM_UID => 'com_uid', + COMMENT_SORT_KEY_COM_IP => 'com_ip', + COMMENT_SORT_KEY_COM_TITLE => 'com_title', + COMMENT_SORT_KEY_COM_TEXT => 'com_text', + COMMENT_SORT_KEY_COM_SIG => 'com_sig', + COMMENT_SORT_KEY_COM_STATUS => 'com_status', + COMMENT_SORT_KEY_COM_EXPARAMS => 'com_exparams', + COMMENT_SORT_KEY_DOHTML => 'dohtml', + COMMENT_SORT_KEY_DOSMILEY => 'dosmiley', + COMMENT_SORT_KEY_DOXCODE => 'doxcode', + COMMENT_SORT_KEY_DOIMAGE => 'doimage', + COMMENT_SORT_KEY_DOBR => 'dobr' + ); + + function getDefaultSortKey() + { + return COMMENT_SORT_KEY_DEFAULT; + } + + function fetch() + { + parent::fetch(); + + if (isset($_REQUEST['com_modid']) && intval(xoops_getrequest('com_modid')) > 0) { + $this->mNavi->addExtra('com_modid', xoops_getrequest('com_modid')); + $this->_mCriteria->add(new Criteria('com_modid', xoops_getrequest('com_modid'))); + } + elseif (isset($_REQUEST['dirname'])) { + $this->mNavi->addExtra('dirname', xoops_getrequest('dirname')); + + $handler =& xoops_gethandler('module'); + $module =& $handler->getByDirname(xoops_getrequest('dirname')); + if (is_object($module)) { + $this->_mCriteria->add(new Criteria('com_modid', $module->get('mid'))); + } + } + + if (isset($_REQUEST['com_icon'])) { + $this->mNavi->addExtra('com_icon', xoops_getrequest('com_icon')); + $this->_mCriteria->add(new Criteria('com_icon', xoops_getrequest('com_icon'))); + } + + if (isset($_REQUEST['com_uid'])) { + $this->mNavi->addExtra('com_uid', xoops_getrequest('com_uid')); + $this->_mCriteria->add(new Criteria('com_uid', xoops_getrequest('com_uid'))); + } + + if (isset($_REQUEST['com_ip'])) { + $this->mNavi->addExtra('com_ip', xoops_getrequest('com_ip')); + $this->_mCriteria->add(new Criteria('com_ip', xoops_getrequest('com_ip'))); + } + + if (xoops_getrequest('com_status') > 0) { + $this->mNavi->addExtra('com_status', xoops_getrequest('com_status')); + $this->_mCriteria->add(new Criteria('com_status', xoops_getrequest('com_status'))); + } + + $this->_mCriteria->addSort($this->getSort(), $this->getOrder()); + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/CustomBlockEditForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/CustomBlockEditForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/CustomBlockEditForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,78 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; +require_once XOOPS_MODULE_PATH . "/base/class/Legacy_Validator.class.php"; +require_once XOOPS_MODULE_PATH . "/base/admin/forms/BlockEditForm.class.php"; + +class Legacy_CustomBlockEditForm extends Legacy_BlockEditForm +{ + function getTokenName() + { + return "module.base.CustomBlockEditForm.TOKEN" . $this->get('bid'); + } + + function prepare() + { + parent::prepare(); + + // + // Set form properties + // + $this->mFormProperties['content'] =& new XCube_TextProperty('content'); + $this->mFormProperties['c_type'] =& new XCube_StringProperty('c_type'); + + // + // Set field properties + // + $this->mFieldProperties['content'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['content']->setDependsByArray(array('required')); + $this->mFieldProperties['content']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_CONTENT); + + $this->mFieldProperties['c_type'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['c_type']->setDependsByArray(array('required','maxlength')); + $this->mFieldProperties['c_type']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_C_TYPE, '1'); + $this->mFieldProperties['c_type']->addMessage('maxlength', _MD_BASE_ERROR_MAXLENGTH, _AD_BASE_LANG_C_TYPE, '1'); + $this->mFieldProperties['c_type']->addVar('maxlength', '1'); + } + + function load(&$obj) + { + parent::load($obj); + $this->set('content', $obj->get('content')); + $this->set('c_type', $obj->get('c_type')); + } + + function update(&$obj) + { + parent::update($obj); + $obj->set('content', $this->get('content')); + $obj->set('block_type', 'C'); + $obj->set('c_type', $this->get('c_type')); + $obj->set('visible', 1); + $obj->set('isactive', 1); + + switch ($this->get('c_type')) { + case 'H': + $obj->set('name', _AD_BASE_LANG_CUSTOM_HTML); + break; + + case 'P': + $obj->set('name', _AD_BASE_LANG_CUSTOM_PHP); + break; + + case 'S': + $obj->set('name', _AD_BASE_LANG_CUSTOM_WITH_SMILIES); + break; + + case 'T': + $obj->set('name', _AD_BASE_LANG_CUSTOM_WITHOUT_SMILIES); + break; + } + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/ActionSearchForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/ActionSearchForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/ActionSearchForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,31 @@ +<?php + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH."/core/XCube_ActionForm.class.php"; + +/** + * This class is generated by makeActionForm tool. + * @auchor makeActionForm + * @abstract + */ +class Legacy_ActionSearchForm extends XCube_ActionForm +{ + var $mState = null; + + function prepare() + { + $this->mFormProperties['keywords']=new XCube_StringProperty('keywords'); + + // set fields + $this->mFieldProperties['keywords']=new XCube_FieldProperty($this); + $this->mFieldProperties['keywords']->setDependsByArray(array('required')); + $this->mFieldProperties['keywords']->addMessage("required",_AD_BASE_ERROR_SEARCH_REQUIRED); + } + + function fetch() + { + parent::fetch(); + $this->set('keywords', trim($this->get('keywords'))); + } +} Index: xoops2jp/html/modules/legacy/admin/forms/index.html diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/index.html:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/index.html Sat Oct 14 23:55:21 2006 @@ -0,0 +1 @@ + <script>history.go(-1);</script> \ No newline at end of file Index: xoops2jp/html/modules/legacy/admin/forms/ImagecategoryFilterForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/ImagecategoryFilterForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/ImagecategoryFilterForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,77 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_MODULE_PATH . "/base/class/AbstractFilterForm.class.php"; + +define('IMAGECATEGORY_SORT_KEY_IMGCAT_ID', 1); +define('IMAGECATEGORY_SORT_KEY_IMGCAT_NAME', 2); +define('IMAGECATEGORY_SORT_KEY_IMGCAT_MAXSIZE', 3); +define('IMAGECATEGORY_SORT_KEY_IMGCAT_MAXWIDTH', 4); +define('IMAGECATEGORY_SORT_KEY_IMGCAT_MAXHEIGHT', 5); +define('IMAGECATEGORY_SORT_KEY_IMGCAT_DISPLAY', 6); +define('IMAGECATEGORY_SORT_KEY_IMGCAT_WEIGHT', 7); +define('IMAGECATEGORY_SORT_KEY_IMGCAT_TYPE', 8); +define('IMAGECATEGORY_SORT_KEY_IMGCAT_STORETYPE', 9); + +define('IMAGECATEGORY_SORT_KEY_DEFAULT', IMAGECATEGORY_SORT_KEY_IMGCAT_WEIGHT); +define('IMAGECATEGORY_SORT_KEY_MAXVALUE', 9); + +class Legacy_ImagecategoryFilterForm extends Legacy_AbstractFilterForm +{ + var $mSortKeys = array( + IMAGECATEGORY_SORT_KEY_IMGCAT_ID => 'imgcat_id', + IMAGECATEGORY_SORT_KEY_IMGCAT_NAME => 'imgcat_name', + IMAGECATEGORY_SORT_KEY_IMGCAT_MAXSIZE => 'imgcat_maxsize', + IMAGECATEGORY_SORT_KEY_IMGCAT_MAXWIDTH => 'imgcat_maxwidth', + IMAGECATEGORY_SORT_KEY_IMGCAT_MAXHEIGHT => 'imgcat_maxheight', + IMAGECATEGORY_SORT_KEY_IMGCAT_DISPLAY => 'imgcat_display', + IMAGECATEGORY_SORT_KEY_IMGCAT_WEIGHT => 'imgcat_weight', + IMAGECATEGORY_SORT_KEY_IMGCAT_TYPE => 'imgcat_type', + IMAGECATEGORY_SORT_KEY_IMGCAT_STORETYPE => 'imgcat_storetype' + ); + + function getDefaultSortKey() + { + return IMAGECATEGORY_SORT_KEY_DEFAULT; + } + + function fetch() + { + parent::fetch(); + + if (isset($_REQUEST['imgcat_name'])) { + $this->mNavi->addExtra('imgcat_name', xoops_getrequest('imgcat_name')); + $this->_mCriteria->add(new Criteria('imgcat_name', xoops_getrequest('imgcat_name'))); + } + + if (isset($_REQUEST['imgcat_display'])) { + $this->mNavi->addExtra('imgcat_display', xoops_getrequest('imgcat_display')); + $this->_mCriteria->add(new Criteria('imgcat_display', xoops_getrequest('imgcat_display'))); + } + + if (isset($_REQUEST['imgcat_type'])) { + $this->mNavi->addExtra('imgcat_type', xoops_getrequest('imgcat_type')); + $this->_mCriteria->add(new Criteria('imgcat_type', xoops_getrequest('imgcat_type'))); + } + + if (isset($_REQUEST['imgcat_storetype'])) { + $this->mNavi->addExtra('imgcat_storetype', xoops_getrequest('imgcat_storetype')); + $this->_mCriteria->add(new Criteria('imgcat_storetype', xoops_getrequest('imgcat_storetype'))); + } + + // + // Set sort conditions. + // + $this->_mCriteria->addSort($this->getSort(), $this->getOrder()); + if (abs($this->mSort) != IMAGECATEGORY_SORT_KEY_IMGCAT_WEIGHT) { + $this->_mCriteria->addSort(IMAGECATEGORY_SORT_KEY_IMGCAT_WEIGHT, $this->getOrder()); + } + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/BlockInstallEditForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/BlockInstallEditForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/BlockInstallEditForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,25 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/modules/base/admin/forms/BlockEditForm.class.php"; + +class Legacy_BlockInstallEditForm extends Legacy_BlockEditForm +{ + function getTokenName() + { + return "module.base.BlockInstallEditForm.TOKEN" . $this->get('bid'); + } + + function update(&$obj) + { + parent::update($obj); + $obj->set('visible', true); + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/ImagecategoryAdminEditForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/ImagecategoryAdminEditForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/ImagecategoryAdminEditForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,135 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; +require_once XOOPS_MODULE_PATH . "/base/class/Legacy_Validator.class.php"; + +class Legacy_ImagecategoryAdminEditForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.base.ImagecategoryAdminEditForm.TOKEN" . $this->get('imgcat_id'); + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['imgcat_id'] =& new XCube_IntProperty('imgcat_id'); + $this->mFormProperties['imgcat_name'] =& new XCube_StringProperty('imgcat_name'); + $this->mFormProperties['imgcat_maxsize'] =& new XCube_IntProperty('imgcat_maxsize'); + $this->mFormProperties['imgcat_maxwidth'] =& new XCube_IntProperty('imgcat_maxwidth'); + $this->mFormProperties['imgcat_maxheight'] =& new XCube_IntProperty('imgcat_maxheight'); + $this->mFormProperties['imgcat_display'] =& new XCube_BoolProperty('imgcat_display'); + $this->mFormProperties['imgcat_weight'] =& new XCube_IntProperty('imgcat_weight'); + $this->mFormProperties['readgroups'] =& new XCube_IntArrayProperty('readgroups'); + $this->mFormProperties['uploadgroups'] =& new XCube_IntArrayProperty('uploadgroups'); + + // + // Set field properties + // + $this->mFieldProperties['imgcat_id'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['imgcat_id']->setDependsByArray(array('required')); + $this->mFieldProperties['imgcat_id']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_IMGCAT_ID); + + $this->mFieldProperties['imgcat_name'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['imgcat_name']->setDependsByArray(array('required','maxlength')); + $this->mFieldProperties['imgcat_name']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_IMGCAT_NAME, '100'); + $this->mFieldProperties['imgcat_name']->addMessage('maxlength', _MD_BASE_ERROR_MAXLENGTH, _AD_BASE_LANG_IMGCAT_NAME, '100'); + $this->mFieldProperties['imgcat_name']->addVar('maxlength', '100'); + + $this->mFieldProperties['imgcat_maxsize'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['imgcat_maxsize']->setDependsByArray(array('required')); + $this->mFieldProperties['imgcat_maxsize']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_IMGCAT_MAXSIZE); + + $this->mFieldProperties['imgcat_maxwidth'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['imgcat_maxwidth']->setDependsByArray(array('required')); + $this->mFieldProperties['imgcat_maxwidth']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_IMGCAT_MAXWIDTH); + + $this->mFieldProperties['imgcat_maxheight'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['imgcat_maxheight']->setDependsByArray(array('required')); + $this->mFieldProperties['imgcat_maxheight']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_IMGCAT_MAXHEIGHT); + + $this->mFieldProperties['imgcat_weight'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['imgcat_weight']->setDependsByArray(array('required')); + $this->mFieldProperties['imgcat_weight']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_IMGCAT_WEIGHT); + + $this->mFieldProperties['readgroups'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['readgroups']->setDependsByArray(array('objectExist')); + $this->mFieldProperties['readgroups']->addMessage('objectExist', _AD_BASE_ERROR_OBJECTEXIST, _AD_BASE_LANG_IMGCAT_READ_GROUPS); + $this->mFieldProperties['readgroups']->addVar('handler', 'group'); + + $this->mFieldProperties['uploadgroups'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['uploadgroups']->setDependsByArray(array('objectExist')); + $this->mFieldProperties['uploadgroups']->addMessage('objectExist', _AD_BASE_ERROR_OBJECTEXIST, _AD_BASE_LANG_IMGCAT_UPLOAD_GROUPS); + $this->mFieldProperties['uploadgroups']->addVar('handler', 'group'); + } + + function validateReadgroups() + { + $readgroups = $this->get('readgroups'); + if (count($readgroups) == 0) { + $this->addErrorMessage(_AD_BASE_ERROR_READGROUPS); + } + } + + function validateUploadgroups() + { + $uploadgroups = $this->get('uploadgroups'); + if (count($uploadgroups) == 0) { + $this->addErrorMessage(_AD_BASE_ERROR_UPLOADGROUPS); + } + } + + function load(&$obj) + { + $this->set('imgcat_id', $obj->get('imgcat_id')); + $this->set('imgcat_name', $obj->get('imgcat_name')); + $this->set('imgcat_maxsize', $obj->get('imgcat_maxsize')); + $this->set('imgcat_maxwidth', $obj->get('imgcat_maxwidth')); + $this->set('imgcat_maxheight', $obj->get('imgcat_maxheight')); + $this->set('imgcat_display', $obj->get('imgcat_display')); + $this->set('imgcat_weight', $obj->get('imgcat_weight')); + + $i = 0; + foreach ($obj->mReadGroups as $group) { + $this->set('readgroups', $i++, $group->get('groupid')); + } + + $i = 0; + foreach ($obj->mUploadGroups as $group) { + $this->set('uploadgroups', $i++, $group->get('groupid')); + } + } + + function update(&$obj) + { + $obj->set('imgcat_id', $this->get('imgcat_id')); + $obj->set('imgcat_name', $this->get('imgcat_name')); + $obj->set('imgcat_maxsize', $this->get('imgcat_maxsize')); + $obj->set('imgcat_maxwidth', $this->get('imgcat_maxwidth')); + $obj->set('imgcat_maxheight', $this->get('imgcat_maxheight')); + $obj->set('imgcat_display', $this->get('imgcat_display')); + $obj->set('imgcat_weight', $this->get('imgcat_weight')); + + $handler =& xoops_gethandler('group'); + + unset($obj->mReadGroups); + foreach ($this->get('readgroups') as $groupid) { + $obj->mReadGroups[] =& $handler->get($groupid); + } + + unset($obj->mUploadGroups); + foreach ($this->get('uploadgroups') as $groupid) { + $obj->mUploadGroups[] =& $handler->get($groupid); + } + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/CustomBlockDeleteForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/CustomBlockDeleteForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/CustomBlockDeleteForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,44 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; +require_once XOOPS_MODULE_PATH . "/base/class/Legacy_Validator.class.php"; + +class Legacy_CustomBlockDeleteForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.base.CustomBlockDeleteForm.TOKEN" . $this->get('bid'); + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['bid'] =& new XCube_IntProperty('bid'); + + // + // Set field properties + // + $this->mFieldProperties['bid'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['bid']->setDependsByArray(array('required')); + $this->mFieldProperties['bid']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_BID); + } + + function load(&$obj) + { + $this->set('bid', $obj->get('bid')); + } + + function update(&$obj) + { + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/ModuleListFilterForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/ModuleListFilterForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/ModuleListFilterForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,84 @@ +<?php +/** + * This file is generated by Sort Filter Unit Class Maker. + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/modules/base/class/AbstractFilterForm.class.php"; + +define("MODULE_SORT_KEY_MID", 1); +define("MODULE_SORT_KEY_NAME", 2); +define("MODULE_SORT_KEY_VERSION", 3); +define("MODULE_SORT_KEY_LASTUPDATE", 4); +define("MODULE_SORT_KEY_WEIGHT", 5); +define("MODULE_SORT_KEY_ISACTIVE", 6); +define("MODULE_SORT_KEY_DIRNAME", 7); +define("MODULE_SORT_KEY_HASMAIN", 8); +define("MODULE_SORT_KEY_HASADMIN", 9); +define("MODULE_SORT_KEY_HASSEARCH", 10); +define("MODULE_SORT_KEY_HASCONFIG", 11); +define("MODULE_SORT_KEY_HASCOMMENTS",12); + +define("MODULE_SORT_KEY_DEFAULT", MODULE_SORT_KEY_WEIGHT); +define("MODULE_SORT_KEY_MAXVALUE", 12); + +/** + * This is the special filter for the list of installed modules without the + * pager. + */ +class Legacy_ModuleListFilterForm extends Legacy_AbstractFilterForm +{ + var $mSpecial = null; + + var $mSortKeys = array( + MODULE_SORT_KEY_MID => "mid", + MODULE_SORT_KEY_NAME => "name", + MODULE_SORT_KEY_VERSION => "version", + MODULE_SORT_KEY_LASTUPDATE => "last_update", + MODULE_SORT_KEY_WEIGHT => "weight", + MODULE_SORT_KEY_ISACTIVE => "isactive", + MODULE_SORT_KEY_DIRNAME => "dirname", + MODULE_SORT_KEY_HASMAIN => "hasmain", + MODULE_SORT_KEY_HASADMIN => "hasadmin", + MODULE_SORT_KEY_HASSEARCH => "hassearch", + MODULE_SORT_KEY_HASCONFIG => "hasconfig", + MODULE_SORT_KEY_HASCOMMENTS => "hascomments" + ); + + function Legacy_ModuleListFilterForm() + { + $this->_mCriteria =& new CriteriaCompo(); + } + + function getDefaultSortKey() + { + return MODULE_SORT_KEY_DEFAULT; + } + + function fetch() + { + $this->fetchSort(); + + if (isset($_REQUEST['special'])) { + $this->mSpecial = intval(xoops_getreqeust('special')); + } + + $this->_mCriteria->add(new Criteria('mid', 0, '>')); + + $this->_mCriteria->addSort($this->getSort(), $this->getOrder()); + } + + function getCriteria($start = null, $limit = null) + { + $criteria = $this->_mCriteria; + + $criteria->setStart(0); + $criteria->setLimit(0); + + return $criteria; + } +} + +?> \ No newline at end of file Index: xoops2jp/html/modules/legacy/admin/forms/SmilesAdminDeleteForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/SmilesAdminDeleteForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/SmilesAdminDeleteForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,44 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; + +class Legacy_SmilesAdminDeleteForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.base.SmilesAdminDeleteForm.TOKEN" . $this->get('id'); + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['id'] =& new XCube_IntProperty('id'); + + // + // Set field properties + // + $this->mFieldProperties['id'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['id']->setDependsByArray(array('required')); + $this->mFieldProperties['id']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_ID); + } + + function load(&$obj) + { + $this->set('id', $obj->get('id')); + } + + function update(&$obj) + { + $obj->set('id', $this->get('id')); + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/ModuleInstallForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/ModuleInstallForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/ModuleInstallForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,34 @@ +<?php + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; + +class Legacy_ModuleInstallForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.legacy.ModuleInstallForm.TOKEN." . $this->get('dirname'); + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['dirname'] =& new XCube_StringProperty('dirname'); + $this->mFormProperties['force'] =& new XCube_BoolProperty('force'); + } + + function load(&$obj) + { + $this->set('dirname', $obj->get('dirname')); + } + + function update(&$obj) + { + $obj->set('dirname', $this->get('dirname')); + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/ImageFilterForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/ImageFilterForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/ImageFilterForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,58 @@ +<?php + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_MODULE_PATH . "/base/class/AbstractFilterForm.class.php"; + +define('IMAGE_SORT_KEY_IMAGE_ID', 1); +define('IMAGE_SORT_KEY_IMAGE_NAME', 2); +define('IMAGE_SORT_KEY_IMAGE_NICENAME', 3); +define('IMAGE_SORT_KEY_IMAGE_MIMETYPE', 4); +define('IMAGE_SORT_KEY_IMAGE_CREATED', 5); +define('IMAGE_SORT_KEY_IMAGE_DISPLAY', 6); +define('IMAGE_SORT_KEY_IMAGE_WEIGHT', 7); +define('IMAGE_SORT_KEY_IMGCAT_ID', 8); + +define('IMAGE_SORT_KEY_DEFAULT', IMAGE_SORT_KEY_IMAGE_WEIGHT); +define('IMAGE_SORT_KEY_MAXVALUE', 8); + +class Legacy_ImageFilterForm extends Legacy_AbstractFilterForm +{ + var $mSortKeys = array( + IMAGE_SORT_KEY_IMAGE_ID => 'image_id', + IMAGE_SORT_KEY_IMAGE_NAME => 'image_name', + IMAGE_SORT_KEY_IMAGE_NICENAME => 'image_nicename', + IMAGE_SORT_KEY_IMAGE_MIMETYPE => 'image_mimetype', + IMAGE_SORT_KEY_IMAGE_CREATED => 'image_created', + IMAGE_SORT_KEY_IMAGE_DISPLAY => 'image_display', + IMAGE_SORT_KEY_IMAGE_WEIGHT => 'image_weight', + IMAGE_SORT_KEY_IMGCAT_ID => 'imgcat_id' + ); + + function getDefaultSortKey() + { + return IMAGE_SORT_KEY_DEFAULT; + } + + function fetch() + { + parent::fetch(); + + if (isset($_REQUEST['image_display'])) { + $this->mNavi->addExtra('image_display', xoops_getrequest('image_display')); + $this->_mCriteria->add(new Criteria('image_display', xoops_getrequest('image_display'))); + } + + if (isset($_REQUEST['imgcat_id'])) { + $this->mNavi->addExtra('imgcat_id', xoops_getrequest('imgcat_id')); + $this->_mCriteria->add(new Criteria('imgcat_id', xoops_getrequest('imgcat_id'))); + } + + $this->_mCriteria->addSort($this->getSort(), $this->getOrder()); + if (abs($this->mSort) != IMAGE_SORT_KEY_IMAGE_WEIGHT) { + $this->_mCriteria->addSort(IMAGE_SORT_KEY_IMAGE_WEIGHT, $this->getOrder()); + } + } +} + +?> Index: xoops2jp/html/modules/legacy/admin/forms/ImagecategoryAdminNewForm.class.php diff -u /dev/null xoops2jp/html/modules/legacy/admin/forms/ImagecategoryAdminNewForm.class.php:1.1.2.1 --- /dev/null Sat Oct 14 23:55:21 2006 +++ xoops2jp/html/modules/legacy/admin/forms/ImagecategoryAdminNewForm.class.php Sat Oct 14 23:55:21 2006 @@ -0,0 +1,52 @@ +<?php +/** + * @package Legacy + * @version $Id$ + */ + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/core/XCube_ActionForm.class.php"; +require_once XOOPS_MODULE_PATH . "/base/class/Legacy_Validator.class.php"; +require_once XOOPS_MODULE_PATH . "/base/admin/forms/ImagecategoryAdminEditForm.class.php"; + +class Legacy_ImagecategoryAdminNewForm extends Legacy_ImagecategoryAdminEditForm +{ + function getTokenName() + { + return "module.base.ImagecategoryAdminNewForm.TOKEN"; + } + + function prepare() + { + parent::prepare(); + + // + // Set form properties + // + $this->mFormProperties['imgcat_storetype'] =& new XCube_StringProperty('imgcat_storetype'); + + // + // Set field properties + // + $this->mFieldProperties['imgcat_storetype'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['imgcat_storetype']->setDependsByArray(array('required','mask')); + $this->mFieldProperties['imgcat_storetype']->addMessage('required', _MD_BASE_ERROR_REQUIRED, _AD_BASE_LANG_IMGCAT_STORETYPE); + $this->mFieldProperties['imgcat_storetype']->addMessage('mask', _MD_BASE_ERROR_MASK, _AD_BASE_LANG_IMGCAT_STORETYPE); + $this->mFieldProperties['imgcat_storetype']->addVar('mask', '(file|db)'); + } + + function load(&$obj) + { + parent::load($obj); + $this->set('imgcat_storetype', $obj->get('imgcat_storetype')); + } + + function update(&$obj) + { + parent::update($obj); + $obj->set('imgcat_storetype', $this->get('imgcat_storetype')); + } +} + +?>