[xoops-cvslog 3819] CVS update: xoops2jp/html/modules/base/admin/actions

Back to archive index

Minahito minah****@users*****
2006年 8月 1日 (火) 19:34:48 JST


Index: xoops2jp/html/modules/base/admin/actions/ModuleListAction.class.php
diff -u xoops2jp/html/modules/base/admin/actions/ModuleListAction.class.php:1.1.2.6 xoops2jp/html/modules/base/admin/actions/ModuleListAction.class.php:1.1.2.7
--- xoops2jp/html/modules/base/admin/actions/ModuleListAction.class.php:1.1.2.6	Mon Jul 31 19:33:15 2006
+++ xoops2jp/html/modules/base/admin/actions/ModuleListAction.class.php	Tue Aug  1 19:34:48 2006
@@ -1,6 +1,7 @@
 <?php
 /**
- * @version $Id: ModuleListAction.class.php,v 1.1.2.6 2006/07/31 10:33:15 minahito Exp $
+ * @package Legacy
+ * @version $Id: ModuleListAction.class.php,v 1.1.2.7 2006/08/01 10:34:48 minahito Exp $
  */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
@@ -10,7 +11,6 @@
 
 class Legacy_ModuleListAction extends Legacy_Action
 {
-	var $mDB = null;
 	var $mModuleObjects = array();
 	var $mFilter = null;
 
@@ -18,8 +18,6 @@
 
 	function prepare(&$controller, &$xoopsUser)
 	{
-		$this->mDB =& $controller->getDB();
-		
 		$this->mActionForm =& new Legacy_ModuleListForm();
 		$this->mActionForm->prepare();
 	}
@@ -27,13 +25,13 @@
 
 	function getDefaultView(&$controller, &$xoopsUser)
 	{
-		$this->mFilter =& new ModuleListFilterForm();
+		$this->mFilter =& new Legacy_ModuleListFilterForm();
 		$this->mFilter->fetch();
 		
 		$moduleHandler =& xoops_gethandler('module');
 
 		// dmy
-		$criteria =& new Criteria('mid',0,'>');
+		$criteria =& new Criteria('mid', 0, '>');
 		$criteria->setSort($this->mFilter->getSort());
 		$criteria->setOrder($this->mFilter->getOrder());
 		
@@ -44,6 +42,10 @@
 	
 	function execute(&$controller, &$xoopsUser)
 	{
+		if (xoops_getrequest('_form_control_cancel') != null) {
+			return LEGACY_FRAME_VIEW_CANCEL;
+		}
+
 		$this->mActionForm->fetch();
 		$this->mActionForm->validate();
 
@@ -58,14 +60,14 @@
 	function _processConfirm(&$controller,&$xoopsUser)
 	{
 		$moduleHandler =& xoops_gethandler('module');
-		$objects =& $moduleHandler->getObjects();
+		$t_objectArr =& $moduleHandler->getObjects();
 
 		//
 		// Do mapping.
 		//
-		foreach ($objects as $modObject) {
-			$this->mModuleObjects[$modObject->get('mid')] =& $modObject;
-			unset($modObject);
+		foreach ($t_objectArr as $module) {
+			$this->mModuleObjects[$module->get('mid')] =& $module;
+			unset($module);
 		}
 
 		return LEGACY_FRAME_VIEW_INPUT;
@@ -74,19 +76,19 @@
 	function _processSave(&$controller, &$xoopsUser)
 	{
 		$moduleHandler =& xoops_gethandler('module');
-		$objects =& $moduleHandler->getObjects();
+		$t_objectArr =& $moduleHandler->getObjects();
 		
 		$successFlag = true;
-		foreach($objects as $modObject) {
-			$mid = $modObject->get('mid');
-			$modObject->set('name', $this->mActionForm->get('name', $mid));
-			$modObject->set('weight', $this->mActionForm->get('weight', $mid));
-			$modObject->set('isactive', $this->mActionForm->get('isactive', $mid));
+		foreach($t_objectArr as $module) {
+			$mid = $module->get('mid');
+			$module->set('name', $this->mActionForm->get('name', $mid));
+			$module->set('weight', $this->mActionForm->get('weight', $mid));
+			$module->set('isactive', $this->mActionForm->get('isactive', $mid));
 
 			//
 			// Store.
 			//
-			$successFlag &= $moduleHandler->insert($modObject);
+			$successFlag &= $moduleHandler->insert($module);
 		}
 		
 		return $successFlag ? LEGACY_FRAME_VIEW_SUCCESS : LEGACY_FRAME_VIEW_ERROR;
@@ -105,8 +107,8 @@
 		// To support a template writer, this send the list of mid that
 		// actionForm kept.
 		//
-		$tarray=&$this->mActionForm->get('name');
-		$render->setAttribute('mids', array_keys($tarray));
+		$t_arr =& $this->mActionForm->get('name');
+		$render->setAttribute('mids', array_keys($t_arr));
 	}
 
 	function executeViewIndex(&$controller, &$xoopsUser, &$render)
@@ -131,10 +133,12 @@
 
 	function executeViewError(&$controller, &$xoopsUser, &$renderer)
 	{
-		//
-		// TODO removed
-		//
-		$controller->executeRedirect('./index.php?action=ModuleList', 1, "*ERROR*");
+		$controller->executeRedirect('./index.php?action=ModuleList', 1, _AD_BASE_ERROR_DBUPDATE_FAILED);
+	}
+
+	function executeViewCancel(&$controller,&$xoopsUser,&$renderer)
+	{
+		$controller->executeForward('./index.php?action=ModuleList');
 	}
 }
 


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