Minahito
minah****@users*****
2006年 5月 10日 (水) 19:25:33 JST
Index: xoops2jp/html/modules/base/admin/forms/ImageAdminDeleteForm.class.php diff -u /dev/null xoops2jp/html/modules/base/admin/forms/ImageAdminDeleteForm.class.php:1.1.2.1 --- /dev/null Wed May 10 19:25:33 2006 +++ xoops2jp/html/modules/base/admin/forms/ImageAdminDeleteForm.class.php Wed May 10 19:25:33 2006 @@ -0,0 +1,41 @@ +<?php + +if (!defined('XOOPS_ROOT_PATH')) exit(); + +require_once XOOPS_ROOT_PATH . "/class/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', _AD_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/base/admin/forms/ImageFilterForm.class.php diff -u /dev/null xoops2jp/html/modules/base/admin/forms/ImageFilterForm.class.php:1.1.2.1 --- /dev/null Wed May 10 19:25:33 2006 +++ xoops2jp/html/modules/base/admin/forms/ImageFilterForm.class.php Wed May 10 19:25:33 2006 @@ -0,0 +1,69 @@ +<?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_MAXVALUE', 8); + +define('IMAGE_SORT_KEY_DEFAULT', IMAGE_SORT_KEY_IMAGE_WEIGHT); + +class Legacy_ImageFilterForm extends Legacy_AbstractFilterForm +{ + var $mSort = 0; + 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' + ); + var $_mCriteria = null; + + function fetch() + { + $this->mSort = isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : IMAGE_SORT_KEY_DEFAULT; + + if ($this->mSort > IMAGE_SORT_KEY_MAXVALUE) { + $this->mSort = IMAGE_SORT_KEY_DEFAULT; + } + +// if (isset($_REQUEST['image_name'])) { +// $this->_mNavi->addExtra('image_name', xoops_getrequest('image_name')); +// $this->_mCriteria->add(new Criteria('image_name', array(XOBJ_DTYPE_STRING, xoops_getrequest('image_name')))); +// } + +// if (isset($_REQUEST['image_nicename'])) { +// $this->_mNavi->addExtra('image_nicename', xoops_getrequest('image_nicename')); +// $this->_mCriteria->add(new Criteria('image_nicename', array(XOBJ_DTYPE_STRING, xoops_getrequest('image_nicename')))); +// } + + if (isset($_REQUEST['image_display'])) { + $this->_mNavi->addExtra('image_display', xoops_getrequest('image_display')); + $this->_mCriteria->add(new Criteria('image_display', array(XOBJ_DTYPE_BOOL, 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', array(XOBJ_DTYPE_INT, 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()); + } + } +} + +?>