From 428dcc01350673171c4700c83d90bf6fd73adc1e Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Mon, 18 Aug 2014 19:26:33 +0200 Subject: [i18n] Moved all texts from cat_setting and setting to json files --- apis/update.inc.php | 49 ++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 42 insertions(+), 7 deletions(-) (limited to 'apis/update.inc.php') diff --git a/apis/update.inc.php b/apis/update.inc.php index bab6bcea..3c4acfb2 100644 --- a/apis/update.inc.php +++ b/apis/update.inc.php @@ -1,6 +1,6 @@ fetch(PDO::FETCH_ASSOC)) { - if ($row['Field'] !== 'dateline') continue; + if ($row['Field'] !== 'dateline') + continue; $type = $row['Type']; break; } @@ -56,7 +57,6 @@ function update_1() } // ####################### - // ##### 2014-06-05 // Add 'news' table to database schema function update_2() @@ -64,7 +64,8 @@ function update_2() $res = Database::simpleQuery("show tables", array(), false); $found = false; while ($row = $res->fetch(PDO::FETCH_ASSOC)) { - if ($row['Tables_in_openslx'] !== 'news') continue; + if ($row['Tables_in_openslx'] !== 'news') + continue; $found = true; break; } @@ -81,4 +82,38 @@ function update_2() "); } return true; -} \ No newline at end of file +} + +// ####################### +// ##### 2014-08-18 +// Remove setting descriptions from DB, put into json files now +function update_3() +{ + $res = Database::simpleQuery("DESCRIBE setting", array(), false); + if ($res !== false) { + while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + switch ($row['Field']) { + case 'de': + case 'en': + case 'pt': + case 'description': + Database::exec("ALTER TABLE setting DROP {$row['Field']}"); + break; + } + } + } + $res = Database::simpleQuery("DESCRIBE cat_setting", array(), false); + if ($res !== false) { + while ($row = $res->fetch(PDO::FETCH_ASSOC)) { + switch ($row['Field']) { + case 'de': + case 'en': + case 'pt': + case 'name': + Database::exec("ALTER TABLE cat_setting DROP {$row['Field']}"); + break; + } + } + } + return true; +} -- cgit v1.2.3-55-g7522