2009-11-01 14:55:15 +00:00
|
|
|
<?php
|
2007-12-19 17:35:20 +00:00
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
defined('MOODLE_INTERNAL') || die;
|
2007-12-19 17:35:20 +00:00
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
if ($ADMIN->fulltree) {
|
|
|
|
require_once($CFG->dirroot.'/mod/glossary/lib.php');
|
2007-12-19 17:35:20 +00:00
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
$settings->add(new admin_setting_heading('glossary_normal_header', get_string('glossaryleveldefaultsettings', 'glossary'), ''));
|
2007-12-19 17:35:20 +00:00
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
$settings->add(new admin_setting_configtext('glossary_entbypage', get_string('entbypage', 'glossary'),
|
|
|
|
get_string('entbypage', 'glossary'), 10, PARAM_INT));
|
2007-12-19 17:35:20 +00:00
|
|
|
|
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
$settings->add(new admin_setting_configcheckbox('glossary_dupentries', get_string('allowduplicatedentries', 'glossary'),
|
|
|
|
get_string('cnfallowdupentries', 'glossary'), 0));
|
2007-12-19 17:35:20 +00:00
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
$settings->add(new admin_setting_configcheckbox('glossary_allowcomments', get_string('allowcomments', 'glossary'),
|
|
|
|
get_string('cnfallowcomments', 'glossary'), 0));
|
2007-12-19 17:35:20 +00:00
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
$settings->add(new admin_setting_configcheckbox('glossary_linkbydefault', get_string('usedynalink', 'glossary'),
|
|
|
|
get_string('cnflinkglossaries', 'glossary'), 1));
|
2007-12-19 17:35:20 +00:00
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
$settings->add(new admin_setting_configcheckbox('glossary_defaultapproval', get_string('defaultapproval', 'glossary'),
|
|
|
|
get_string('cnfapprovalstatus', 'glossary'), 1));
|
2007-12-19 17:35:20 +00:00
|
|
|
|
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
if (empty($CFG->enablerssfeeds)) {
|
|
|
|
$options = array(0 => get_string('rssglobaldisabled', 'admin'));
|
|
|
|
$str = get_string('configenablerssfeeds', 'glossary').'<br />'.get_string('configenablerssfeedsdisabled2', 'admin');
|
2007-12-19 17:35:20 +00:00
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
} 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));
|
2007-12-19 17:35:20 +00:00
|
|
|
|
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
$settings->add(new admin_setting_heading('glossary_levdev_header', get_string('entryleveldefaultsettings', 'glossary'), ''));
|
2007-12-19 17:35:20 +00:00
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
$settings->add(new admin_setting_configcheckbox('glossary_linkentries', get_string('usedynalink', 'glossary'),
|
|
|
|
get_string('cnflinkentry', 'glossary'), 0));
|
2007-12-19 17:35:20 +00:00
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
$settings->add(new admin_setting_configcheckbox('glossary_casesensitive', get_string('casesensitive', 'glossary'),
|
|
|
|
get_string('cnfcasesensitive', 'glossary'), 0));
|
2007-12-19 17:35:20 +00:00
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
$settings->add(new admin_setting_configcheckbox('glossary_fullmatch', get_string('fullmatch', 'glossary'),
|
|
|
|
get_string('cnffullmatch', 'glossary'), 0));
|
2007-12-19 17:35:20 +00:00
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
|
|
|
|
//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>';
|
2012-11-19 13:06:41 +08:00
|
|
|
$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>";
|
2010-07-13 13:56:55 +00:00
|
|
|
if ( $recformat->visible ) {
|
|
|
|
$vtitle = get_string("hide");
|
2012-11-19 13:06:41 +08:00
|
|
|
$vicon = "t/hide";
|
2010-07-13 13:56:55 +00:00
|
|
|
} else {
|
|
|
|
$vtitle = get_string("show");
|
2012-11-19 13:06:41 +08:00
|
|
|
$vicon = "t/show";
|
2010-07-13 13:56:55 +00:00
|
|
|
}
|
2012-11-19 13:06:41 +08:00
|
|
|
$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>";
|
2010-07-13 13:56:55 +00:00
|
|
|
|
|
|
|
$str .= '<td align="center">'.$eicon.' '.$vicon.'</td>';
|
|
|
|
$str .= '</tr>';
|
2007-12-19 17:35:20 +00:00
|
|
|
}
|
2010-07-13 13:56:55 +00:00
|
|
|
$str .= '</table>';
|
2007-12-19 17:35:20 +00:00
|
|
|
|
2010-07-13 13:56:55 +00:00
|
|
|
$settings->add(new admin_setting_heading('glossary_formats_header', get_string('displayformatssetup', 'glossary'), $str));
|
2007-12-19 17:35:20 +00:00
|
|
|
}
|