]> git.mjollnir.org Git - moodle.git/commitdiff
New field for category themes
authorikawhero <ikawhero>
Wed, 2 May 2007 06:50:28 +0000 (06:50 +0000)
committerikawhero <ikawhero>
Wed, 2 May 2007 06:50:28 +0000 (06:50 +0000)
lib/db/install.xml
lib/db/upgrade.php
version.php

index b11d398b137bbba6e4ffb4e8122c0f00d9d645a7..cce42d062a14e00851752bd2687ced3c209b12d2 100644 (file)
@@ -94,7 +94,8 @@
         <FIELD NAME="visible" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="coursecount" NEXT="timemodified"/>
         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="visible" NEXT="depth"/>
         <FIELD NAME="depth" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="path"/>
-        <FIELD NAME="path" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="depth"/>
+        <FIELD NAME="path" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="depth" NEXT="theme"/>
+        <FIELD NAME="theme" TYPE="char" LENGTH="50" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="Theme for the category" PREVIOUS="path"/>
       </FIELDS>
       <KEYS>
         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for course_categories" NEXT="parent"/>
       </SENTENCES>
     </STATEMENT>
   </STATEMENTS>
-</XMLDB>
\ No newline at end of file
+</XMLDB>
index 712aed56b0e56a730702fe500bd4c2e499d8aab6..6840ef82dd158100a71dcd4c15dc014b02b56872 100644 (file)
@@ -1141,6 +1141,17 @@ function xmldb_main_upgrade($oldversion=0) {
         $result = $result && add_field($table, $field);
     }
 
+    if ($result && $oldversion < 2007050201) {
+
+    /// Define field theme to be added to course_categories
+        $table = new XMLDBTable('course_categories');
+        $field = new XMLDBField('theme');
+        $field->setAttributes(XMLDB_TYPE_CHAR, '50', null, null, null, null, null, null, 'path');
+
+    /// Launch add field theme
+        $result = $result && add_field($table, $field);
+    }
+
     return $result;
 
 }
index c6fe687a31938970362a34214dc09f97d6fa7bac..244b6b97956fbf8464860c0e01fd3cb4bc538e29 100644 (file)
@@ -6,7 +6,7 @@
 // This is compared against the values stored in the database to determine
 // whether upgrades should be performed (see lib/db/*.php)
 
-   $version = 2007050200;  // YYYYMMDD = date
+   $version = 2007050201;  // YYYYMMDD = date
                            //       XY = increments within a single day
 
    $release = '1.9 dev';    // Human-friendly version name