From 009cc72698f9d6874b9ebde7cac66dc40e39381d Mon Sep 17 00:00:00 2001 From: stronk7 Date: Tue, 27 Apr 2004 16:27:11 +0000 Subject: [PATCH] Now, in topics format, every course can decide about how to display hidden topics (collapsed or invisible) --- lib/db/mysql.php | 4 ++++ lib/db/mysql.sql | 3 ++- lib/db/postgres7.php | 4 ++++ lib/db/postgres7.sql | 1 + 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/db/mysql.php b/lib/db/mysql.php index 1d889a473d..c6244b4bc4 100644 --- a/lib/db/mysql.php +++ b/lib/db/mysql.php @@ -736,6 +736,10 @@ function main_upgrade($oldversion=0) { table_column("course", "lang", "lang", "varchar", "10", "", ""); } + if ($oldversion < 2004042701) { /// Add hiddentopics field to control hidden topics behaviour + table_column("course", "", "hiddentopics", "integer", "1", "unsigned", "0", "not null", "visible"); + } + return $result; } diff --git a/lib/db/mysql.sql b/lib/db/mysql.sql index 033d129e85..e0f3514953 100644 --- a/lib/db/mysql.sql +++ b/lib/db/mysql.sql @@ -51,7 +51,8 @@ CREATE TABLE `prefix_course` ( `marker` int(10) unsigned NOT NULL default '0', `maxbytes` int(10) unsigned NOT NULL default '0', `showreports` int(4) unsigned NOT NULL default '0', - `visible` int(10) unsigned NOT NULL default '1', + `visible` int(1) unsigned NOT NULL default '1', + `hiddentopics` int(1) unsigned NOT NULL default '0', `groupmode` int(4) unsigned NOT NULL default '0', `groupmodeforce` int(4) unsigned NOT NULL default '0', `lang` varchar(10) NOT NULL default '', diff --git a/lib/db/postgres7.php b/lib/db/postgres7.php index 592ae8ee66..b1b963fb9b 100644 --- a/lib/db/postgres7.php +++ b/lib/db/postgres7.php @@ -481,6 +481,10 @@ function main_upgrade($oldversion=0) { table_column("course", "lang", "lang", "varchar", "10", "", ""); } + if ($oldversion < 2004042701) { /// Add hiddentopics field to control hidden topics behaviour + table_column("course", "", "hiddentopics", "integer", "1", "unsigned", "0", "not null", "visible"); + } + return $result; } diff --git a/lib/db/postgres7.sql b/lib/db/postgres7.sql index 95b544e0bf..c5a2bea968 100644 --- a/lib/db/postgres7.sql +++ b/lib/db/postgres7.sql @@ -30,6 +30,7 @@ CREATE TABLE prefix_course ( maxbytes integer NOT NULL default '0', showreports integer NOT NULL default '0', visible integer NOT NULL default '1', + hiddentopics integer NOT NULL default '0', groupmode integer NOT NULL default '0', groupmodeforce integer NOT NULL default '0', lang varchar(10) NOT NULL default '', -- 2.39.5