3 require_once($CFG->libdir
. '/portfoliolib.php');
5 class portfolio_plugin_download
extends portfolio_plugin_pull_base
{
7 protected $exportconfig;
9 public static function get_name() {
10 return get_string('pluginname', 'portfolio_download');
13 public static function allows_multiple_instances() {
17 public function expected_time($callertime) {
18 return PORTFOLIO_TIME_LOW
;
21 public function prepare_package() {
23 $files = $this->exporter
->get_tempfiles();
25 if (count($files) == 1) {
26 $this->set('file', array_shift($files));
28 $this->set('file', $this->exporter
->zip_tempfiles()); // this will throw a file_exception which the exporter catches separately.
32 public function steal_control($stage) {
33 if ($stage == PORTFOLIO_STAGE_FINISHED
) {
35 return $CFG->wwwroot
. '/portfolio/download/file.php?id=' . $this->get('exporter')->get('id');
39 public function send_package() {}
41 public function verify_file_request_params($params) {
42 // for download plugin the only thing we need to verify is that
43 // the logged in user is the same as the exporting user
45 if ($USER->id
!= $this->user
->id
) {
51 public function get_interactive_continue_url() {