From b5b7d9d91acf45e8519375378992e3bac7946ddf Mon Sep 17 00:00:00 2001 From: Sun Zhigang Date: Sat, 2 Jul 2011 18:41:26 +0800 Subject: [PATCH] MDL-28155 mod_assignment - Fix an ugly hack Show download all link for any assignment types which implement the download_submissions() method --- mod/assignment/lib.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mod/assignment/lib.php b/mod/assignment/lib.php index 8f8dcf3efe0..d7115e6e318 100644 --- a/mod/assignment/lib.php +++ b/mod/assignment/lib.php @@ -1591,7 +1591,7 @@ class assignment_base { } $currentposition++; } - if ($hassubmission && ($this->assignment->assignmenttype=='upload' || $this->assignment->assignmenttype=='online' || $this->assignment->assignmenttype=='uploadsingle')) { //TODO: this is an ugly hack, where is the plugin spirit? (skodak) + if ($hassubmission && method_exists('assignment_'.$this->assignment->assignmenttype, 'download_submissions')) { echo html_writer::start_tag('div', array('class' => 'mod-assignment-download-link')); echo html_writer::link(new moodle_url('/mod/assignment/submissions.php', array('id' => $this->cm->id, 'download' => 'zip')), get_string('downloadall', 'assignment')); echo html_writer::end_tag('div'); -- 2.43.0