Browse Source

[svn r21950] add changes in data base for sub-language - (partial FS#4321)

Isaac Flores 15 years ago
parent
commit
a52e828234

+ 2 - 2
main/inc/global.inc.php

@@ -597,7 +597,7 @@ $langpath = api_get_path(SYS_CODE_PATH).'lang/';
 
 if (is_array($language_files)) {
 	if (api_get_setting('allow_use_sub_language')=='true') {
-			foreach($language_files as $index => $language_file) {		
+		foreach ($language_files as $index => $language_file) {		
 			include $langpath.'english/'.$language_file.'.inc.php';
 			$langfile = $langpath.$language_interface.'/'.$language_file.'.inc.php';
 			
@@ -616,7 +616,7 @@ if (is_array($language_files)) {
 			}
 		}	
 	} else {
-		foreach($language_files as $index => $language_file) {		
+		foreach ($language_files as $index => $language_file) {		
 			include $langpath.'english/'.$language_file.'.inc.php';
 			$langfile = $langpath.$language_interface.'/'.$language_file.'.inc.php';
 			if (file_exists($langfile)) {

+ 5 - 0
main/install/dokeos_main.sql

@@ -2130,3 +2130,8 @@ VALUES
 (4,'SocialGoodFriend'),
 (5,'SocialEnemy'),
 (6,'SocialDeleted');
+INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('allow_use_sub_language', NULL, 'radio', 'Platform', 'false', 'AllowUseSubLanguageTitle', 'AllowUseSubLanguageComment', NULL, NULL);
+INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_use_sub_language', 'true', 'Yes');
+INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_use_sub_language', 'false', 'No');
+ALTER TABLE language ADD COLUMN parent_id tinyint unsigned;
+ALTER TABLE language ADD INDEX idx_dokeos_folder(dokeos_folder);

+ 5 - 1
main/install/migrate-db-1.8.6-1.8.6.1-pre.sql

@@ -12,7 +12,11 @@
 --
 -- This first part is for the main database
 -- xxMAINxx
-
+INSERT INTO settings_current (variable, subkey, type, category, selected_value, title, comment, scope, subkeytext) VALUES ('allow_use_sub_language', NULL, 'radio', 'Platform', 'false', 'AllowUseSubLanguageTitle', 'AllowUseSubLanguageComment', NULL, NULL);
+INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_use_sub_language', 'true', 'Yes');
+INSERT INTO settings_options (variable, value, display_text) VALUES ('allow_use_sub_language', 'false', 'No');
+ALTER TABLE language ADD COLUMN parent_id tinyint unsigned;
+ALTER TABLE language ADD INDEX idx_dokeos_folder(dokeos_folder);
 -- xxSTATSxx
 
 -- xxUSERxx