3 require_once("../../config.php");
4 require_once("lib.php");
6 $id = required_param('id', PARAM_INT
); // Course Module ID
8 $mode= optional_param('mode', '', PARAM_ALPHA
); // term entry cat date letter search author approval
9 $hook= optional_param('hook', '', PARAM_CLEAN
); // the term, entry, cat, etc... to look for based on mode
10 $cat = optional_param('cat',0, PARAM_ALPHANUM
);
12 $url = new moodle_url('/mod/glossary/export.php', array('id'=>$id));
14 $url->param('cat', $cat);
17 $url->param('mode', $mode);
22 if (! $cm = get_coursemodule_from_id('glossary', $id)) {
23 print_error('invalidcoursemodule');
26 if (! $course = $DB->get_record("course", array("id"=>$cm->course
))) {
27 print_error('coursemisconf');
30 if (! $glossary = $DB->get_record("glossary", array("id"=>$cm->instance
))) {
31 print_error('invalidid', 'glossary');
34 require_login($course, false, $cm);
36 $context = context_module
::instance($cm->id
);
37 require_capability('mod/glossary:export', $context);
39 $strglossaries = get_string("modulenameplural", "glossary");
40 $strglossary = get_string("modulename", "glossary");
41 $strallcategories = get_string("allcategories", "glossary");
42 $straddentry = get_string("addentry", "glossary");
43 $strnoentries = get_string("noentries", "glossary");
44 $strsearchindefinition = get_string("searchindefinition", "glossary");
45 $strsearch = get_string("search");
46 $strexportfile = get_string("exportfile", "glossary");
47 $strexportentries = get_string('exportentriestoxml', 'glossary');
49 $PAGE->set_url('/mod/glossary/export.php', array('id'=>$cm->id
));
50 $PAGE->navbar
->add($strexportentries);
51 $PAGE->set_title($glossary->name
);
52 $PAGE->set_heading($course->fullname
);
54 echo $OUTPUT->header();
55 echo $OUTPUT->heading($strexportentries);
56 echo $OUTPUT->box_start('glossarydisplay generalbox');
57 $exporturl = moodle_url
::make_pluginfile_url($context->id
, 'mod_glossary', 'export', 0, "/$cat/", 'export.xml', true);
60 <form action
="<?php echo $exporturl->out(); ?>" method
="post">
61 <input
class="btn btn-primary" type
="submit" value
="<?php p($strexportfile)?>" />
64 // don't need cap check here, we share with the general export.
65 if (!empty($CFG->enableportfolios
) && $DB->count_records('glossary_entries', array('glossaryid' => $glossary->id
))) {
66 require_once($CFG->libdir
. '/portfoliolib.php');
67 $button = new portfolio_add_button();
68 $button->set_callback_options('glossary_full_portfolio_caller', array('id' => $cm->id
), 'mod_glossary');
71 echo $OUTPUT->box_end();
72 echo $OUTPUT->footer();