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

Zurück zum Archiv-Index

Minahito minah****@users*****
2006年 7月 27日 (木) 14:58:56 JST


Index: xoops2jp/html/modules/base/admin/actions/ModuleUpdateAction.class.php
diff -u xoops2jp/html/modules/base/admin/actions/ModuleUpdateAction.class.php:1.1.2.5 xoops2jp/html/modules/base/admin/actions/ModuleUpdateAction.class.php:1.1.2.6
--- xoops2jp/html/modules/base/admin/actions/ModuleUpdateAction.class.php:1.1.2.5	Tue May 30 12:55:18 2006
+++ xoops2jp/html/modules/base/admin/actions/ModuleUpdateAction.class.php	Thu Jul 27 14:58:56 2006
@@ -1,6 +1,7 @@
 <?php
 /**
- * @version $Id: ModuleUpdateAction.class.php,v 1.1.2.5 2006/05/30 03:55:18 minahito Exp $
+ * @package Legacy
+ * @version $Id: ModuleUpdateAction.class.php,v 1.1.2.6 2006/07/27 05:58:56 minahito Exp $
  */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
@@ -11,6 +12,27 @@
 
 class Legacy_ModuleUpdateAction extends Legacy_AbstractModuleInstallAction
 {
+	/**
+	 * @var XCube_NewDelegate
+	 */
+	var $mUpdateSuccess = null;
+	
+	/**
+	 * @var XCube_NewDelegate
+	 */
+	var $mUpdateFail = null;
+
+	function Legacy_ModuleUpdateAction($flag)
+	{
+		parent::Legacy_AbstractModuleInstallAction($flag);
+		
+		$this->mUpdateSuccess =& new XCube_NewDelegate();
+		$this->mUpdateSuccess->register('Legacy_ModuleUpdateAction.UpdateSuccess');
+		
+		$this->mUpdateFail =& new XCube_NewDelegate();
+		$this->mUpdateFail->register('Legacy_ModuleUpdateAction.UpdateFail');
+	}
+
 	function &_getInstaller($dirname)
 	{
 		$installer =& new Legacy_ModuleUpdater($dirname);
@@ -23,20 +45,32 @@
 		$this->mActionForm->prepare();
 	}
 	
-	function executeViewSuccess(&$controller,&$xoopsUser,&$renderer)
+	function executeViewSuccess(&$controller, &$xoopsUser, &$renderer)
 	{
-		$root =& XCube_Root::getSingleton();
-		$root->mEventManager->raiseEvent("Module.Legacy.ModuleUpdate.Success", $this, $this->mModuleObject);
+		if (!$this->mLog->hasError()) {
+			$this->mUpdateSuccess->call(new XCube_Ref($this->mModuleObject));
+			XCube_DelegateUtils::call('Legacy.Admin.Event.ModuleUpdate.' . ucfirst($this->mModuleObject->get('dirname') . '.Success'), new XCube_Ref($this->mModuleObject));
+		}
+		else {
+			$this->mUpdateFail->call(new XCube_Ref($this->mModuleObject));
+			XCube_DelegateUtils::call('Legacy.Admin.Event.ModuleUpdate.' . ucfirst($this->mModuleObject->get('dirname') . '.Fail'), new XCube_Ref($this->mModuleObject));
+		}
 		
 		$renderer->setTemplateName("module_update_success.html");
-		$renderer->setAttribute('log',$this->mLog->mMessages);
+		$renderer->setAttribute('module', $this->mLog->mModuleObject);
+		$renderer->setAttribute('log', $this->mLog->mMessages);
 	}
 
-	function executeViewIndex(&$controller,&$xoopsUser,&$renderer)
+	function executeViewIndex(&$controller, &$xoopsUser, &$renderer)
 	{
 		$renderer->setTemplateName("module_update.html");
-		$renderer->setAttribute('module',$this->mModuleObject);
-		$renderer->setAttribute('actionForm',$this->mActionForm);
+		$renderer->setAttribute('module', $this->mModuleObject);
+		$renderer->setAttribute('actionForm', $this->mActionForm);
+	}
+	
+	function executeViewCancel(&$controller, &$xoopsUser, &$renderer)
+	{
+		$controller->executeForward("./index.php?action=ModuleList");
 	}
 }
 
