[xoops-cvslog 4330] CVS update: xoops2jp/html/modules/base/kernel

Back to archive index

Minahito minah****@users*****
2006年 8月 24日 (木) 18:49:29 JST


Index: xoops2jp/html/modules/base/kernel/Legacy_LanguageManager.class.php
diff -u xoops2jp/html/modules/base/kernel/Legacy_LanguageManager.class.php:1.1.2.7 xoops2jp/html/modules/base/kernel/Legacy_LanguageManager.class.php:1.1.2.8
--- xoops2jp/html/modules/base/kernel/Legacy_LanguageManager.class.php:1.1.2.7	Tue Aug 22 11:30:27 2006
+++ xoops2jp/html/modules/base/kernel/Legacy_LanguageManager.class.php	Thu Aug 24 18:49:29 2006
@@ -1,7 +1,7 @@
 <?php
 /**
  * @package legacy
- * @version $Id: Legacy_LanguageManager.class.php,v 1.1.2.7 2006/08/22 02:30:27 nobunobu Exp $
+ * @version $Id: Legacy_LanguageManager.class.php,v 1.1.2.8 2006/08/24 09:49:29 minahito Exp $
  */
 
 if (!defined('XOOPS_ROOT_PATH')) exit();
@@ -14,14 +14,48 @@
 	{
 		parent::prepare();
 		
-		//
-		// Load the additional file to control DB.
-		//
+		$this->_setupDatabase();
+		$this->loadGlobalMessageCatalog();
+		
+		$this->_setupMbstring();
+	}
+	
+	/**
+	 * Load the additional file to control DB.
+	 */
+	function _setupDatabase()
+	{
 		$filename = XOOPS_MODULE_PATH . '/base/language/' . $this->mLanguageName . '/charset_' . XOOPS_DB_TYPE . '.php';
 		if (file_exists($filename)) {
 			require_once($filename);
 		}
 	}
+	
+	function _setupMbstring()
+	{
+		if (function_exists("mb_language")) {
+			if (@mb_language($this->mLanguageName) != false && @mb_internal_encoding(_CHARSET) != false) {
+				define('MBSTRING', true);
+			}
+			else {
+				mb_language("neutral");
+				mb_internal_encoding("ISO-8859-1");
+				if (!defined('MBSTRING')) {
+					define('MBSTRING', false);
+				}
+			}
+			
+			@mb_internal_encoding(_CHARSET);
+			
+			ini_set( 'mbstring.http_input', 'pass');
+			ini_set( 'mbstring.http_output', 'pass');
+			ini_set( 'mbstring.func_overload', 0);
+			ini_set( 'mbstring.substitute_character', 'none');
+		}
+		if (!defined( "MBSTRING")) {
+			define( "MBSTRING", FALSE);
+		}
+	}
 
 	function loadGlobalMessageCatalog()
 	{


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