[xoops-cvslog 5834] CVS update: xoops2jp/html/modules/legacy/admin/class

Back to archive index

Minahito minah****@users*****
2006年 11月 13日 (月) 20:11:35 JST


Index: xoops2jp/html/modules/legacy/admin/class/ModuleUninstaller.class.php
diff -u xoops2jp/html/modules/legacy/admin/class/ModuleUninstaller.class.php:1.1.2.8 xoops2jp/html/modules/legacy/admin/class/ModuleUninstaller.class.php:1.1.2.9
--- xoops2jp/html/modules/legacy/admin/class/ModuleUninstaller.class.php:1.1.2.8	Mon Nov 13 19:53:44 2006
+++ xoops2jp/html/modules/legacy/admin/class/ModuleUninstaller.class.php	Mon Nov 13 20:11:35 2006
@@ -2,7 +2,6 @@
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
 
-require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleUtils.class.php";
 require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleInstallUtils.class.php";
 
 class Legacy_ModuleUninstaller
@@ -11,7 +10,7 @@
 	 * This instance is prepared automatically in the constructor.
 	 * 
 	 * @public
-	 * @var Legacy_ModuleUtilsSimpleLog
+	 * @var Legacy_ModuleInstallLog
 	 */
 	var $mLog = null;
 	
@@ -25,7 +24,7 @@
 	
 	function Legacy_ModuleUninstaller()
 	{
-		$this->mLog =& new Legacy_ModuleUtilsSimpleLog();
+		$this->mLog =& new Legacy_ModuleInstallLog();
 	}
 	
 	/**
Index: xoops2jp/html/modules/legacy/admin/class/ModuleUpdater.class.php
diff -u xoops2jp/html/modules/legacy/admin/class/ModuleUpdater.class.php:1.1.2.12 xoops2jp/html/modules/legacy/admin/class/ModuleUpdater.class.php:1.1.2.13
--- xoops2jp/html/modules/legacy/admin/class/ModuleUpdater.class.php:1.1.2.12	Sun Nov 12 02:50:44 2006
+++ xoops2jp/html/modules/legacy/admin/class/ModuleUpdater.class.php	Mon Nov 13 20:11:35 2006
@@ -6,7 +6,6 @@
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
 
-require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleUtils.class.php";
 require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleInstallUtils.class.php";
 
 /**
@@ -60,7 +59,7 @@
 	 * This instance is prepared automatically in the constructor.
 	 * 
 	 * @public
-	 * @var Legacy_ModuleUtilsSimpleLog
+	 * @var Legacy_ModuleInstallLog
 	 */
 	var $mLog = null;
 	
@@ -91,7 +90,7 @@
 	
 	function Legacy_ModulePhasedUpgrader()
 	{
-		$this->mLog =& new Legacy_ModuleUtilsSimpleLog();
+		$this->mLog =& new Legacy_ModuleInstallLog();
 	}
 	
 	/**
Index: xoops2jp/html/modules/legacy/admin/class/ModuleInstallUtils.class.php
diff -u xoops2jp/html/modules/legacy/admin/class/ModuleInstallUtils.class.php:1.1.2.9 xoops2jp/html/modules/legacy/admin/class/ModuleInstallUtils.class.php:1.1.2.10
--- xoops2jp/html/modules/legacy/admin/class/ModuleInstallUtils.class.php:1.1.2.9	Mon Nov 13 19:53:44 2006
+++ xoops2jp/html/modules/legacy/admin/class/ModuleInstallUtils.class.php	Mon Nov 13 20:11:35 2006
@@ -6,6 +6,47 @@
 require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleUpdater.class.php";
 require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleUninstaller.class.php";
 
+require_once XOOPS_ROOT_PATH."/class/template.php";
+
+define("MODINSTALL_LOGTYPE_REPORT", "report");
+define("MODINSTALL_LOGTYPE_WARNING", "warning");
+define("MODINSTALL_LOGTYPE_ERROR", "error");
+
+/**
+ * A temporary log class.
+ */
+class Legacy_ModuleInstallLog
+{
+	var $mFetalErrorFlag = false;
+	var $mMessages = array();
+
+	function add($msg)
+	{
+		$this->mMessages[] = array('type' => MODINSTALL_LOGTYPE_REPORT, 'message' => $msg);
+	}
+
+	function addReport($msg)
+	{
+		$this->add($msg);
+	}
+	
+	function addWarning($msg)
+	{
+		$this->mMessages[] = array('type' => MODINSTALL_LOGTYPE_WARNING, 'message' => $msg);
+	}
+
+	function addError($msg)
+	{
+		$this->mMessages[] = array('type' => MODINSTALL_LOGTYPE_ERROR, 'message' => $msg);
+		$this->mFetalErrorFlag = true;
+	}
+	
+	function hasError()
+	{
+		return $this->mFetalErrorFlag;
+	}
+}
+
 /**
  * This class is collection of static utility functions for module installation.
  * These functions are useful for Legacy modules' system-fixed-installer and
@@ -98,7 +139,7 @@
 	 * 
 	 * @static
 	 * @param XoopsModule $module
-	 * @param Legacy_ModuleUtilsSimpleLog $log
+	 * @param Legacy_ModuleInstallLog $log
 	 * @note FOR THE CUSTOM-INSTALLER
 	 */
 	function installSQLAutomatically(&$module, &$log)
