From da9c60ecc818f77344fb32ae113a2ecc80b8d113 Mon Sep 17 00:00:00 2001 From: stronk7 Date: Tue, 24 Aug 2004 11:24:27 +0000 Subject: [PATCH] Now some CFG->glossary_XXXX variables are checked in lib.php Bug 1764 (http://moodle.org/bugs/bug.php?op=show&bugid=1764) Merged from MOODLE_14_STABLE --- mod/glossary/lib.php | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php index 0b5b8c5bad..4e5b4286d0 100644 --- a/mod/glossary/lib.php +++ b/mod/glossary/lib.php @@ -18,6 +18,34 @@ define("GLOSSARY_IMPORT_VIEW", 5); define("GLOSSARY_EXPORT_VIEW", 6); define("GLOSSARY_APPROVAL_VIEW", 7); +//Check for global configure default variables + +if (!isset($CFG->glossary_studentspost)) { + set_config("glossary_studentspost", 1); // Students can post entries. +} + +if (!isset($CFG->glossary_dupentries)) { + set_config("glossary_dupentries", 0); // Duplicate entries are not allowed. +} + +if (!isset($CFG->glossary_allowcomments)) { + set_config("glossary_allowcomments", 0); // Comments are not allowed. +} + +if (!isset($CFG->glossary_linkbydefault)) { + set_config("glossary_linkbydefault", 1); // Linking entries is enabled. +} + +if (!isset($CFG->glossary_defaultapproval)) { + set_config("glossary_defaultapproval", 1); // Entries are approved. +} + +if (!isset($CFG->glossary_entbypage)) { + set_config("glossary_entbypage", 10); // 10 entries are showed. +} + +/// STANDARD FUNCTIONS /////////////////////////////////////////////////////////// + function glossary_add_instance($glossary) { /// Given an object containing all the necessary data, /// (defined by the form in mod.html) this function -- 2.39.5