<?xml version="1.0" encoding="UTF-8" ?>
-<XMLDB PATH="mod/glossary/db" VERSION="20101115" COMMENT="XMLDB file for Moodle mod/glossary"
+<XMLDB PATH="mod/glossary/db" VERSION="20120104" COMMENT="XMLDB file for Moodle mod/glossary"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
<FIELD NAME="allowcomments" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="showall" NEXT="allowprintview"/>
<FIELD NAME="allowprintview" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="allowcomments" NEXT="usedynalink"/>
<FIELD NAME="usedynalink" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="allowprintview" NEXT="defaultapproval"/>
- <FIELD NAME="defaultapproval" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="usedynalink" NEXT="globalglossary"/>
- <FIELD NAME="globalglossary" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="defaultapproval" NEXT="entbypage"/>
+ <FIELD NAME="defaultapproval" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="1" SEQUENCE="false" PREVIOUS="usedynalink" NEXT="approvaldisplayformat"/>
+ <FIELD NAME="approvaldisplayformat" TYPE="char" LENGTH="50" NOTNULL="true" DEFAULT="default" SEQUENCE="false" COMMENT="Display Format when approving entries" PREVIOUS="defaultapproval" NEXT="globalglossary"/>
+ <FIELD NAME="globalglossary" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="approvaldisplayformat" NEXT="entbypage"/>
<FIELD NAME="entbypage" TYPE="int" LENGTH="3" NOTNULL="true" UNSIGNED="true" DEFAULT="10" SEQUENCE="false" PREVIOUS="globalglossary" NEXT="editalways"/>
<FIELD NAME="editalways" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="entbypage" NEXT="rsstype"/>
<FIELD NAME="rsstype" TYPE="int" LENGTH="2" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="editalways" NEXT="rssarticles"/>
</KEYS>
</TABLE>
</TABLES>
-</XMLDB>
\ No newline at end of file
+</XMLDB>
// Moodle v2.2.0 release upgrade line
// Put any upgrade step following this
+ if ($oldversion < 2012022000) {
+
+ // Define field approvaldisplayformat to be added to glossary
+ $table = new xmldb_table('glossary');
+ $field = new xmldb_field('approvaldisplayformat', XMLDB_TYPE_CHAR, '50', null, XMLDB_NOTNULL, null, 'default', 'defaultapproval');
+
+ // Conditionally launch add field approvaldisplayformat
+ if (!$dbman->field_exists($table, $field)) {
+ $dbman->add_field($table, $field);
+ }
+
+ // glossary savepoint reached
+ upgrade_mod_savepoint(true, 2012022000, 'glossary');
+ }
+
return true;
}
$string['andmorenewentries'] = 'and {$a} more new entries.';
$string['answer'] = 'Answer';
$string['approve'] = 'Approve';
+$string['approvaldisplayformat'] = 'Approval Display format';
+$string['approvaldisplayformat_help'] = 'When approving glossary items you may wish to use a different display format';
$string['areyousuredelete'] = 'Are you sure you want to delete this entry?';
$string['areyousuredeletecomment'] = 'Are you sure you want to delete this comment?';
$string['areyousureexport'] = 'Are you sure you want to export this entry to';
* Entry list - Concepts are listed as links
* FAQ - The words QUESTION and ANSWER are appended to the concept and definition respectively';
$string['displayformatcontinuous'] = 'Continuous without author';
+$string['displayformatdefault'] = 'Default to same as Display Format';
$string['displayformatdictionary'] = 'Simple, dictionary style';
$string['displayformatencyclopedia'] = 'Encyclopedia';
$string['displayformatentrylist'] = 'Entry list';
$mform->setDefault('displayformat', 'dictionary');
$mform->addHelpButton('displayformat', 'displayformat', 'glossary');
+ $displayformats['default'] = get_string('displayformatdefault', 'glossary');
+ $displayformats = array_merge($displayformats, $formats);
+ $mform->addElement('select', 'approvaldisplayformat', get_string('approvaldisplayformat', 'glossary'), $displayformats);
+ $mform->setDefault('approvaldisplayformat', 'default');
+ $mform->addHelpButton('approvaldisplayformat', 'approvaldisplayformat', 'glossary');
+
$mform->addElement('selectyesno', 'showspecial', get_string('showspecial', 'glossary'));
$mform->setDefault('showspecial', 1);
$mform->addHelpButton('showspecial', 'showspecial', 'glossary');
defined('MOODLE_INTERNAL') || die();
-$module->version = 2011112900; // The current module version (Date: YYYYMMDDXX)
+$module->version = 2012022000; // The current module version (Date: YYYYMMDDXX)
$module->requires = 2011112900; // Requires this Moodle version
$module->component = 'mod_glossary'; // Full name of the plugin (used for diagnostics)
$module->cron = 0;
case 'approval': /// Looking for entries waiting for approval
$tab = GLOSSARY_APPROVAL_VIEW;
+ // Override the display format with the approvaldisplayformat
+ if ($glossary->approvaldisplayformat !== 'default' && ($df = $DB->get_record("glossary_formats",
+ array("name" => $glossary->approvaldisplayformat)))) {
+ $displayformat = $df->popupformatname;
+ }
if ( !$hook and !$sortkey and !$sortorder) {
$hook = 'ALL';
}