[xoops-cvslog 4955] CVS update: xoops2jp/html/modules/legacyRender/admin/forms

Back to archive index

Minahito minah****@users*****
2006年 10月 12日 (木) 22:56:57 JST


Index: xoops2jp/html/modules/legacyRender/admin/forms/TplsetFilterForm.class.php
diff -u xoops2jp/html/modules/legacyRender/admin/forms/TplsetFilterForm.class.php:1.1.2.7 xoops2jp/html/modules/legacyRender/admin/forms/TplsetFilterForm.class.php:1.1.2.7.2.1
--- xoops2jp/html/modules/legacyRender/admin/forms/TplsetFilterForm.class.php:1.1.2.7	Sat Aug  5 15:21:05 2006
+++ xoops2jp/html/modules/legacyRender/admin/forms/TplsetFilterForm.class.php	Thu Oct 12 22:56:57 2006
@@ -23,15 +23,16 @@
 		TPLSET_SORT_KEY_TPLSET_CREDITS => 'tplset_credits',
 		TPLSET_SORT_KEY_TPLSET_CREATED => 'tplset_created'
 	);
+	
+	function getDefaultSortKey()
+	{
+		return TPLSET_SORT_KEY_DEFAULT;
+	}
 
 	function fetch()
 	{
-		$this->mSort = isset($_REQUEST['sort']) ? intval(xoops_getrequest('sort')) : TPLSET_SORT_KEY_DEFAULT;
-	
-		if (!isset($this->mSortKeys[abs($this->mSort)])) {
-			$this->mSort = TPLSET_SORT_KEY_DEFAULT;
-		}
-	
+		parent::fetch();
+		
 		$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
 	}
 }
Index: xoops2jp/html/modules/legacyRender/admin/forms/BannerfinishFilterForm.class.php
diff -u xoops2jp/html/modules/legacyRender/admin/forms/BannerfinishFilterForm.class.php:1.1.2.3 xoops2jp/html/modules/legacyRender/admin/forms/BannerfinishFilterForm.class.php:1.1.2.3.2.1
--- xoops2jp/html/modules/legacyRender/admin/forms/BannerfinishFilterForm.class.php:1.1.2.3	Mon Jul 10 20:11:29 2006
+++ xoops2jp/html/modules/legacyRender/admin/forms/BannerfinishFilterForm.class.php	Thu Oct 12 22:56:57 2006
@@ -1,7 +1,7 @@
 <?php
 /**
  * @package legacyRender
- * @version $Id: BannerfinishFilterForm.class.php,v 1.1.2.3 2006/07/10 11:11:29 minahito Exp $
+ * @version $Id: BannerfinishFilterForm.class.php,v 1.1.2.3.2.1 2006/10/12 13:56:57 minahito Exp $
  */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
@@ -29,16 +29,17 @@
 		BANNERFINISH_SORT_KEY_DATEEND => 'dateend'
 	);
 
-	function fetch()
+	function getDefaultSortKey()
 	{
-		$this->mSort = isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : BANNERFINISH_SORT_KEY_DEFAULT;
+		return BANNERFINISH_SORT_KEY_DEFAULT;
+	}
 	
-		if (!isset($this->mSortKeys[abs($this->mSort)])) {
-			$this->mSort = BANNERFINISH_SORT_KEY_DEFAULT;
-		}
+	function fetch()
+	{
+		parent::fetch();
 	
 		if (isset($_REQUEST['cid'])) {
-			$this->_mNavi->addExtra('cid', xoops_getrequest('cid'));
+			$this->mNavi->addExtra('cid', xoops_getrequest('cid'));
 			$this->_mCriteria->add(new Criteria('cid', xoops_getrequest('cid')));
 		}
 		
Index: xoops2jp/html/modules/legacyRender/admin/forms/BannerclientFilterForm.class.php
diff -u xoops2jp/html/modules/legacyRender/admin/forms/BannerclientFilterForm.class.php:1.1.2.4 xoops2jp/html/modules/legacyRender/admin/forms/BannerclientFilterForm.class.php:1.1.2.4.2.1
--- xoops2jp/html/modules/legacyRender/admin/forms/BannerclientFilterForm.class.php:1.1.2.4	Mon Jul 10 20:10:37 2006
+++ xoops2jp/html/modules/legacyRender/admin/forms/BannerclientFilterForm.class.php	Thu Oct 12 22:56:57 2006
@@ -1,7 +1,7 @@
 <?php
 /**
  * @package legacyRender
- * @version $Id: BannerclientFilterForm.class.php,v 1.1.2.4 2006/07/10 11:10:37 minahito Exp $
+ * @version $Id: BannerclientFilterForm.class.php,v 1.1.2.4.2.1 2006/10/12 13:56:57 minahito Exp $
  */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
@@ -30,23 +30,24 @@
 		BANNERCLIENT_SORT_KEY_PASSWD => 'passwd',
 		BANNERCLIENT_SORT_KEY_EXTRAINFO => 'extrainfo'
 	);
