[xoops-cvslog 3489] CVS update: xoops2jp/html/modules/legacyRender/admin/actions

Back to archive index

Minahito minah****@users*****
2006年 7月 10日 (月) 20:00:49 JST


Index: xoops2jp/html/modules/legacyRender/admin/actions/TplfileListAction.class.php
diff -u xoops2jp/html/modules/legacyRender/admin/actions/TplfileListAction.class.php:1.1.2.11 xoops2jp/html/modules/legacyRender/admin/actions/TplfileListAction.class.php:1.1.2.12
--- xoops2jp/html/modules/legacyRender/admin/actions/TplfileListAction.class.php:1.1.2.11	Sat May 27 22:10:07 2006
+++ xoops2jp/html/modules/legacyRender/admin/actions/TplfileListAction.class.php	Mon Jul 10 20:00:48 2006
@@ -1,19 +1,27 @@
 <?php
+/**
+ * @package legacyRender
+ * @version $Id: TplfileListAction.class.php,v 1.1.2.12 2006/07/10 11:00:48 minahito Exp $
+ */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
 
-require_once XOOPS_MODULE_PATH . "/legacyRender/admin/class/AbstractListAction.class.php";
+require_once XOOPS_MODULE_PATH . "/legacyRender/class/AbstractListAction.class.php";
 require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplfileFilterForm.class.php";
 require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplfileSetFilterForm.class.php";
-
 require_once XOOPS_MODULE_PATH . "/legacyRender/admin/forms/TplfileUploadForm.class.php";
 
 class LegacyRender_TplfileListAction extends LegacyRender_AbstractListAction
 {
+	/**
+	 * A instance of action form for uploading.
+	 * @var LegacyRender_TplfileUploadForm
+	 */
 	var $mActionForm = null;
 	
-	function prepare(&$controller, &$xoopsUser)
+	function prepare(&$controller, &$xoopsUser, $moduleConfig)
 	{
+		LegacyRender_AbstractListAction::prepare($controller, $xoopsUser, $moduleConfig);
 		$this->mActionForm =& new LegacyRender_TplfileUploadForm();
 		$this->mActionForm->prepare();
 	}
@@ -26,7 +34,7 @@
 
 	function &_getFilterForm()
 	{
-		$filter = isset($_REQUEST['tpl_tplset']) ? new LegacyRender_TplfileSetFilterForm($this->mPageNavi) : new LegacyRender_TplfileFilterForm($this->mPageNavi);
+		$filter = isset($_REQUEST['tpl_tplset']) ? new LegacyRender_TplfileSetFilterForm($this->mNavi) : new LegacyRender_TplfileFilterForm($this->mNavi);
 		return $filter;
 	}
 	
@@ -37,7 +45,7 @@
 
 	function getDefaultView(&$controller, &$xoopsUser)
 	{
-		$this->mPageNavi =& new LegacyRender_PageNavigator($this->_getBaseUrl(), 0, XCUBE_PAGENAVI_START | XCUBE_PAGENAVI_PERPAGE);
+		$this->mNavi =& new LegacyRender_PageNavigator($this->_getBaseUrl(), 0, XCUBE_PAGENAVI_START | XCUBE_PAGENAVI_PERPAGE);
 
 		$this->mFilter =& $this->_getFilterForm();
 		$this->mFilter->fetch();
@@ -46,10 +54,10 @@
 	
 		$total = $handler->getCount($this->mFilter->getCriteria());
 		
-		$this->mPageNavi->setTotal($total);
-		$this->mPageNavi->fetch();
+		$this->mNavi->setTotal($total);
+		$this->mNavi->fetch();
 		
-		$criteria = $this->mFilter->getCriteria($this->mPageNavi->getStart(), $this->mPageNavi->getPerpage());
+		$criteria = $this->mFilter->getCriteria($this->mNavi->getStart(), $this->mNavi->getPerpage());
 		
 		if (isset($_REQUEST['tpl_tplset'])) {
 			$this->mObjects =& $handler->getObjectsWithOverride($criteria, xoops_getrequest('tpl_tplset'));
@@ -61,6 +69,9 @@
 		return LEGACYRENDER_FRAME_VIEW_INDEX;
 	}
 
+	/**
+	 * This member function processes the uploaded file.
+	 */
 	function execute(&$controller, &$xoopsUser)
 	{
 		require_once XOOPS_ROOT_PATH . "/class/template.php";
@@ -124,7 +135,11 @@
 		
 		$errorMessage = $successFlag ? _AD_LEGACYRENDER_MESSAGE_UPLOAD_TEMPLATE_SUCCESS : _AD_LEGACYRENDER_ERROR_DBUPDATE_FAILED;
 		
-		XCube_Utils::redirectHeader("index.php?action=TplfileList&amp;tpl_tplset=${last_tplset}&amp;tpl_module=${last_module}",	1, $errorMessage);
+		//
+		// No good exmaple ;)
+		// Because some local variables are used, jump directly without the return value of view status.
+		//
+		$controller->executeRedirect("index.php?action=TplfileList&tpl_tplset=${last_tplset}&tpl_module=${last_module}", 1, $errorMessage);
 	}
 
 	function executeViewIndex(&$controller, &$xoopsUser, &$render)
@@ -141,7 +156,7 @@
 		}
 		
 		$render->setAttribute('objects', $this->mObjects);
-		$render->setAttribute('pageNavi', $this->mPageNavi);
+		$render->setAttribute('pageNavi', $this->mNavi);
 		$render->setAttribute('filterForm', $this->mFilter);
 		$render->setAttribute('actionForm', $this->mActionForm);
 		


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