Minahito
minah****@users*****
2006年 1月 14日 (土) 02:31:14 JST
Index: xoops2jp/html/modules/legacyRender/admin/forms/TplsetFilterForm.class.php diff -u /dev/null xoops2jp/html/modules/legacyRender/admin/forms/TplsetFilterForm.class.php:1.1.2.1 --- /dev/null Sat Jan 14 02:31:14 2006 +++ xoops2jp/html/modules/legacyRender/admin/forms/TplsetFilterForm.class.php Sat Jan 14 02:31:14 2006 @@ -0,0 +1,77 @@ +<?php + +define('TPLSET_SORT_KEY_DEFAULT', 0); +define('TPLSET_SORT_KEY_TPLSET_ID', 1); +define('TPLSET_SORT_KEY_NAME', 2); +define('TPLSET_SORT_KEY_DESC', 3); +define('TPLSET_SORT_KEY_LOCK', 4); +define('TPLSET_SORT_KEY_MAXVALUE', 4); + +class LegacyRender_TplsetFilterForm +{ + var $mSort = 0; + var $_mSortKeys = array( + TPLSET_SORT_KEY_DEFAULT => 'tplset_id', + TPLSET_SORT_KEY_TPLSET_ID => 'tplset_id', + TPLSET_SORT_KEY_NAME => 'name', + TPLSET_SORT_KEY_DESC => 'desc', + TPLSET_SORT_KEY_LOCK => 'lock' + ); + var $_mCriteria = null; + + function LegacyRender_TplsetFilterForm() + { + $this->_mCriteria =& new CriteriaCompo(); + } + + function fetch() + { + $this->mSort = isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : 0; + + if ($this->mSort > TPLSET_SORT_KEY_MAXVALUE) { + $this->mSort = TPLSET_SORT_KEY_DEFAULT; + } + + if (isset($_REQUEST['tplset_id'])) { + $this->_mCriteria->add(new Criteria('tplset_id', array(XOBJ_DTYPE_INT, xoops_getrequest('tplset_id')))); + } + + if (isset($_REQUEST['name'])) { + $this->_mCriteria->add(new Criteria('name', array(XOBJ_DTYPE_STRING, xoops_getrequest('name')))); + } + + if (isset($_REQUEST['desc'])) { + $this->_mCriteria->add(new Criteria('desc', array(XOBJ_DTYPE_STRING, xoops_getrequest('desc')))); + } + + if (isset($_REQUEST['lock'])) { + $this->_mCriteria->add(new Criteria('lock', array(XOBJ_DTYPE_BOOL, xoops_getrequest('lock')))); + } + } + + function getSort() + { + $sortkey = abs($this->mSort); + return $this->_mSortKeys[$sortkey]; + } + + function getOrder() + { + return ($this->mSort < 0) ? "DESC" : "ASC"; + } + + function getCriteria($start = 0, $limit = 0) + { + $criteria = $this->_mCriteria; + + $criteria->setStart($start); + $criteria->setLimit($limit); + + $criteria->setSort($this->getSort()); + $criteria->setOrder($this->getOrder()); + + return $criteria; + } +} + +?> Index: xoops2jp/html/modules/legacyRender/admin/forms/TplfileEditForm.class.php diff -u /dev/null xoops2jp/html/modules/legacyRender/admin/forms/TplfileEditForm.class.php:1.1.2.1 --- /dev/null Sat Jan 14 02:31:14 2006 +++ xoops2jp/html/modules/legacyRender/admin/forms/TplfileEditForm.class.php Sat Jan 14 02:31:14 2006 @@ -0,0 +1,64 @@ +<?php + +require_once XOOPS_ROOT_PATH . "/class/XCube_ActionForm.class.php"; + +/** + * This class is generated by makeActionForm tool. + */ +class TplfileEditForm extends XCube_ActionForm +{ + function getTokenName() + { + return "module.legacyRender.TplfileEditForm.TOKEN." . $this->get('tpl_id'); + } + + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['tpl_id'] =& new XCube_IntProperty('tpl_id'); + $this->mFormProperties['tpl_desc'] =& new XCube_StringProperty('tpl_desc'); + $this->mFormProperties['tpl_source'] =& new XCube_TextProperty('tpl_source'); + + // + // Set field properties + // + $this->mFieldProperties['tpl_id'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['tpl_id']->setDependsByArray(array('required')); + $this->mFieldProperties['tpl_id']->addMessage('required', _AD_LEGACYRENDER_ERROR_REQUIRED, _AD_LEGACYRENDER_LANG_TPL_ID); + + $this->mFieldProperties['tpl_desc'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['tpl_desc']->setDependsByArray(array('required','maxlength')); + $this->mFieldProperties['tpl_desc']->addMessage('required', _AD_LEGACYRENDER_ERROR_REQUIRED, _AD_LEGACYRENDER_LANG_TPL_DESC, '255'); + $this->mFieldProperties['tpl_desc']->addMessage('maxlength', _AD_LEGACYRENDER_ERROR_MAXLENGTH, _AD_LEGACYRENDER_LANG_TPL_DESC, '255'); + $this->mFieldProperties['tpl_desc']->addVar('maxlength', 255); + + $this->mFieldProperties['tpl_source'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['tpl_source']->setDependsByArray(array('required')); + $this->mFieldProperties['tpl_source']->addMessage('required', _AD_LEGACYRENDER_ERROR_REQUIRED, _AD_LEGACYRENDER_LANG_TPL_SOURCE); + } + + function load(&$obj) + { + $obj->loadSource(); + + $this->setVar('tpl_id', $obj->get('tpl_id')); + $this->setVar('tpl_desc', $obj->get('tpl_desc')); + $this->setVar('tpl_source', $obj->Source->get('tpl_source')); + } + + function update(&$obj) + { + $obj->loadSource(); + + $obj->setVar('tpl_id', $this->get('tpl_id')); + $obj->setVar('tpl_desc', $this->get('tpl_desc')); + + $obj->setVar('tpl_lastmodified', time()); + + $obj->Source->setVar('tpl_source', $this->get('tpl_source')); + } +} + +?> Index: xoops2jp/html/modules/legacyRender/admin/forms/TplsetEditForm.class.php diff -u /dev/null xoops2jp/html/modules/legacyRender/admin/forms/TplsetEditForm.class.php:1.1.2.1 --- /dev/null Sat Jan 14 02:31:14 2006 +++ xoops2jp/html/modules/legacyRender/admin/forms/TplsetEditForm.class.php Sat Jan 14 02:31:14 2006 @@ -0,0 +1,51 @@ +<?php + +require_once XOOPS_ROOT_PATH . "/class/XCube_ActionForm.class.php"; + +/** + * This class is generated by makeActionForm tool. + */ +class TplsetEditForm extends XCube_ActionForm +{ + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['tplset_id'] =& new XCube_IntProperty('tplset_id'); + $this->mFormProperties['tplset_desc'] =& new XCube_StringProperty('tplset_desc'); + $this->mFormProperties['tplset_credits'] =& new XCube_TextProperty('tplset_credits'); + + // + // Set field properties + // + $this->mFieldProperties['tplset_id'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['tplset_id']->setDependsByArray(array('required')); + $this->mFieldProperties['tplset_id']->addMessage('required', _AD_LEGACYRENDER_ERROR_REQUIRED, _AD_LEGACYRENDER_LANG_TPLSET_ID); + + $this->mFieldProperties['tplset_desc'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['tplset_desc']->setDependsByArray(array('maxlength')); + $this->mFieldProperties['tplset_desc']->addMessage('maxlength', _AD_LEGACYRENDER_ERROR_MAXLENGTH, _AD_LEGACYRENDER_LANG_TPLSET_DESC, '255'); + $this->mFieldProperties['tplset_desc']->addVar('maxlength', 255); + } + function getTokenName() + { + return "module.legacyRender.TplsetEditForm.TOKEN"; + } + + function load(&$obj) + { + $this->setVar('tplset_id', $obj->get('tplset_id')); + $this->setVar('tplset_desc', $obj->get('tplset_desc')); + $this->setVar('tplset_credits', $obj->get('tplset_credits')); + } + + function update(&$obj) + { + $obj->setVar('tplset_id', $this->get('tplset_id')); + $obj->setVar('tplset_desc', $this->get('tplset_desc')); + $obj->setVar('tplset_credits', $this->get('tplset_credits')); + } +} + +?> Index: xoops2jp/html/modules/legacyRender/admin/forms/TplsetDeleteForm.class.php diff -u /dev/null xoops2jp/html/modules/legacyRender/admin/forms/TplsetDeleteForm.class.php:1.1.2.1 --- /dev/null Sat Jan 14 02:31:14 2006 +++ xoops2jp/html/modules/legacyRender/admin/forms/TplsetDeleteForm.class.php Sat Jan 14 02:31:14 2006 @@ -0,0 +1,40 @@ +<?php + +require_once XOOPS_ROOT_PATH . "/class/XCube_ActionForm.class.php"; + +/** + * This class is generated by makeActionForm tool. + */ +class TplsetDeleteForm extends XCube_ActionForm +{ + function prepare() + { + // + // Set form properties + // + $this->mFormProperties['tplset_id'] =& new XCube_IntProperty('tplset_id'); + + // + // Set field properties + // + $this->mFieldProperties['tplset_id'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['tplset_id']->setDependsByArray(array('required')); + $this->mFieldProperties['tplset_id']->addMessage('required', _AD_LEGACYRENDER_ERROR_REQUIRED, _AD_LEGACYRENDER_LANG_TPLSET_ID); + } + function getTokenName() + { + return "module.legacyRender.TplsetDeleteForm.TOKEN"; + } + + function load(&$obj) + { + $this->setVar('tplset_id', $obj->get('tplset_id')); + } + + function update(&$obj) + { + $obj->setVar('tplset_id', $this->get('tplset_id')); + } +} + +?> Index: xoops2jp/html/modules/legacyRender/admin/forms/TplfileFilterForm.class.php diff -u /dev/null xoops2jp/html/modules/legacyRender/admin/forms/TplfileFilterForm.class.php:1.1.2.1 --- /dev/null Sat Jan 14 02:31:14 2006 +++ xoops2jp/html/modules/legacyRender/admin/forms/TplfileFilterForm.class.php Sat Jan 14 02:31:14 2006 @@ -0,0 +1,95 @@ +<?php + +define('TPLFILE_SORT_KEY_DEFAULT', 0); +define('TPLFILE_SORT_KEY_TPL_ID', 1); +define('TPLFILE_SORT_KEY_TPL_REFID', 2); +define('TPLFILE_SORT_KEY_TPL_MODULE', 3); +define('TPLFILE_SORT_KEY_TPL_TPLSET', 4); +define('TPLFILE_SORT_KEY_TPL_FILE', 5); +define('TPLFILE_SORT_KEY_TPL_DESC', 6); +define('TPLFILE_SORT_KEY_TPL_LASTMODIFIED', 7); +define('TPLFILE_SORT_KEY_TPL_LASTIMPORTED', 8); +define('TPLFILE_SORT_KEY_TPL_TYPE', 9); +define('TPLFILE_SORT_KEY_MAXVALUE', 9); + +class LegacyRender_TplfileFilterForm +{ + var $mSort = 0; + var $_mSortKeys = array( + TPLFILE_SORT_KEY_DEFAULT => 'tpl_id', + TPLFILE_SORT_KEY_TPL_ID => 'tpl_id', + TPLFILE_SORT_KEY_TPL_REFID => 'tpl_refid', + TPLFILE_SORT_KEY_TPL_MODULE => 'tpl_module', + TPLFILE_SORT_KEY_TPL_TPLSET => 'tpl_tplset', + TPLFILE_SORT_KEY_TPL_FILE => 'tpl_file', + TPLFILE_SORT_KEY_TPL_DESC => 'tpl_desc', + TPLFILE_SORT_KEY_TPL_LASTMODIFIED => 'tpl_lastmodified', + TPLFILE_SORT_KEY_TPL_LASTIMPORTED => 'tpl_lastimported', + TPLFILE_SORT_KEY_TPL_TYPE => 'tpl_type' + ); + var $_mCriteria = null; + + function LegacyRender_TplfileFilterForm() + { + $this->_mCriteria =& new CriteriaCompo(); + } + + function fetch() + { + $this->mSort = isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : 0; + + if ($this->mSort > TPLFILE_SORT_KEY_MAXVALUE) { + $this->mSort = TPLFILE_SORT_KEY_DEFAULT; + } + + if (isset($_REQUEST['tpl_id'])) { + $this->_mCriteria->add(new Criteria('tpl_id', array(XOBJ_DTYPE_INT, xoops_getrequest('tpl_id')))); + } + + if (isset($_REQUEST['tpl_refid'])) { + $this->_mCriteria->add(new Criteria('tpl_refid', array(XOBJ_DTYPE_INT, xoops_getrequest('tpl_refid')))); + } + + if (isset($_REQUEST['tpl_module'])) { + $this->_mCriteria->add(new Criteria('tpl_module', array(XOBJ_DTYPE_STRING, xoops_getrequest('tpl_module')))); + } + + if (isset($_REQUEST['tpl_tplset'])) { + $this->_mCriteria->add(new Criteria('tpl_tplset', array(XOBJ_DTYPE_STRING, xoops_getrequest('tpl_tplset')))); + } + + if (isset($_REQUEST['tpl_file'])) { + $this->_mCriteria->add(new Criteria('tpl_file', array(XOBJ_DTYPE_STRING, "%" . xoops_getrequest('tpl_file') . "%"), 'LIKE')); + } + + if (isset($_REQUEST['tpl_type'])) { + $this->_mCriteria->add(new Criteria('tpl_type', array(XOBJ_DTYPE_STRING, xoops_getrequest('tpl_type')))); + } + } + + function getSort() + { + $sortkey = abs($this->mSort); + return $this->_mSortKeys[$sortkey]; + } + + function getOrder() + { + return ($this->mSort < 0) ? "DESC" : "ASC"; + } + + function getCriteria($start = 0, $limit = 0) + { + $criteria = $this->_mCriteria; + + $criteria->setStart($start); + $criteria->setLimit($limit); + + $criteria->setSort($this->getSort()); + $criteria->setOrder($this->getOrder()); + + return $criteria; + } +} + +?> Index: xoops2jp/html/modules/legacyRender/admin/forms/TplsetCloneForm.class.php diff -u /dev/null xoops2jp/html/modules/legacyRender/admin/forms/TplsetCloneForm.class.php:1.1.2.1 --- /dev/null Sat Jan 14 02:31:14 2006 +++ xoops2jp/html/modules/legacyRender/admin/forms/TplsetCloneForm.class.php Sat Jan 14 02:31:14 2006 @@ -0,0 +1,60 @@ +<?php + +require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplsetEditForm.class.php"; + +/** + * This class is generated by makeActionForm tool. + */ +class TplsetCloneForm extends TplsetEditForm +{ + function getTokenName() + { + return "module.legacyRender.TplsetCloneForm.TOKEN"; + } + + function prepare() + { + parent::prepare(); + // + // Set form properties + // + $this->mFormProperties['tplset_id'] =& new XCube_IntProperty('tplset_id'); + $this->mFormProperties['tplset_name'] =& new XCube_StringProperty('tplset_name'); + $this->mFormProperties['tplset_credits'] =& new XCube_TextProperty('tplset_credits'); + + // + // Set field properties + // + $this->mFieldProperties['tplset_name'] =& new XCube_FieldProperty($this); + $this->mFieldProperties['tplset_name']->setDependsByArray(array('required','maxlength')); + $this->mFieldProperties['tplset_name']->addMessage('required', _AD_LEGACYRENDER_ERROR_REQUIRED, _AD_LEGACYRENDER_LANG_TPLSET_NAME, '50'); + $this->mFieldProperties['tplset_name']->addMessage('maxlength', _AD_LEGACYRENDER_ERROR_MAXLENGTH, _AD_LEGACYRENDER_LANG_TPLSET_NAME, '50'); + $this->mFieldProperties['tplset_name']->addVar('maxlength', 50); + } + + function validateTplset_name() + { + // + // Check unique name + // + $handler = xoops_getmodulehandler('tplset'); + if ($handler->getCount(new Criteria('tplset_name', $this->get('name'))) > 0) { + $this->addErrorMessage(_AD_LEGACYRENDER_ERROR_UNIQUE_NAME); + } + } + + function load(&$obj) + { + parent::load($obj); + $this->setVar('tplset_name', $obj->get('tplset_name')); + } + + function update(&$obj) + { + parent::update($obj); + $obj->setVar('tplset_name', $this->get('tplset_name')); + $obj->setVar('tplset_id', 0); + } +} + +?>