mirror of
https://github.com/moodle/moodle.git
synced 2025-08-09 19:06:41 +02:00
mod-glossary MDL-19809 Added set_url calls, replaced deprecated functions
This commit is contained in:
parent
cd4e6b1769
commit
5fa0208ec3
16 changed files with 1954 additions and 1791 deletions
|
@ -1,51 +1,63 @@
|
|||
<?php // $Id$
|
||||
<?php
|
||||
|
||||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
require_once("../../config.php");
|
||||
require_once("lib.php");
|
||||
|
||||
$id = required_param('id', PARAM_INT); // Course Module ID
|
||||
$id = required_param('id', PARAM_INT); // Course Module ID
|
||||
|
||||
$mode= optional_param('mode', '', PARAM_ALPHA); // term entry cat date letter search author approval
|
||||
$hook= optional_param('hook', '', PARAM_CLEAN); // the term, entry, cat, etc... to look for based on mode
|
||||
$cat = optional_param('cat',0, PARAM_ALPHANUM);
|
||||
$mode= optional_param('mode', '', PARAM_ALPHA); // term entry cat date letter search author approval
|
||||
$hook= optional_param('hook', '', PARAM_CLEAN); // the term, entry, cat, etc... to look for based on mode
|
||||
$cat = optional_param('cat',0, PARAM_ALPHANUM);
|
||||
|
||||
if (! $cm = get_coursemodule_from_id('glossary', $id)) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
$url = new moodle_url($CFG->wwwroot.'/mod/glossary/export.php', array('id'=>$id));
|
||||
if ($cat !== 0) {
|
||||
$url->param('cat', $cat);
|
||||
}
|
||||
if ($mode !== '') {
|
||||
$url->param('mode', $mode);
|
||||
}
|
||||
if ($hook !== '') {
|
||||
$url->param('hook', $hook);
|
||||
}
|
||||
$PAGE->set_url($url);
|
||||
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
if (! $cm = get_coursemodule_from_id('glossary', $id)) {
|
||||
print_error('invalidcoursemodule');
|
||||
}
|
||||
|
||||
if (! $glossary = $DB->get_record("glossary", array("id"=>$cm->instance))) {
|
||||
print_error('invalidid', 'glossary');
|
||||
}
|
||||
if (! $course = $DB->get_record("course", array("id"=>$cm->course))) {
|
||||
print_error('coursemisconf');
|
||||
}
|
||||
|
||||
require_login($course->id, false, $cm);
|
||||
if (! $glossary = $DB->get_record("glossary", array("id"=>$cm->instance))) {
|
||||
print_error('invalidid', 'glossary');
|
||||
}
|
||||
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
require_capability('mod/glossary:export', $context);
|
||||
require_login($course->id, false, $cm);
|
||||
|
||||
$strglossaries = get_string("modulenameplural", "glossary");
|
||||
$strglossary = get_string("modulename", "glossary");
|
||||
$strallcategories = get_string("allcategories", "glossary");
|
||||
$straddentry = get_string("addentry", "glossary");
|
||||
$strnoentries = get_string("noentries", "glossary");
|
||||
$strsearchconcept = get_string("searchconcept", "glossary");
|
||||
$strsearchindefinition = get_string("searchindefinition", "glossary");
|
||||
$strsearch = get_string("search");
|
||||
$strexportfile = get_string("exportfile", "glossary");
|
||||
$strexportentries = get_string('exportentriestoxml', 'glossary');
|
||||
$context = get_context_instance(CONTEXT_MODULE, $cm->id);
|
||||
require_capability('mod/glossary:export', $context);
|
||||
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/glossary/export.php', array('id'=>$cm->id)));
|
||||
$PAGE->navbar->add($strexportentries);
|
||||
$PAGE->set_title(format_string($glossary->name));
|
||||
$PAGE->set_button(update_module_button($cm->id, $course->id, $strglossary));
|
||||
$strglossaries = get_string("modulenameplural", "glossary");
|
||||
$strglossary = get_string("modulename", "glossary");
|
||||
$strallcategories = get_string("allcategories", "glossary");
|
||||
$straddentry = get_string("addentry", "glossary");
|
||||
$strnoentries = get_string("noentries", "glossary");
|
||||
$strsearchconcept = get_string("searchconcept", "glossary");
|
||||
$strsearchindefinition = get_string("searchindefinition", "glossary");
|
||||
$strsearch = get_string("search");
|
||||
$strexportfile = get_string("exportfile", "glossary");
|
||||
$strexportentries = get_string('exportentriestoxml', 'glossary');
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($strexportentries);
|
||||
echo $OUTPUT->box_start('glossarydisplay generalbox');
|
||||
?>
|
||||
$PAGE->set_url(new moodle_url($CFG->wwwroot.'/mod/glossary/export.php', array('id'=>$cm->id)));
|
||||
$PAGE->navbar->add($strexportentries);
|
||||
$PAGE->set_title(format_string($glossary->name));
|
||||
$PAGE->set_button($OUTPUT->update_module_button($cm->id, 'glossary'));
|
||||
|
||||
echo $OUTPUT->header();
|
||||
echo $OUTPUT->heading($strexportentries);
|
||||
echo $OUTPUT->box_start('glossarydisplay generalbox');
|
||||
?>
|
||||
<form action="exportfile.php" method="post">
|
||||
<table border="0" cellpadding="6" cellspacing="6" width="100%">
|
||||
<tr><td align="center">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue