MDL-28155 mod_assignment - Fix an ugly hack

Show download all link for any assignment types which implement
the download_submissions() method
This commit is contained in:
Sun Zhigang
2012-07-10 13:32:36 +08:00
committed by David Monllao
parent 116714e8dc
commit 7add6bb507
+1 -1
View File
@@ -1584,7 +1584,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');