From a52e828234efe5dc8b940f332168980c2190737a Mon Sep 17 00:00:00 2001 From: Isaac Flores Date: Thu, 9 Jul 2009 17:38:20 +0200 Subject: [PATCH] [svn r21950] add changes in data base for sub-language - (partial FS#4321) --- main/inc/global.inc.php | 4 ++-- main/install/dokeos_main.sql | 5 +++++ main/install/migrate-db-1.8.6-1.8.6.1-pre.sql | 6 +++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/main/inc/global.inc.php b/main/inc/global.inc.php index 64525ab121..a30c996134 100644 --- a/main/inc/global.inc.php +++ b/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)) { diff --git a/main/install/dokeos_main.sql b/main/install/dokeos_main.sql index 42ca4d473c..ef77c07472 100644 --- a/main/install/dokeos_main.sql +++ b/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); \ No newline at end of file diff --git a/main/install/migrate-db-1.8.6-1.8.6.1-pre.sql b/main/install/migrate-db-1.8.6-1.8.6.1-pre.sql index f93e71bdbe..7e832b23fd 100755 --- a/main/install/migrate-db-1.8.6-1.8.6.1-pre.sql +++ b/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