Permalink
Browse files

MDL-37037 assign Show message if no files to download

  • Loading branch information...
1 parent e17644c commit c731018d50512f2233fc31bcaa8880f223688fb4 @micaherne micaherne committed with danpoltawski Dec 7, 2012
Showing with 10 additions and 1 deletion.
  1. +10 −1 mod/assign/locallib.php
View
@@ -2040,7 +2040,16 @@ private function download_submissions() {
}
}
}
- if ($zipfile = $this->pack_files($filesforzipping)) {
+ if (count($filesforzipping) == 0) {
+ $result = $this->get_renderer()->render(new assign_header($this->get_instance(),
+ $this->get_context(),
+ '',
+ $this->get_course_module()->id,
+ get_string('downloadall', 'assign')));
+ $result .= $this->get_renderer()->notification(get_string('nosubmission', 'assign'));
+ $result .= $this->view_footer();
+ return $result;
+ } else if ($zipfile = $this->pack_files($filesforzipping)) {
$this->add_to_log('download all submissions', get_string('downloadall', 'assign'));
// Send file and delete after sending.
send_temp_file($zipfile, $filename);

0 comments on commit c731018

Please sign in to comment.