Index: xoops2jp/html/modules/base/admin/actions/ModuleUninstallAction.class.php
diff -u xoops2jp/html/modules/base/admin/actions/ModuleUninstallAction.class.php:1.1.2.5 xoops2jp/html/modules/base/admin/actions/ModuleUninstallAction.class.php:1.1.2.6
--- xoops2jp/html/modules/base/admin/actions/ModuleUninstallAction.class.php:1.1.2.5	Tue Mar 28 22:28:35 2006
+++ xoops2jp/html/modules/base/admin/actions/ModuleUninstallAction.class.php	Thu Jul 27 14:58:56 2006
@@ -1,6 +1,6 @@
 <?php
 /**
- * @version $Id: ModuleUninstallAction.class.php,v 1.1.2.5 2006/03/28 13:28:35 minahito Exp $
+ * @version $Id: ModuleUninstallAction.class.php,v 1.1.2.6 2006/07/27 05:58:56 minahito Exp $
  */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
@@ -14,6 +14,27 @@
  */
 class Legacy_ModuleUninstallAction extends Legacy_AbstractModuleInstallAction
 {
+	/**
+	 * @var XCube_NewDelegate
+	 */
+	var $mUninstallSuccess = null;
+	
+	/**
+	 * @var XCube_NewDelegate
+	 */
+	var $mUninstallFail = null;
+	
+	function Legacy_ModuleUninstallAction($flag)
+	{
+		parent::Legacy_AbstractModuleInstallAction($flag);
+		
+		$this->mUninstallSuccess =& new XCube_NewDelegate();
+		$this->mUninstallSuccess->register('Legacy_ModuleUninstallAction.UninstallSuccess');
+		
+		$this->mUninstallFail =& new XCube_NewDelegate();
+		$this->mUninstallFail->register('Legacy_ModuleUninstallAction.UninstallFail');
+	}
+
 	function &_getInstaller($dirname)
 	{
 		$installer =& new Legacy_ModuleUninstaller($dirname);
@@ -26,22 +47,37 @@
 		$this->mActionForm->prepare();
 	}
 
-	function executeViewSuccess(&$controller,&$xoopsUser,&$renderer)
+	function executeViewSuccess(&$controller, &$xoopsUser, &$renderer)
 	{
+		if (!$this->mLog->hasError()) {
+			$this->mUninstallSuccess->call(new XCube_Ref($this->mModuleObject));
+			XCube_DelegateUtils::call('Legacy.Admin.Event.ModuleUninstall.' . ucfirst($this->mModuleObject->get('dirname') . '.Success'), new XCube_Ref($this->mModuleObject));
+		}
+		else {
+			$this->mUninstallFail->call(new XCube_Ref($this->mModuleObject));
+			XCube_DelegateUtils::call('Legacy.Admin.Event.ModuleUninstall.' . ucfirst($this->mModuleObject->get('dirname') . '.Fail'), new XCube_Ref($this->mModuleObject));
+		}
+
 		$renderer->setTemplateName("module_uninstall_success.html");
-		$renderer->setAttribute('log',$this->mLog->mMessages);
+		$renderer->setAttribute('module',$this->mModuleObject);
+		$renderer->setAttribute('log', $this->mLog->mMessages);
 	}
 
-	function executeViewIndex(&$controller,&$xoopsUser,&$renderer)
+	function executeViewIndex(&$controller, &$xoopsUser, &$renderer)
 	{
 		$renderer->setTemplateName("module_uninstall.html");
-		$renderer->setAttribute('actionForm',$this->mActionForm);
-		$renderer->setAttribute('module',$this->mModuleObject);
+		$renderer->setAttribute('actionForm', $this->mActionForm);
+		$renderer->setAttribute('module', $this->mModuleObject);
+	}
+
+	function executeViewInput(&$controller, &$xoopsUser, &$renderer)
+	{
+		$this->executeViewIndex(&$controller, &$xoopsUser, &$renderer);
 	}
 
-	function executeViewInput(&$controller,&$xoopsUser,&$renderer)
+	function executeViewCancel(&$controller, &$xoopsUser, &$renderer)
 	{
-		$this->executeViewIndex(&$controller,&$xoopsUser,&$renderer);
+		$controller->executeForward("./index.php?action=ModuleList");
 	}
 }
 


xoops-cvslog メーリングリストの案内
Zurück zum Archiv-Index