Merge branch 'MDL-31014-master-3' of git://git.luns.net.uk/moodle
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
<?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"
|
||||
>
|
||||
@@ -20,8 +20,9 @@
|
||||
<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"/>
|
||||
@@ -121,4 +122,4 @@
|
||||
</KEYS>
|
||||
</TABLE>
|
||||
</TABLES>
|
||||
</XMLDB>
|
||||
</XMLDB>
|
||||
|
||||
@@ -29,6 +29,28 @@ function xmldb_glossary_upgrade($oldversion) {
|
||||
// Moodle v2.2.0 release upgrade line
|
||||
// Put any upgrade step following this
|
||||
|
||||
if ($oldversion < 2012010400) {
|
||||
|
||||
// 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);
|
||||
}
|
||||
|
||||
// Set the default approvaldisplayformat for existing entries to be
|
||||
// the existing displayformat so as not to change existing
|
||||
// functionality
|
||||
$sql = "UPDATE {glossary}
|
||||
SET approvaldisplayformat = 'default'";
|
||||
$DB->execute($sql);
|
||||
|
||||
// glossary savepoint reached
|
||||
upgrade_mod_savepoint(true, 2012010400, 'glossary');
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -42,6 +42,8 @@ $string['allowprintview_help'] = 'If enabled, students are provided with a link
|
||||
$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';
|
||||
@@ -115,6 +117,7 @@ $string['displayformat_help'] = 'There are 7 display formats:
|
||||
* 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';
|
||||
|
||||
@@ -79,6 +79,12 @@ class mod_glossary_mod_form extends moodleform_mod {
|
||||
$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');
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
|
||||
defined('MOODLE_INTERNAL') || die();
|
||||
|
||||
$module->version = 2011112900; // The current module version (Date: YYYYMMDDXX)
|
||||
$module->version = 2012010400; // 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;
|
||||
|
||||
@@ -173,6 +173,11 @@ break;
|
||||
|
||||
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';
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user