forked from moodle/moodle
-
Notifications
You must be signed in to change notification settings - Fork 1
/
settings.php
81 lines (59 loc) · 3.83 KB
/
settings.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<?php
defined('MOODLE_INTERNAL') || die;
if ($ADMIN->fulltree) {
require_once($CFG->dirroot.'/mod/glossary/lib.php');
$settings->add(new admin_setting_heading('glossary_normal_header', get_string('glossaryleveldefaultsettings', 'glossary'), ''));
$settings->add(new admin_setting_configtext('glossary_entbypage', get_string('entbypage', 'glossary'),
get_string('entbypage', 'glossary'), 10, PARAM_INT));
$settings->add(new admin_setting_configcheckbox('glossary_dupentries', get_string('allowduplicatedentries', 'glossary'),
get_string('cnfallowdupentries', 'glossary'), 0));
$settings->add(new admin_setting_configcheckbox('glossary_allowcomments', get_string('allowcomments', 'glossary'),
get_string('cnfallowcomments', 'glossary'), 0));
$settings->add(new admin_setting_configcheckbox('glossary_linkbydefault', get_string('usedynalink', 'glossary'),
get_string('cnflinkglossaries', 'glossary'), 1));
$settings->add(new admin_setting_configcheckbox('glossary_defaultapproval', get_string('defaultapproval', 'glossary'),
get_string('cnfapprovalstatus', 'glossary'), 1));
if (empty($CFG->enablerssfeeds)) {
$options = array(0 => get_string('rssglobaldisabled', 'admin'));
$str = get_string('configenablerssfeeds', 'glossary').'<br />'.get_string('configenablerssfeedsdisabled2', 'admin');
} else {
$options = array(0=>get_string('no'), 1=>get_string('yes'));
$str = get_string('configenablerssfeeds', 'glossary');
}
$settings->add(new admin_setting_configselect('glossary_enablerssfeeds', get_string('enablerssfeeds', 'admin'),
$str, 0, $options));
$settings->add(new admin_setting_heading('glossary_levdev_header', get_string('entryleveldefaultsettings', 'glossary'), ''));
$settings->add(new admin_setting_configcheckbox('glossary_linkentries', get_string('usedynalink', 'glossary'),
get_string('cnflinkentry', 'glossary'), 0));
$settings->add(new admin_setting_configcheckbox('glossary_casesensitive', get_string('casesensitive', 'glossary'),
get_string('cnfcasesensitive', 'glossary'), 0));
$settings->add(new admin_setting_configcheckbox('glossary_fullmatch', get_string('fullmatch', 'glossary'),
get_string('cnffullmatch', 'glossary'), 0));
//Update and get available formats
$recformats = glossary_get_available_formats();
$formats = array();
//Take names
foreach ($recformats as $format) {
$formats[$format->id] = get_string("displayformat$format->name", "glossary");
}
asort($formats);
$str = '<table>';
foreach ($formats as $formatid=>$formatname) {
$recformat = $DB->get_record('glossary_formats', array('id'=>$formatid));
$str .= '<tr>';
$str .= '<td>' . $formatname . '</td>';
$eicon = "<a title=\"".get_string("edit")."\" href=\"$CFG->wwwroot/mod/glossary/formats.php?id=$formatid&mode=edit\"><img class=\"iconsmall\" src=\"".$OUTPUT->pix_url('t/edit')."\" alt=\"".get_string("edit")."\" /></a>";
if ( $recformat->visible ) {
$vtitle = get_string("hide");
$vicon = "t/hide";
} else {
$vtitle = get_string("show");
$vicon = "t/show";
}
$vicon = "<a title=\"".$vtitle."\" href=\"$CFG->wwwroot/mod/glossary/formats.php?id=$formatid&mode=visible&sesskey=".sesskey()."\"><img class=\"iconsmall\" src=\"".$OUTPUT->pix_url($vicon)."\" alt=\"$vtitle\" /></a>";
$str .= '<td align="center">'.$eicon.' '.$vicon.'</td>';
$str .= '</tr>';
}
$str .= '</table>';
$settings->add(new admin_setting_heading('glossary_formats_header', get_string('displayformatssetup', 'glossary'), $str));
}