]> git.mjollnir.org Git - moodle.git/commitdiff
adding 2 new fields 1) field for alt tag for user image, 2) field for a flag to tell...
authortoyomoyo <toyomoyo>
Wed, 22 Nov 2006 06:50:27 +0000 (06:50 +0000)
committertoyomoyo <toyomoyo>
Wed, 22 Nov 2006 06:50:27 +0000 (06:50 +0000)
lib/db/install.xml
lib/db/upgrade.php
version.php

index 0ba18ccce36d7795f7333ecfe52d5427663aa4d8..d49122367bd448fec2824502d008e3e0247640ea 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="lib/db" VERSION="20061120" COMMENT="XMLDB file for core Moodle tables"
+<XMLDB PATH="lib/db" VERSION="20061122" COMMENT="XMLDB file for core Moodle tables"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="../../lib/xmldb/xmldb.xsd"
 >
         <FIELD NAME="autosubscribe" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="ajax" NEXT="trackforums"/>
         <FIELD NAME="trackforums" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="autosubscribe" NEXT="timemodified"/>
         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="trackforums" NEXT="trustbitmask"/>
-        <FIELD NAME="trustbitmask" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified"/>
+        <FIELD NAME="trustbitmask" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="timemodified" NEXT="imagealt"/>
+        <FIELD NAME="imagealt" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" ENUM="false" COMMENT="alt tag for user uploaded image" PREVIOUS="trustbitmask" NEXT="screenreader"/>
+        <FIELD NAME="screenreader" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="flag for determining whehter the user uses a screenreader." PREVIOUS="imagealt"/>
       </FIELDS>
       <KEYS>
         <KEY NAME="primary" TYPE="primary" FIELDS="id" COMMENT="Primary key for user"/>
index a4823f05c7858a213584fb78d68ed3589a0b8638..c0e34de977588eafa9c0915998ca06e993ddb43e 100644 (file)
@@ -92,6 +92,24 @@ function xmldb_main_upgrade($oldversion=0) {
     /// Launch add field attachment
         $result = $result && add_field($table, $field);
     }
+    
+    if ($result && $oldversion < 2006112200) {
+
+    /// Define field imagealt to be added to user
+        $table = new XMLDBTable('user');
+        $field = new XMLDBField('imagealt');
+        $field->setAttributes(XMLDB_TYPE_CHAR, '255', null, null, null, null, null, null, 'trustbitmask');
+
+    /// Launch add field imagealt
+        $result = $result && add_field($table, $field);
+        
+        $table = new XMLDBTable('user');
+        $field = new XMLDBField('screenreader');
+        $field->setAttributes(XMLDB_TYPE_INTEGER, '1', null, XMLDB_NOTNULL, null, null, null, '0', 'imagealt');
+
+    /// Launch add field screenreader
+        $result = $result && add_field($table, $field);
+    }
 
     return $result;
 
index 5bc6592021d8f79640a66e123a4df2ea5751ae8f..5e6e0c2ee83d2c472e057eae71b352955d70ca73 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 = 2006112000;  // YYYYMMDD = date
+   $version = 2006112200;  // YYYYMMDD = date
                            //       XY = increments within a single day
 
    $release = '1.8 dev';    // Human-friendly version name