MDL-16414 - make the handling of the download portfolio plugin nicer
[moodle.git] / portfolio / type / download / file.php
CommitLineData
abcd0fc5 1<?php
2
3require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
4require_once($CFG->libdir . '/portfoliolib.php');
5require_js(array(
6 'yui_yahoo',
7 'yui_dom',
8));
9$id = required_param('id', PARAM_INT);
10
11$exporter = portfolio_exporter::rewaken_object($id);
12$exporter->verify_rewaken();
13
14$exporter->print_header(get_string('downloading', 'portfolio_download'), false);
15$returnurl = $exporter->get('caller')->get_return_url();
16notify('<a href="' . $returnurl . '">' . get_string('returntowhereyouwere', 'portfolio') . '</a><br />');
17
18echo '<div id="redirect">
19 <form action="' . $exporter->get('instance')->get_base_file_url() . '" method="post" id="redirectform">
20 <input type="submit" value="' . get_string('downloadfile', 'portfolio_download') . '" />
21 </form>
22 <script language="javascript">
23 f = YAHOO.util.Dom.get("redirectform");
24 YAHOO.util.Dom.addClass(f.parentNode, "hide");
25 f.submit();
26 </script>';
27
28print_footer();
29
30?>