Updated the HEAD build version to 20090502
[moodle.git] / portfolio / type / download / file.php
CommitLineData
abcd0fc5 1<?php
2
3require_once(dirname(dirname(dirname(dirname(__FILE__)))) . '/config.php');
add560f3 4
5if (empty($CFG->enableportfolios)) {
6 print_error('disabled', 'portfolio');
7}
8
214b1cf7 9require_once($CFG->libdir.'/portfoliolib.php');
ac324e05 10require_js(array('yui_yahoo', 'yui_dom'));
abcd0fc5 11$id = required_param('id', PARAM_INT);
12
add560f3 13require_login();
14
abcd0fc5 15$exporter = portfolio_exporter::rewaken_object($id);
16$exporter->verify_rewaken();
17
18$exporter->print_header(get_string('downloading', 'portfolio_download'), false);
19$returnurl = $exporter->get('caller')->get_return_url();
20notify('<a href="' . $returnurl . '">' . get_string('returntowhereyouwere', 'portfolio') . '</a><br />');
21
22echo '<div id="redirect">
23 <form action="' . $exporter->get('instance')->get_base_file_url() . '" method="post" id="redirectform">
24 <input type="submit" value="' . get_string('downloadfile', 'portfolio_download') . '" />
25 </form>
26 <script language="javascript">
27 f = YAHOO.util.Dom.get("redirectform");
28 YAHOO.util.Dom.addClass(f.parentNode, "hide");
29 f.submit();
30 </script>';
31
32print_footer();
33
34?>