Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

New field for category themes

  • Loading branch information...
commit ec75a182db02fbdf391c58ce67491f140b13c4ae 1 parent ca9ffa1
ikawhero authored
Showing with 15 additions and 3 deletions.
  1. +3 −2 lib/db/install.xml
  2. +11 −0 lib/db/upgrade.php
  3. +1 −1  version.php
View
5 lib/db/install.xml
@@ -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"/>
@@ -1423,4 +1424,4 @@
</SENTENCES>
</STATEMENT>
</STATEMENTS>
-</XMLDB>
+</XMLDB>
View
11 lib/db/upgrade.php
@@ -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;
}
View
2  version.php
@@ -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
Please sign in to comment.
Something went wrong with that request. Please try again.