MDL-16221
[moodle-linuxchix.git] / mod / glossary / settings.php
blobac23640c3e6aa20f8720018fbc07a6e6dc40f6df
1 <?php //$Id$
3 require_once($CFG->dirroot.'/mod/glossary/lib.php');
5 $settings->add(new admin_setting_heading('glossary_normal_header', get_string('glossaryleveldefaultsettings', 'glossary'), ''));
7 $settings->add(new admin_setting_configtext('glossary_entbypage', get_string('entbypage', 'glossary'),
8 get_string('entbypage', 'glossary'), 10, PARAM_INT));
11 $settings->add(new admin_setting_configcheckbox('glossary_dupentries', get_string('allowduplicatedentries', 'glossary'),
12 get_string('cnfallowdupentries', 'glossary'), 0));
14 $settings->add(new admin_setting_configcheckbox('glossary_allowcomments', get_string('allowcomments', 'glossary'),
15 get_string('cnfallowcomments', 'glossary'), 0));
17 $settings->add(new admin_setting_configcheckbox('glossary_linkbydefault', get_string('usedynalink', 'glossary'),
18 get_string('cnflinkglossaries', 'glossary'), 1));
20 $settings->add(new admin_setting_configcheckbox('glossary_defaultapproval', get_string('defaultapproval', 'glossary'),
21 get_string('cnfapprovalstatus', 'glossary'), 1));
24 if (empty($CFG->enablerssfeeds)) {
25 $options = array(0 => get_string('rssglobaldisabled', 'admin'));
26 $str = get_string('configenablerssfeeds', 'glossary').'<br />'.get_string('configenablerssfeedsdisabled2', 'admin');
28 } else {
29 $options = array(0=>get_string('no'), 1=>get_string('yes'));
30 $str = get_string('configenablerssfeeds', 'glossary');
32 $settings->add(new admin_setting_configselect('glossary_enablerssfeeds', get_string('enablerssfeeds', 'admin'),
33 $str, 0, $options));
36 $settings->add(new admin_setting_heading('glossary_levdev_header', get_string('entryleveldefaultsettings', 'glossary'), ''));
38 $settings->add(new admin_setting_configcheckbox('glossary_linkentries', get_string('usedynalink', 'glossary'),
39 get_string('cnflinkentry', 'glossary'), 0));
41 $settings->add(new admin_setting_configcheckbox('glossary_casesensitive', get_string('casesensitive', 'glossary'),
42 get_string('cnfcasesensitive', 'glossary'), 0));
44 $settings->add(new admin_setting_configcheckbox('glossary_fullmatch', get_string('fullmatch', 'glossary'),
45 get_string('cnffullmatch', 'glossary'), 0));
48 //Update and get available formats
49 $recformats = glossary_get_available_formats();
50 $formats = array();
51 //Take names
52 foreach ($recformats as $format) {
53 $formats[$format->id] = get_string("displayformat$format->name", "glossary");
55 asort($formats);
57 $str = '<table>';
58 foreach ($formats as $formatid=>$formatname) {
59 $recformat = get_record('glossary_formats','id',$formatid);
60 $str .= '<tr>';
61 $str .= '<td>' . $formatname . '</td>';
62 $eicon = "<a title=\"".get_string("edit")."\" href=\"$CFG->wwwroot/mod/glossary/formats.php?id=$formatid&amp;mode=edit\"><img class=\"iconsmall\" src=\"../pix/t/edit.gif\" alt=\"".get_string("edit")."\" /></a>";
63 if ( $recformat->visible ) {
64 $vtitle = get_string("hide");
65 $vicon = "hide.gif";
66 } else {
67 $vtitle = get_string("show");
68 $vicon = "show.gif";
70 $vicon = "<a title=\"".$vtitle."\" href=\"$CFG->wwwroot/mod/glossary/formats.php?id=$formatid&amp;mode=visible\"><img class=\"iconsmall\" src=\"../pix/t/".$vicon."\" alt=\"$vtitle\" /></a>";
72 $str .= '<td align="center">'.$eicon.'&nbsp;&nbsp;'.$vicon.'</td>';
73 $str .= '</tr>';
75 $str .= '</table>';
77 $settings->add(new admin_setting_heading('glossary_formats_header', get_string('displayformatssetup', 'glossary'), $str));