[xoops-cvslog 3401] CVS update: xoops2jp/html/modules/base/admin/class

Back to archive index

Minahito minah****@users*****
2006年 7月 1日 (土) 16:24:56 JST


Index: xoops2jp/html/modules/base/admin/class/ModuleUninstaller.class.php
diff -u xoops2jp/html/modules/base/admin/class/ModuleUninstaller.class.php:1.1.2.8 xoops2jp/html/modules/base/admin/class/ModuleUninstaller.class.php:1.1.2.9
--- xoops2jp/html/modules/base/admin/class/ModuleUninstaller.class.php:1.1.2.8	Tue Mar 28 22:28:56 2006
+++ xoops2jp/html/modules/base/admin/class/ModuleUninstaller.class.php	Sat Jul  1 16:24:56 2006
@@ -21,12 +21,12 @@
 		$module =& $moduleHandler->getByDirname($dirname);
 
 		if (!is_object($module)) {
-			$this->mLog->addError("*Module not found*");
+			$this->mLog->addError(_AD_BASE_ERROR_MODULE_NOT_FOUND);
 			return $error;
 		}
 		
 		if ($module->getVar('isactive') != 0) {
-			$this->mLog->addError("*For uninstall, turn off the active-status of the module.*");
+			$this->mLog->addError(_AD_BASE_ERROR_CASE_OF_ACTIVE_MODULE);
 			return $error;
 		}
 
@@ -40,10 +40,10 @@
 	{
 		$moduleHandler =& xoops_gethandler('module');
 		if (!$moduleHandler->delete($this->mModule)) {
-			$this->mLog->addError("*Could not delete module information from XOOPS database.*");
+			$this->mLog->addError(_AD_BASE_ERROR_DELETE_MODULEINFO_FROM_DB);
 		}
 		else {
-			$this->mLog->addReport("*Delete module information from XOOPS database.*");
+			$this->mLog->addReport(_AD_BASE_MESSAGE_DELETE_MODULEINFO_FROM_DB);
 		}
 	}
 
@@ -63,10 +63,10 @@
 
 				$sql = "DROP TABLE " . $db->prefix($table);
 				if ($db->query($sql)) {
-					$this->mLog->addReport("Drop table " . $db->prefix($table));
+					$this->mLog->addReport(XCube_Utils::formatMessage(_AD_BASE_MESSAGE_DROP_TABLE, $db->prefix($table)));
 				}
 				else {
-					$this->mLog->addError("Could not drop table " . $db->prefix($table));
+					$this->mLog->addError(XCube_Utils::formatMessage(_AD_BASE_ERROR_DROP_TABLE, $db->prefix($table)));
 				}
 			}
 		}
@@ -81,8 +81,10 @@
 
 		$deleteTemplates =& $tplHandler->find(null, 'module', $this->mModule->getVar('mid'));
 		
-		foreach($deleteTemplates as $template) {
-			$tplHandler->delete($template);
+		foreach($deleteTemplates as $tpl) {
+			if (!$tplHandler->delete($tpl)) {
+				$this->mLog->addError(XCube_Utils::formatMessage(_AD_BASE_ERROR_TEMPLATE_UNINSTALLED, $tpl->getVar('tpl_file')));
+			}
 		}
 	}
 
@@ -99,7 +101,7 @@
 		$gpermHandler =& xoops_gethandler('groupperm');
 		foreach ($blocks as $block) {
 			$blockHandler->delete($block);
-			$this->mLog->addReport("Uninstall block '".$block->getVar('name'));
+			$this->mLog->addReport(XCube_Utils::formatMessage(_AD_BASE_MESSAGE_BLOCK_HAS_BEEN_UNINSTALLED, $block->get('name')));
 
 			//
 			// delete permission
@@ -114,7 +116,7 @@
 		$tplHandler =& xoops_gethandler('tplfile');
 		$criteria =& new Criteria('tpl_module', $this->mModule->getVar('dirname'));
 		if(!$tplHandler->deleteAll($criteria)) {
-			$this->mLog->addError("Could not delete block templates : " . $tplHandler->db->error());
+			$this->mLog->addError(XCube_Utils::formatMessage(_AD_BASE_ERROR_COULD_NOT_DELETE_BLOCK_TEMPLATES, $tplHandler->db->error()));
 		}
 	}
 