+	
+	function getDefaultSortKey()
+	{
+		return BANNERCLIENT_SORT_KEY_DEFAULT;
+	}
 
 	function fetch()
 	{
-		$this->mSort = isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : BANNERCLIENT_SORT_KEY_DEFAULT;
-	
-		if (!isset($this->mSortKeys[abs($this->mSort)])) {
-			$this->mSort = BANNERCLIENT_SORT_KEY_DEFAULT;
-		}
-	
+		parent::fetch();
+
 		if (isset($_REQUEST['name'])) {
-			$this->_mNavi->addExtra('name', xoops_getrequest('name'));
+			$this->mNavi->addExtra('name', xoops_getrequest('name'));
 			// TODO Changet to 'LIKE' (?)
 			$this->_mCriteria->add(new Criteria('name', xoops_getrequest('name')));
 		}
 	
 		if (isset($_REQUEST['contact'])) {
-			$this->_mNavi->addExtra('contact', xoops_getrequest('contact'));
+			$this->mNavi->addExtra('contact', xoops_getrequest('contact'));
 			// TODO Changet to 'LIKE' (?)
 			$this->_mCriteria->add(new Criteria('contact', xoops_getrequest('contact')));
 		}
Index: xoops2jp/html/modules/legacyRender/admin/forms/BannerFilterForm.class.php
diff -u xoops2jp/html/modules/legacyRender/admin/forms/BannerFilterForm.class.php:1.1.2.5 xoops2jp/html/modules/legacyRender/admin/forms/BannerFilterForm.class.php:1.1.2.5.2.1
--- xoops2jp/html/modules/legacyRender/admin/forms/BannerFilterForm.class.php:1.1.2.5	Mon Jul 10 20:10:48 2006
+++ xoops2jp/html/modules/legacyRender/admin/forms/BannerFilterForm.class.php	Thu Oct 12 22:56:57 2006
@@ -1,7 +1,7 @@
 <?php
 /**
  * @package legacyRender
- * @version $Id: BannerFilterForm.class.php,v 1.1.2.5 2006/07/10 11:10:48 minahito Exp $
+ * @version $Id: BannerFilterForm.class.php,v 1.1.2.5.2.1 2006/10/12 13:56:57 minahito Exp $
  */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
@@ -37,21 +37,22 @@
 		BANNER_SORT_KEY_HTMLCODE => 'htmlcode'
 	);
 
