fwrite ($bf,full_tag("MODTYPE",4,false,"glossary"));
fwrite ($bf,full_tag("NAME",4,false,$glossary->name));
fwrite ($bf,full_tag("INTRO",4,false,$glossary->intro));
- fwrite ($bf,full_tag("STUDENTCANPOST",4,false,$glossary->studentcanpost));
fwrite ($bf,full_tag("ALLOWDUPLICATEDENTRIES",4,false,$glossary->allowduplicatedentries));
fwrite ($bf,full_tag("DISPLAYFORMAT",4,false,$glossary->displayformat));
fwrite ($bf,full_tag("MAINGLOSSARY",4,false,$glossary->mainglossary));
<?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="mod/glossary/db" VERSION="20060811" COMMENT="XMLDB file for Moodle mod/glossary">
+<XMLDB PATH="mod/glossary/db" VERSION="20061114" COMMENT="XMLDB file for Moodle mod/glossary"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
+>
<TABLES>
<TABLE NAME="glossary" COMMENT="all glossaries" NEXT="glossary_entries">
<FIELDS>
<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="studentcanpost"/>
- <FIELD NAME="studentcanpost" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="allowduplicatedentries"/>
- <FIELD NAME="allowduplicatedentries" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="studentcanpost" NEXT="displayformat"/>
+ <FIELD NAME="intro" TYPE="text" LENGTH="small" NOTNULL="true" SEQUENCE="false" ENUM="false" PREVIOUS="name" NEXT="allowduplicatedentries"/>
+ <FIELD NAME="allowduplicatedentries" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="intro" NEXT="displayformat"/>
<FIELD NAME="displayformat" TYPE="char" LENGTH="50" NOTNULL="true" DEFAULT="dictionary" SEQUENCE="false" ENUM="false" PREVIOUS="allowduplicatedentries" NEXT="mainglossary"/>
<FIELD NAME="mainglossary" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" ENUM="false" PREVIOUS="displayformat" NEXT="showspecial"/>
<FIELD NAME="showspecial" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" ENUM="false" PREVIOUS="mainglossary" NEXT="showalphabet"/>
</SENTENCES>
</STATEMENT>
</STATEMENTS>
-</XMLDB>
+</XMLDB>
\ No newline at end of file
/// if ($result && $oldversion < YYYYMMDD00) { //New version in version.php
/// $result = result of "/lib/ddllib.php" function calls
/// }
+
+ if ($result && $oldversion < 2006111400) {
+ /// Define field studentcanpost to be dropped from glossary
+ $table = new XMLDBTable('glossary');
+ $field = new XMLDBField('studentcanpost');
+
+ /// Launch drop field studentcanpost
+ $result = $result && drop_field($table, $field);
+ }
+
return $result;
}
error("You can't delete other people's entries!");
}
$ineditperiod = ((time() - $entry->timecreated < $CFG->maxeditingtime) || $glossary->editalways);
- if ((!$ineditperiod or !$glossary->studentcanpost) and !$manageentries) {
+ if (!$ineditperiod and !$manageentries) {
error("You can't delete this. Time expired!");
}
$glossary->timemodified = time();
// Setting the default values if no values were passed
- if ( isset($xmlglossary['STUDENTCANPOST'][0]['#']) ) {
- $glossary->studentcanpost = addslashes($xmlglossary['STUDENTCANPOST'][0]['#']);
- } else {
- $glossary->studentcanpost = $CFG->glossary_studentspost;
- }
if ( isset($xmlglossary['ENTBYPAGE'][0]['#']) ) {
$glossary->entbypage = addslashes($xmlglossary['ENTBYPAGE'][0]['#']);
} else {
$co .= glossary_start_tag("INFO",1,true);
$co .= glossary_full_tag("NAME",2,false,$glossary->name);
$co .= glossary_full_tag("INTRO",2,false,$glossary->intro);
- $co .= glossary_full_tag("STUDENTCANPOST",2,false,$glossary->studentcanpost);
$co .= glossary_full_tag("ALLOWDUPLICATEDENTRIES",2,false,$glossary->allowduplicatedentries);
$co .= glossary_full_tag("DISPLAYFORMAT",2,false,$glossary->displayformat);
$co .= glossary_full_tag("SHOWSPECIAL",2,false,$glossary->showspecial);
$glossary->course = $restore->course_id;
$glossary->name = backup_todb($info['MOD']['#']['NAME']['0']['#']);
$glossary->intro = backup_todb($info['MOD']['#']['INTRO']['0']['#']);
- $glossary->studentcanpost = backup_todb($info['MOD']['#']['STUDENTCANPOST']['0']['#']);
$glossary->allowduplicatedentries = backup_todb($info['MOD']['#']['ALLOWDUPLICATEDENTRIES']['0']['#']);
$glossary->displayformat = backup_todb($info['MOD']['#']['DISPLAYFORMAT']['0']['#']);
$glossary->mainglossary = backup_todb($info['MOD']['#']['MAINGLOSSARY']['0']['#']);
/// This fragment is called by moodle_needs_upgrading() and /admin/index.php
/////////////////////////////////////////////////////////////////////////////////
-$module->version = 2006091801;
+$module->version = 2006111400;
$module->requires = 2006082600; // Requires this Moodle version
$module->cron = 0; // Period for cron to check this module (secs)