Exemple #1
0
 /**
  * Render mr_report_abstract
  *
  * @param mr_report_abstract $report mr_report_abstract instance
  * @return string
  * @todo Render in heading with help button?
  */
 public function render_mr_report_abstract(mr_report_abstract $report)
 {
     // Send JSON if necessary
     $this->mr_html_table_json($report->get_table(), $report->get_paging());
     // Wrapper DIV
     $output = $this->output->box_start('boxwidthwide boxaligncenter mr_report');
     // Heading
     // $output .= $this->output->heading($report->name());
     // Render report SQL
     $output .= $this->help_render_mr_report_sql($report);
     // Render description
     if ($description = $report->get_description()) {
         $output .= $this->output->box($description, 'generalbox boxwidthnormal boxaligncenter mr_report_description');
     }
     // Render Hook
     $output .= $this->help_render_navigation_display($report);
     // Render filter
     if ($report->get_filter() instanceof mr_html_filter) {
         $output .= $this->render($report->get_filter());
     }
     // Render hook
     $output .= $this->help_render_chart_select($report);
     // Render as AJAX or our default rendering
     if ($report->get_config()->ajax and $report->get_preferences()->get('forceajax', $report->get_config()->ajaxdefault)) {
         $output .= $report->output_wrapper($this->mr_html_table_ajax($report->get_table(), $report->get_paging()));
     } else {
         // Render paging top
         $output .= $this->render($report->get_paging());
         // Render table and allow report to wrap it with w/e
         $output .= $report->output_wrapper($this->render($report->get_table()));
         // Render paging bottom
         $output .= $this->render($report->get_paging());
     }
     // Render export
     if ($report->get_export() instanceof mr_file_export) {
         $output .= $this->render($report->get_export());
     }
     // Render AJAX toggle link
     if ($report->get_config()->ajax) {
         if ($report->get_preferences()->get('forceajax', $report->get_config()->ajaxdefault)) {
             $newajax = 0;
             $label = get_string('basichtml', 'local_mr');
         } else {
             $newajax = 1;
             $label = get_string('standard', 'local_mr');
         }
         $url = clone $report->get_url();
         $url->param('forceajax', $newajax);
         $link = html_writer::link($url, $label, array('title' => $label));
         $output .= html_writer::tag('div', $link, array('class' => 'mr_ajax_table_forceajax'));
     }
     // Close wrapper DIV
     $output .= $this->output->box_end();
     return $output;
 }