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

Back to archive index

Minahito minah****@users*****
2006年 8月 7日 (月) 20:28:45 JST


Index: xoops2jp/html/modules/base/admin/actions/PreferenceEditAction.class.php
diff -u xoops2jp/html/modules/base/admin/actions/PreferenceEditAction.class.php:1.1.2.11 xoops2jp/html/modules/base/admin/actions/PreferenceEditAction.class.php:1.1.2.12
--- xoops2jp/html/modules/base/admin/actions/PreferenceEditAction.class.php:1.1.2.11	Sat Aug  5 15:18:02 2006
+++ xoops2jp/html/modules/base/admin/actions/PreferenceEditAction.class.php	Mon Aug  7 20:28:45 2006
@@ -13,14 +13,16 @@
 
 	var $mObjects = array();
 	var $mActionForm = null;
+	
+	var $mState = null;
 
 	function prepare(&$controller, &$xoopsUser)
 	{
 		$controller->mRoot->mLanguageManager->loadPageTypeMessageCatalog('comment');
 		$controller->mRoot->mLanguageManager->loadPageTypeMessageCatalog('notification');
 
-		$state = (xoops_getrequest('confmod_id') > 0) ? new Legacy_ModulePreferenceEditState($this) : new Legacy_PreferenceEditState($this);
-		$state->prepare($controller, $xoopsUser);
+		$this->mState = (xoops_getrequest('confmod_id') > 0) ? new Legacy_ModulePreferenceEditState($this) : new Legacy_PreferenceEditState($this);
+		$this->mState->prepare($controller, $xoopsUser);
 		
 		if ($this->mPreparedFlag) {
 			$handler =& xoops_gethandler('config');
@@ -49,6 +51,10 @@
 			return LEGACY_FRAME_VIEW_ERROR;
 		}
 		
+		if (xoops_getrequest('_form_control_cancel') != null) {
+			return LEGACY_FRAME_VIEW_CANCEL;
+		}
+		
 		$this->mActionForm->fetch();
 		$this->mActionForm->validate();
 		
@@ -141,7 +147,7 @@
 
 	function executeViewSuccess(&$controller, &$xoopsUser, &$render)
 	{
-		$controller->executeForward("./index.php?action=PreferenceList");
+		$this->mState->executeViewSuccess($controller, $xoopsUser, $render);
 	}
 
 	function executeViewError(&$controller, &$xoopsUser, &$render)
@@ -151,7 +157,7 @@
 	
 	function executeViewCancel(&$controller, &$xoopsUser, &$render)
 	{
-		$controller->executeForward("./index.php?action=PreferenceList");
+		$this->mState->executeViewCancel($controller, $xoopsUser, $render);
 	}
 }
 
@@ -167,6 +173,14 @@
 	function prepare(&$controller, &$xoopsUser)
 	{
 	}
+	
+	function executeViewSuccess(&$controller, &$xoopsUser, &$render)
+	{
+	}
+
+	function executeViewCancel(&$controller, &$xoopsUser, &$render)
+	{
+	}
 }
 
 class Legacy_PreferenceEditState extends Legacy_AbstractPreferenceEditState
@@ -186,6 +200,16 @@
 		
 		$this->_mMaster->mPreparedFlag = true;
 	}
+	
+	function executeViewSuccess(&$controller, &$xoopsUser, &$render)
+	{
+		$controller->executeForward("./index.php?action=PreferenceList");
+	}
+
+	function executeViewCancel(&$controller, &$xoopsUser, &$render)
+	{
+		$controller->executeForward("./index.php?action=PreferenceList");
+	}
 }
 
 class Legacy_ModulePreferenceEditState extends Legacy_AbstractPreferenceEditState
@@ -211,6 +235,22 @@
 		
 		$this->_mMaster->mPreparedFlag = true;
 	}
+
+	function executeViewSuccess(&$controller, &$xoopsUser, &$render)
+	{
+		//
+		// TODO The following URL is a wrong for some module which hasn't admin directory.
+		//
+		$controller->executeForward(XOOPS_MODULE_URL . '/' . $this->_mMaster->mModule->get('dirname') . '/admin/');
+	}
+
+	function executeViewCancel(&$controller, &$xoopsUser, &$render)
+	{
+		//
+		// TODO The following URL is a wrong for some module which hasn't admin directory.
+		//
+		$controller->executeForward(XOOPS_MODULE_URL . '/' . $this->_mMaster->mModule->get('dirname') . '/admin/');
+	}
 }
 
 ?>


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