Merge branch 'MDL-81073' of https://github.com/paulholden/moodle
[moodle.git] / mod / glossary / settings.php
blobcdc84c813b3173063ee9fa2c715c1253c4e1ca5b
1 <?php
3 defined('MOODLE_INTERNAL') || die;
5 if ($ADMIN->fulltree) {
6 require_once($CFG->dirroot.'/mod/glossary/lib.php');
8 $settings->add(new admin_setting_heading('glossary_normal_header', get_string('glossaryleveldefaultsettings', 'glossary'), ''));
10 $settings->add(new admin_setting_configtext('glossary_entbypage', get_string('entbypage', 'glossary'),
11 get_string('entbypage', 'glossary'), 10, PARAM_INT));
14 $settings->add(new admin_setting_configcheckbox('glossary_dupentries', get_string('allowduplicatedentries', 'glossary'),
15 get_string('cnfallowdupentries', 'glossary'), 0));
17 $settings->add(new admin_setting_configcheckbox('glossary_allowcomments', get_string('allowcomments', 'glossary'),
18 get_string('cnfallowcomments', 'glossary'), 0));
20 $settings->add(new admin_setting_configcheckbox('glossary_linkbydefault', get_string('usedynalink', 'glossary'),
21 get_string('cnflinkglossaries', 'glossary'), 1));
23 $settings->add(new admin_setting_configcheckbox('glossary_defaultapproval', get_string('defaultapproval', 'glossary'),
24 get_string('cnfapprovalstatus', 'glossary'), 1));
27 if (empty($CFG->enablerssfeeds)) {
28 $options = array(0 => get_string('rssglobaldisabled', 'admin'));
29 $str = get_string('configenablerssfeeds', 'glossary').'<br />'.get_string('configenablerssfeedsdisabled2', 'admin');
31 } else {
32 $options = array(0=>get_string('no'), 1=>get_string('yes'));
33 $str = get_string('configenablerssfeeds', 'glossary');
35 $settings->add(new admin_setting_configselect('glossary_enablerssfeeds', get_string('enablerssfeeds', 'admin'),
36 $str, 0, $options));
39 $settings->add(new admin_setting_heading('glossary_levdev_header', get_string('entryleveldefaultsettings', 'glossary'), ''));
41 $settings->add(new admin_setting_configcheckbox('glossary_linkentries', get_string('usedynalink', 'glossary'),
42 get_string('cnflinkentry', 'glossary'), 0));
44 $settings->add(new admin_setting_configcheckbox('glossary_casesensitive', get_string('casesensitive', 'glossary'),
45 get_string('cnfcasesensitive', 'glossary'), 0));
47 $settings->add(new admin_setting_configcheckbox('glossary_fullmatch', get_string('fullmatch', 'glossary'),
48 get_string('cnffullmatch', 'glossary'), 0));
50 // This is unfortunately necessary to ensure that the glossary_formats table is populated and up to date.
51 // Ensure the table is in sync with what display formats are available in code.
52 glossary_get_available_formats();
54 $settings->add(new mod_glossary_admin_setting_display_formats());