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

Zurück zum Archiv-Index

Minahito minah****@users*****
2006年 11月 11日 (土) 17:37:45 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.5 xoops2jp/html/modules/legacy/admin/class/ModuleUninstaller.class.php:1.1.2.6
--- xoops2jp/html/modules/legacy/admin/class/ModuleUninstaller.class.php:1.1.2.5	Thu Nov  2 00:02:35 2006
+++ xoops2jp/html/modules/legacy/admin/class/ModuleUninstaller.class.php	Sat Nov 11 17:37:45 2006
@@ -75,18 +75,31 @@
 		$root =& XCube_Root::getSingleton();
 		$db =& $root->mController->getDB();
 
+		$dirname = $this->_mXoopsModule->get('dirname');
+		$t_search = array('{prefix}', '{dirname}', '{Dirname}', '{_dirname_}');
+		$t_replace = array(XOOPS_DB_PREFIX, strtolower($dirname), ucfirst(strtolower($dirname)), $dirname);
+		
 		$tables = $this->_mXoopsModule->getInfo('tables');
 		if ($tables != false && is_array($tables)) {
 			foreach($tables as $table) {
 				//
 				// TODO Do we need to check reserved core tables?
 				//
-				$sql = "DROP TABLE " . $db->prefix($table);
+				$t_tableName = $table;
+				if (isset($this->_mXoopsModule->modinfo['cube_style']) && $this->_mXoopsModule->modinfo['cube_style'] == true) {
+					$t_tableName = str_replace($t_search, $t_replace, $table);
+				}
+				else {
+					$t_tableName = $db->prefix($table);
+				}
+				
+				$sql = "DROP TABLE " . $t_tableName;
+				
 				if ($db->query($sql)) {
-					$this->mLog->addReport(XCube_Utils::formatMessage(_AD_LEGACY_MESSAGE_DROP_TABLE, $db->prefix($table)));
+					$this->mLog->addReport(XCube_Utils::formatMessage(_AD_LEGACY_MESSAGE_DROP_TABLE, $db->prefix($t_tableName)));
 				}
 				else {
-					$this->mLog->addError(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_DROP_TABLE, $db->prefix($table)));
+					$this->mLog->addError(XCube_Utils::formatMessage(_AD_LEGACY_ERROR_DROP_TABLE, $db->prefix($t_tableName)));
 				}
 			}
 		}


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