@@ -205,7 +246,7 @@
 	 * 
 	 * @static
 	 * @param XoopsModule $module
-	 * @param Legacy_ModuleUtilsSimpleLog $log
+	 * @param Legacy_ModuleInstallLog $log
 	 * @note FOR THE CUSTOM-INSTALLER
 	 * @see Legacy_ModuleInstallUtils::uninstallAllOfModuleTemplates()
 	 */	
@@ -230,7 +271,7 @@
 	 * @static
 	 * @param XoopsModule $module
 	 * @param string[][] $template
-	 * @param Legacy_ModuleUtilsSimpleLog $log
+	 * @param Legacy_ModuleInstallLog $log
 	 * @return bool
 	 * 
 	 * @note This is not usefull a litte for custom-installers.
@@ -293,7 +334,7 @@
 	 * 
 	 * @static
 	 * @param XoopsModule $module
-	 * @param Legacy_ModuleUtilsSimpleLog $log
+	 * @param Legacy_ModuleInstallLog $log
 	 * @param bool $defaultOnly Indicates whether this function deletes templates from all of tplsets.
 	 * @note FOR THE CUSTOM-INSTALLER
 	 * @see Legacy_ModuleInstallUtils::installAllOfModuleTemplates()
@@ -337,7 +378,7 @@
 	 * 
 	 * @static
 	 * @param XoopsModule $module
-	 * @param Legacy_ModuleUtilsSimpleLog $log
+	 * @param Legacy_ModuleInstallLog $log
 	 * @note FOR THE CUSTOM-INSTALLER
 	 * @see Legacy_ModuleInstallUtils::uninstallAllOfBlocks()
 	 */	
@@ -365,7 +406,7 @@
 	 * 
 	 * @static
 	 * @param XoopsModule $module
-	 * @param Legacy_ModuleUtilsSimpleLog $log
+	 * @param Legacy_ModuleInstallLog $log
 	 * @return bool
 	 * 
 	 * @note FOR THE CUSTOM-INSTALLER
@@ -513,7 +554,7 @@
 	 * permissions for the block.
 	 * 
 	 * @param XoopsBlock $block
-	 * @param Legacy_ModuleUtilsSimpleLog $log
+	 * @param Legacy_ModuleInstallLog $log
 	 * @note FOR THE CUSTOM-INSTALLER
 	 * 
 	 * @todo error handling & delete the block's template.
@@ -1238,7 +1279,9 @@
 		
 		foreach (array_keys($blockArr) as $idx) {
 			$info =& $this->_createBlockInformation($blockArr[$idx]);
-			$collection->add($info);
+			while (!$collection->add($info)) {
+				$info->mFuncNum++;
+			}
 		}
 		
 		return $collection;
Index: xoops2jp/html/modules/legacy/admin/class/ModuleInstaller.class.php
diff -u xoops2jp/html/modules/legacy/admin/class/ModuleInstaller.class.php:1.1.2.6 xoops2jp/html/modules/legacy/admin/class/ModuleInstaller.class.php:1.1.2.7
--- xoops2jp/html/modules/legacy/admin/class/ModuleInstaller.class.php:1.1.2.6	Fri Nov  3 14:47:08 2006
+++ xoops2jp/html/modules/legacy/admin/class/ModuleInstaller.class.php	Mon Nov 13 20:11:35 2006
@@ -6,7 +6,6 @@
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
 
-require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleUtils.class.php";
 require_once XOOPS_LEGACY_PATH . "/admin/class/ModuleInstallUtils.class.php";
 
 /**
@@ -19,7 +18,7 @@
 {
 	/**
 	 * @public
-	 * @var Legacy_ModuleUtilsSimpleLog
+	 * @var Legacy_ModuleInstallLog
 	 */
 	var $mLog = null;
 	
@@ -32,7 +31,7 @@
 	
 	function Legacy_ModuleInstaller()
 	{
-		$this->mLog =& new Legacy_ModuleUtilsSimpleLog();
+		$this->mLog =& new Legacy_ModuleInstallLog();
 	}
 
 	/**


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