+	function getDefaultSortKey()
+	{
+		return BANNER_SORT_KEY_DEFAULT;
+	}
+
 	function fetch()
 	{
-		$this->mSort = isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : BANNER_SORT_KEY_DEFAULT;
-	
-		if (!isset($this->mSortKeys[abs($this->mSort)])) {
-			$this->mSort = BANNER_SORT_KEY_DEFAULT;
-		}
+		parent::fetch();
 	
 		if (isset($_REQUEST['cid'])) {
-			$this->_mNavi->addExtra('cid', xoops_getrequest('cid'));
+			$this->mNavi->addExtra('cid', xoops_getrequest('cid'));
 			$this->_mCriteria->add(new Criteria('cid', xoops_getrequest('cid')));
 		}
 	
 		if (isset($_REQUEST['htmlbanner'])) {
-			$this->_mNavi->addExtra('htmlbanner', xoops_getrequest('htmlbanner'));
+			$this->mNavi->addExtra('htmlbanner', xoops_getrequest('htmlbanner'));
 			$this->_mCriteria->add(new Criteria('htmlbanner', xoops_getrequest('htmlbanner')));
 		}
 		
Index: xoops2jp/html/modules/legacyRender/admin/forms/TplfileFilterForm.class.php
diff -u xoops2jp/html/modules/legacyRender/admin/forms/TplfileFilterForm.class.php:1.1.2.8.2.1 xoops2jp/html/modules/legacyRender/admin/forms/TplfileFilterForm.class.php:1.1.2.8.2.2
--- xoops2jp/html/modules/legacyRender/admin/forms/TplfileFilterForm.class.php:1.1.2.8.2.1	Sat Oct  7 15:45:22 2006
+++ xoops2jp/html/modules/legacyRender/admin/forms/TplfileFilterForm.class.php	Thu Oct 12 22:56:57 2006
@@ -2,6 +2,8 @@
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
 
+require_once XOOPS_MODULE_PATH . "/legacyRender/class/AbstractFilterForm.class.php";
+
 define('TPLFILE_SORT_KEY_TPL_ID', 1);
 define('TPLFILE_SORT_KEY_TPL_REFID', 2);
 define('TPLFILE_SORT_KEY_TPL_MODULE', 3);
@@ -15,10 +17,9 @@
 
 define('TPLFILE_SORT_KEY_DEFAULT', TPLFILE_SORT_KEY_TPL_ID);
 
-class LegacyRender_TplfileFilterForm
+class LegacyRender_TplfileFilterForm extends LegacyRender_AbstractFilterForm
 {
-	var $mSort = 0;
-	var $_mSortKeys = array(
+	var $mSortKeys = array(
 		TPLFILE_SORT_KEY_DEFAULT => 'tpl_id',
 		TPLFILE_SORT_KEY_TPL_ID => 'tpl_id',
 		TPLFILE_SORT_KEY_TPL_REFID => 'tpl_refid',
@@ -31,31 +32,19 @@
 		TPLFILE_SORT_KEY_TPL_TYPE => 'tpl_type'
 	);
 	
-	var $_mCriteria = null;
-	
-	var $_mAttributes = array();
-	
-	var $_mNavi = null;
-	
 	var $mTplset = null;
 	var $mModule = null;
 
-	function LegacyRender_TplfileFilterForm(&$navi)
-	{
-		$this->_mNavi =& $navi;
-		$this->_mCriteria =& new CriteriaCompo();
-	}
-
 	function fetch()
 	{
-		$this->mSort = isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : TPLFILE_SORT_KEY_DEFAULT;
-	
-		if (abs($this->mSort) > TPLFILE_SORT_KEY_MAXVALUE) {
-			$this->mSort = TPLFILE_SORT_KEY_DEFAULT;
-		}
+		parent::fetch();
+		$this->additionalFetch();
+	}
 	
+	function additionalFetch()
+	{
 		if (isset($_REQUEST['tpl_module'])) {
-			$this->_mNavi->addExtra('tpl_module', xoops_getrequest('tpl_module'));
+			$this->mNavi->addExtra('tpl_module', xoops_getrequest('tpl_module'));
 			$this->_mCriteria->add(new Criteria('tpl_module', array(XOBJ_DTYPE_STRING, xoops_getrequest('tpl_module'))));
 			
 			$handler =& xoops_gethandler('module');
@@ -63,43 +52,19 @@
 		}
 	
 		if (isset($_REQUEST['tpl_type'])) {
-			$this->_mNavi->addExtra('tpl_type', xoops_getrequest('tpl_type'));
+			$this->mNavi->addExtra('tpl_type', xoops_getrequest('tpl_type'));
 			$this->_mCriteria->add(new Criteria('tpl_type', array(XOBJ_DTYPE_STRING, xoops_getrequest('tpl_type'))));
 		}
 		
 		if (isset($_REQUEST['tpl_file'])) {
-			$this->_mNavi->addExtra('tpl_file', xoops_getrequest('tpl_file'));
+			$this->mNavi->addExtra('tpl_file', xoops_getrequest('tpl_file'));
 			$this->_mCriteria->add(new Criteria('tpl_file', '%' . xoops_getrequest('tpl_file') . '%', 'LIKE'));
 		}
 
 		//
 		// @todo We can remove the following code:
 		//
-		$this->_mNavi->addExtra('sort', $this->mSort);
-	}
-
-	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;
+		$this->_mCriteria->addSort($this->getSort(), $this->getOrder());
 	}
 }
 
Index: xoops2jp/html/modules/legacyRender/admin/forms/TplfileSetFilterForm.class.php
diff -u xoops2jp/html/modules/legacyRender/admin/forms/TplfileSetFilterForm.class.php:1.1.2.1.2.1 xoops2jp/html/modules/legacyRender/admin/forms/TplfileSetFilterForm.class.php:1.1.2.1.2.2
--- xoops2jp/html/modules/legacyRender/admin/forms/TplfileSetFilterForm.class.php:1.1.2.1.2.1	Sat Oct  7 15:45:29 2006
+++ xoops2jp/html/modules/legacyRender/admin/forms/TplfileSetFilterForm.class.php	Thu Oct 12 22:56:57 2006
@@ -9,22 +9,10 @@
  */
 class LegacyRender_TplfileSetFilterForm extends LegacyRender_TplfileFilterForm
 {
-	function LegacyRender_TplfileFilterForm(&$navi)
+	function additionalFetch()
 	{
-		$this->_mNavi =& $navi;
-		$this->_mCriteria =& new CriteriaCompo();
-	}
-
-	function fetch()
-	{
-		$this->mSort = isset($_REQUEST['sort']) ? intval($_REQUEST['sort']) : TPLFILE_SORT_KEY_DEFAULT;
-	
-		if (abs($this->mSort) > TPLFILE_SORT_KEY_MAXVALUE) {
-			$this->mSort = TPLFILE_SORT_KEY_DEFAULT;
-		}
-	
 		if (isset($_REQUEST['tpl_module'])) {
-			$this->_mNavi->addExtra('tpl_module', xoops_getrequest('tpl_module'));
+			$this->mNavi->addExtra('tpl_module', xoops_getrequest('tpl_module'));
 			$this->_mCriteria->add(new Criteria('tpl_module', array(XOBJ_DTYPE_STRING, xoops_getrequest('tpl_module'))));
 			
 			$handler =& xoops_gethandler('module');
@@ -32,7 +20,7 @@
 		}
 	
 		if (isset($_REQUEST['tpl_tplset'])) {
-			$this->_mNavi->addExtra('tpl_tplset', xoops_getrequest('tpl_tplset'));
+			$this->mNavi->addExtra('tpl_tplset', xoops_getrequest('tpl_tplset'));
 			
 			//
 			// For the procedure of override, must load 'default' template-set here.
@@ -51,23 +39,21 @@
 		}
 	
 		if (isset($_REQUEST['tpl_type'])) {
-			$this->_mNavi->addExtra('tpl_type', xoops_getrequest('tpl_type'));
+			$this->mNavi->addExtra('tpl_type', xoops_getrequest('tpl_type'));
 			$this->_mCriteria->add(new Criteria('tpl_type', array(XOBJ_DTYPE_STRING, xoops_getrequest('tpl_type'))));
 		}
 		
 		if (isset($_REQUEST['tpl_file'])) {
-			$this->_mNavi->addExtra('tpl_file', xoops_getrequest('tpl_file'));
+			$this->mNavi->addExtra('tpl_file', xoops_getrequest('tpl_file'));
 			$this->_mCriteria->add(new Criteria('tpl_file', '%' . xoops_getrequest('tpl_file') . '%', 'LIKE'));
 		}
 
-		$this->_mNavi->addExtra('sort', $this->mSort);
-
 		//
 		// check filtering criterion and if module & tplset specified mode, then remove paging function.
 		//
 		if ($this->mModule != null && $this->mTplset != null) {
-			$this->_mNavi->setPerpage(0);
-			$this->_mNavi->freezePerpage();
+			$this->mNavi->setPerpage(0);
+			$this->mNavi->freezePerpage();
 		}
 	}
 }


xoops-cvslog メーリングリストの案内
Back to archive index