X-Git-Url: http://git.moodle.org/gw?p=moodle.git;a=blobdiff_plain;f=portfolio%2Fdownload%2Ffile.php;h=2a82df382b18461e6fbd817f36eb7f02aa111d0d;hp=6c1a4b8690395f4d005891f80995774d0f7fb034;hb=633d5a07af9d0d18567deb7a696c8d3a7d259337;hpb=edf1fc350a90dbae3f64d6ddd65e60c3caab4a62;ds=sidebyside diff --git a/portfolio/download/file.php b/portfolio/download/file.php index 6c1a4b86903..2a82df382b1 100644 --- a/portfolio/download/file.php +++ b/portfolio/download/file.php @@ -11,13 +11,15 @@ if (empty($CFG->enableportfolios)) { } require_once($CFG->libdir.'/portfoliolib.php'); -$PAGE->requires->yui_lib('dom'); +require_once($CFG->libdir.'/portfolio/exporter.php'); + +$PAGE->requires->yui2_lib('dom'); $id = required_param('id', PARAM_INT); -require_login(); $PAGE->set_url('/portfolio/download/file.php', array('id' => $id)); $exporter = portfolio_exporter::rewaken_object($id); +portfolio_export_pagesetup($PAGE, $exporter->get('caller')); $exporter->verify_rewaken(); $exporter->print_header(get_string('downloading', 'portfolio_download'), false); @@ -25,7 +27,7 @@ $returnurl = $exporter->get('caller')->get_return_url(); echo $OUTPUT->notification('' . get_string('returntowhereyouwere', 'portfolio') . '
'); $PAGE->requires->js('/portfolio/download/helper.js'); -$PAGE->requires->js_function_call('submit_download_form')->on_dom_ready(); +$PAGE->requires->js_function_call('submit_download_form', null, true); // if they don't have javascript, they can submit the form here to get the file. // if they do, it does it nicely for them.