@@ -131,11 +133,26 @@
 			$funcName = 'xoops_module_uninstall_' . $this->mModule->getVar('dirname');
 			if (function_exists($funcName)) {
 				if (!call_user_func($funcName, $this->mModule)) {
-					$this->mLog->addError("Failed to execute " . $funcName);
+					$this->mLog->addError(XCube_Utils::formatMessage(_AD_BASE_ERROR_FAILED_TO_EXECUTE_CALLBACK, $funcName));
 				}
 			}
 		}
 	}
+	
+	function _processReport()
+	{
+		if (!$this->mLog->hasError()) {
+			$this->mLog->add(XCube_Utils::formatMessage(_AD_BASE_MESSAGE_UNINSTALLATION_MODULE_SUCCESSFUL, $this->mModule->get('name')));
+		}
+		else {
+			if (is_object($this->mModule)) {
+				$this->mModule->addError(XCube_Utils::formatMessage(_AD_BASE_ERROR_UNINSTALLATION_MODULE_FAILURE, $this->mModule->get('name')));
+			}
+			else {
+				$this->mModule->addError(XCube_Utils::formatMessage(_AD_BASE_ERROR_UNINSTALLATION_MODULE_FAILURE, $this->mDirname));
+			}
+		}
+	}
 }
 
 ?>
\ No newline at end of file
Index: xoops2jp/html/modules/base/admin/class/ModuleUpdater.class.php
diff -u xoops2jp/html/modules/base/admin/class/ModuleUpdater.class.php:1.1.2.7 xoops2jp/html/modules/base/admin/class/ModuleUpdater.class.php:1.1.2.8
--- xoops2jp/html/modules/base/admin/class/ModuleUpdater.class.php:1.1.2.7	Mon May 22 15:28:50 2006
+++ xoops2jp/html/modules/base/admin/class/ModuleUpdater.class.php	Sat Jul  1 16:24:56 2006
@@ -13,7 +13,7 @@
 	 */
 	function execute()
 	{
-		$this->mLog->addReport("Update started");
+		$this->mLog->addReport(_AD_BASE_MESSAGE_UPDATE_STARTED);
 		
 		parent::execute();
 	}
@@ -63,7 +63,7 @@
 			
 			foreach ($delTemplates as $tpl) {
 				if (!$tplHandler->delete($tpl)) {
-					$this->mLog->addError(@sprintf(_MD_A_BASE_ERROR_DELETE_TEMPLATE, $tpl->getVar('tpl_file')));
+					$this->mLog->addError(XCube_Utils::formatMessage(_AD_BASE_ERROR_TEMPLATE_UNINSTALLED, $tpl->getVar('tpl_file')));
 				}
 			}
 		}
@@ -181,6 +181,21 @@
 			}
 		}
 	}
+	
+	function _processReport()
+	{
+		if (!$this->mLog->hasError()) {
+			$this->mLog->add(XCube_Utils::formatMessage(_AD_BASE_MESSAGE_UPDATING_MODULE_SUCCESSFUL, $this->mModule->get('name')));
+		}
+		else {
+			if (is_object($this->mModule)) {
+				$this->mModule->addError(XCube_Utils::formatMessage(_AD_BASE_ERROR_UPDATING_MODULE_FAILURE, $this->mModule->get('name')));
+			}
+			else {
+				$this->mModule->addError(XCube_Utils::formatMessage(_AD_BASE_ERROR_UPDATING_MODULE_FAILURE, $this->mDirname));
+			}
+		}
+	}
 }
 
 ?>
\ No newline at end of file


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