From: skodak Date: Mon, 20 Apr 2009 18:39:24 +0000 (+0000) Subject: MDL-18910 normalised module intro and introformat X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=65e7c870c16f077e21eab2523aa1bba5d8e4e10a;p=moodle.git MDL-18910 normalised module intro and introformat --- diff --git a/mod/chat/db/install.xml b/mod/chat/db/install.xml index 021dd1c3f0..a8fcc5e985 100644 --- a/mod/chat/db/install.xml +++ b/mod/chat/db/install.xml @@ -1,5 +1,5 @@ - @@ -9,15 +9,16 @@ - - + + + - + @@ -89,4 +90,4 @@ - + \ No newline at end of file diff --git a/mod/chat/db/upgrade.php b/mod/chat/db/upgrade.php index 875e6cfd00..b779a61bf6 100644 --- a/mod/chat/db/upgrade.php +++ b/mod/chat/db/upgrade.php @@ -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; } diff --git a/mod/chat/version.php b/mod/chat/version.php index f9dc159af1..9cbda2e14c 100644 --- a/mod/chat/version.php +++ b/mod/chat/version.php @@ -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)? ?> diff --git a/mod/chat/view.php b/mod/chat/view.php index 793492625a..d1f1447456 100644 --- a/mod/chat/view.php +++ b/mod/chat/view.php @@ -173,7 +173,8 @@ } 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();