]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-18910 normalised module intro and introformat
authorskodak <skodak>
Mon, 20 Apr 2009 18:39:24 +0000 (18:39 +0000)
committerskodak <skodak>
Mon, 20 Apr 2009 18:39:24 +0000 (18:39 +0000)
mod/chat/db/install.xml
mod/chat/db/upgrade.php
mod/chat/version.php
mod/chat/view.php

index 021dd1c3f0c4a58560d51f888b0813bee8e63e7e..a8fcc5e98575a9b414da3e1bc8c5dacf1f57eb77 100644 (file)
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="mod/chat/db" VERSION="20070122" COMMENT="XMLDB file for Moodle mod/chat"
+<XMLDB PATH="mod/chat/db" VERSION="20090420" COMMENT="XMLDB file for Moodle mod/chat"
     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
 >
@@ -9,15 +9,16 @@
         <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" ENUM="false" NEXT="course"/>
         <FIELD NAME="course" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="id" NEXT="name"/>
         <FIELD NAME="name" TYPE="char" LENGTH="255" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="course" NEXT="intro"/>
-        <FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="keepdays"/>
-        <FIELD NAME="keepdays" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="studentlogs"/>
+        <FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="introformat"/>
+        <FIELD NAME="introformat" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" COMMENT="text format of intro field" PREVIOUS="intro" NEXT="keepdays"/>
+        <FIELD NAME="keepdays" TYPE="int" LENGTH="11" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="introformat" NEXT="studentlogs"/>
         <FIELD NAME="studentlogs" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="keepdays" NEXT="chattime"/>
         <FIELD NAME="chattime" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="studentlogs" NEXT="schedule"/>
         <FIELD NAME="schedule" TYPE="int" LENGTH="4" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="chattime" NEXT="timemodified"/>
         <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="schedule"/>
       </FIELDS>
       <KEYS>
-        <KEY NAME="primary" TYPE="primary" FIELDS="id" />
+        <KEY NAME="primary" TYPE="primary" FIELDS="id"/>
       </KEYS>
       <INDEXES>
         <INDEX NAME="course" UNIQUE="false" FIELDS="course"/>
@@ -89,4 +90,4 @@
       </INDEXES>
     </TABLE>
   </TABLES>
-</XMLDB>
+</XMLDB>
\ No newline at end of file
index 875e6cfd008461a2e2ba2efd1c1ed941e07e6dec..b779a61bf67e876360fcb0d2fc6cb35c50e8dd6d 100644 (file)
@@ -71,6 +71,19 @@ function xmldb_chat_upgrade($oldversion) {
         upgrade_mod_savepoint($result, 2009010600, 'chat');
     }
 
+    if ($result && $oldversion < 2009042000) {
+
+    /// Define field introformat to be added to chat
+        $table = new xmldb_table('chat');
+        $field = new xmldb_field('introformat', XMLDB_TYPE_INTEGER, '4', XMLDB_UNSIGNED, XMLDB_NOTNULL, null, null, null, '0', 'intro');
+
+    /// Launch add field introformat
+        $dbman->add_field($table, $field);
+
+    /// chat savepoint reached
+        upgrade_mod_savepoint($result, 2009042000, 'chat');
+    }
+    
     return $result;
 }
 
index f9dc159af11291a7d64009074b1b6ae3732f0a33..9cbda2e14cd59f6c770a9563f4ecb5492afe6867 100644 (file)
@@ -5,8 +5,8 @@
 ///  This fragment is called by moodle_needs_upgrading() and /admin/index.php
 /////////////////////////////////////////////////////////////////////////////////
 
-$module->version  = 2009031100;   // The (date) version of this module
-$module->requires = 2007101509;  // Requires this Moodle version
+$module->version  = 2009042000;   // The (date) version of this module
+$module->requires = 2009041700;  // Requires this Moodle version
 $module->cron     = 300;          // How often should cron check this module (seconds)?
 
 ?>
index 793492625aaf41e2b2a08557e54a422394667d8a..d1f14474564d0d6dbaaa09292f4c9e625ef4b6e1 100644 (file)
                 }
 
                 if ($chat->intro) {
-                    print_box(format_text($chat->intro), 'generalbox', 'intro');
+                    $options = (object)array('noclean'=>true);
+                    print_box(format_text($chat->intro, $chat->introformat, $options), 'generalbox', 'intro');
                 }
 
                 chat_delete_old_users();