芝麻web文件管理V1.00
编辑当前文件:/home2/sdektunc/public_html/cepali/mod/glossary/formats.php
libdir.'/adminlib.php'); require_once("lib.php"); $id = required_param('id', PARAM_INT); $mode = optional_param('mode', '', PARAM_ALPHANUMEXT); $url = new moodle_url('/mod/glossary/formats.php', array('id'=>$id)); if ($mode !== '') { $url->param('mode', $mode); } $PAGE->set_url($url); admin_externalpage_setup('managemodules'); // this is hacky, tehre should be a special hidden page for it if ( !$displayformat = $DB->get_record("glossary_formats", array("id"=>$id))) { print_error('invalidglossaryformat', 'glossary'); } $form = data_submitted(); if ( $mode == 'visible' and confirm_sesskey()) { if ( $displayformat ) { if ( $displayformat->visible ) { $displayformat->visible = 0; } else { $displayformat->visible = 1; } $DB->update_record("glossary_formats",$displayformat); } redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=modsettingglossary#glossary_formats_header"); die; } elseif ( $mode == 'edit' and $form and confirm_sesskey()) { $displayformat->popupformatname = $form->popupformatname; $displayformat->showgroup = $form->showgroup; $displayformat->defaultmode = $form->defaultmode; $displayformat->defaulthook = $form->defaulthook; $displayformat->sortkey = $form->sortkey; $displayformat->sortorder = $form->sortorder; // Extract visible tabs from array into comma separated list. $visibletabs = implode(',', $form->visibletabs); // Include 'standard' tab by default along with other tabs. // This way we don't run into the risk of users not selecting any tab for displayformat. $displayformat->showtabs = GLOSSARY_STANDARD.','.$visibletabs; $DB->update_record("glossary_formats",$displayformat); redirect("$CFG->wwwroot/$CFG->admin/settings.php?section=modsettingglossary#glossary_formats_header"); die; } $strmodulename = get_string("modulename", "glossary"); $strdisplayformats = get_string("displayformats","glossary"); echo $OUTPUT->header(); echo $OUTPUT->heading($strmodulename . ': ' . get_string("displayformats","glossary")); echo $OUTPUT->box(get_string("configwarning", 'admin'), "generalbox boxaligncenter boxwidthnormal"); echo "
"; $yes = get_string("yes"); $no = get_string("no"); echo '
'; echo '
'; ?>
name,'glossary'); ?>
name] = get_string("displayformat$format->name", "glossary"); } //Sort it asort($formats); echo html_writer::select($formats, 'popupformatname', $displayformat->popupformatname, false); ?>
defaultmode) ) { case 'letter': $sletter = ' selected="selected" '; break; case 'cat': $scat = ' selected="selected" '; break; case 'date': $sdate = ' selected="selected" '; break; case 'author': $sauthor = ' selected="selected" '; break; } ?>
>
>
>
>
defaulthook) ) { case 'all': $sall = ' selected="selected" '; break; case 'special': $sspecial = ' selected="selected" '; break; case '0': $sallcategories = ' selected="selected" '; break; case '-1': $snocategorised = ' selected="selected" '; break; } ?>
>
>
>
>
sortkey) ) { case 'firstname': $sfname = ' selected="selected" '; break; case 'lastname': $slname = ' selected="selected" '; break; case 'creation': $screation = ' selected="selected" '; break; case 'update': $supdate = ' selected="selected" '; break; } ?>
>
>
>
>
sortorder) ) { case 'asc': $sasc = ' selected="selected" '; break; case 'desc': $sdesc = ' selected="selected" '; break; } ?>
>
>
:
showgroup) { $yselected = " selected=\"selected\" "; } else { $nselected = " selected=\"selected\" "; } ?>
>
>
$tabvalue) { if (in_array($tabkey, $visibletabs)) { ?>
" />
'; echo $OUTPUT->footer(); ?>