mirror of
https://github.com/moodle/moodle.git
synced 2025-04-20 07:56:06 +02:00
MDL-18910 normalised module intro and introformat
This commit is contained in:
parent
c119057ae0
commit
65e7c870c1
@ -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>
|
@ -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;
|
||||
}
|
||||
|
||||
|
@ -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)?
|
||||
|
||||
?>
|
||||
|
@ -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();
|
||||
|
Loading…
x
Reference in New Issue
Block a user