Browse files

only display "Excel" option, if an Excel library is available

  • Loading branch information...
1 parent ca61cb4 commit b74d3407625b2467dc07f1e65c8255108056af07 gbateson committed Jan 21, 2006
Showing with 8 additions and 5 deletions.
  1. +8 −5 mod/hotpot/report.php
View
13 mod/hotpot/report.php
@@ -472,11 +472,14 @@ function hotpot_print_report_selector(&$course, &$hotpot, &$formdata) {
print '<input type="submit" value="'.get_string('reportbutton', 'hotpot').'"></td></tr>';
$menus = array();
- $menus['reportformat'] = array(
- 'htm' => get_string('reportformathtml', 'hotpot'),
- 'xls' => get_string('reportformatexcel', 'hotpot'),
- 'txt' => get_string('reportformattext', 'hotpot'),
- );
+
+ $menus['reportformat'] = array();
+ $menus['reportformat']['htm'] = get_string('reportformathtml', 'hotpot');
+ if (file_exists("$CFG->libdir/excel") || file_exists("$CFG->libdir/excellib.class.php")) {
+ $menus['reportformat']['xls'] = get_string('reportformatexcel', 'hotpot');
+ }
+ $menus['reportformat']['txt'] = get_string('reportformattext', 'hotpot');
+
if (trim($CFG->hotpot_excelencodings)) {
$menus['reportencoding'] = array(get_string('none')=>'');

0 comments on commit b74d340

Please sign in to comment.