function add_jsordering() { switch (get_config('block_configurable_reports', 'reporttableui')) { case 'datatables': cr_add_jsdatatables('#reporttable'); break; case 'jquery': cr_add_jsordering('#reporttable'); echo html_writer::tag('style', '#page-blocks-configurable_reports-viewreport .generaltable { overflow: auto; width: 100%; display: block;}'); break; case 'html': echo html_writer::tag('style', '#page-blocks-configurable_reports-viewreport .generaltable { overflow: auto; width: 100%; display: block;}'); break; default: break; } }
$editcell .= '<a title="' . $strexport . '" href="export.php?id=' . $r->id . '&sesskey=' . $USER->sesskey . '"><img src="' . $OUTPUT->pix_url('/i/backup') . '" class="iconsmall" alt="' . $strexport . '" /></a> '; $editcell .= '<a title="' . $strschedule . '" href="./components/scheduler/schedule.php?id=' . $r->id . '&courseid=' . $r->courseid . '&sesskey=' . $USER->sesskey . '"><img src="' . $OUTPUT->pix_url('/i/backup') . '" class="iconsmall" alt="' . $strschedule . '" /></a> '; $download = ''; $export = explode(',', $r->export); if (!empty($export)) { foreach ($export as $e) if ($e) { $download .= '<a href="viewreport.php?id=' . $r->id . '&download=1&format=' . $e . '"><img src="' . $CFG->wwwroot . '/blocks/cobalt_reports/export/' . $e . '/pix.gif" alt="' . $e . '"> ' . (strtoupper($e)) . '</a> '; } } $table->data[] = array('<a href="viewreport.php?id=' . $r->id . '">' . $r->name . '</a>', $coursename, get_string('report_' . $r->type, 'block_cobalt_reports'), $owner, $editcell, $download); } $table->id = 'reportslist'; cr_add_jsordering("#reportslist"); cr_print_table($table); } else { echo $OUTPUT->heading(get_string('noreportsavailable', 'block_cobalt_reports')); } echo $OUTPUT->heading('<div class="addbutton"><a class="linkbutton" href="' . $CFG->wwwroot . '/blocks/cobalt_reports/editreport.php?courseid=' . $course->id . '">' . (get_string('addreport', 'block_cobalt_reports')) . '</a></div>'); // Repository report import. if ($userandrepo = get_config('block_cobalt_reports', 'crrepository')) { echo html_writer::start_tag('div', array('class' => 'mform')); echo html_writer::start_tag('fieldset'); echo html_writer::tag('legend', get_string('importfromrepository', 'block_cobalt_reports')); echo $OUTPUT->help_icon('repository', 'block_cobalt_reports') . " ";
function add_jsordering($reportclass, $libraries = false, $blockinstanceid = null) { $components = cr_unserialize($reportclass->config->components); switch (get_config('block_cobalt_reports', 'reporttableui')) { case 'datatables': $html = ''; if ($libraries == false) $html .=cr_add_datatblejs(); if ($blockinstanceid == null) $blockinstanceid = $reportclass->config->id; $html .= cr_add_jsdatatables('#reporttable_' . $blockinstanceid . '', $reportclass->config->id); break; case 'jquery': if ($libraries == false) $html = ''; $html .= cr_add_jsorderingjs(); if ($blockinstanceid == null) $blockinstanceid = $reportclass->config->id; $html .= cr_add_jsordering('#reporttable_' . $blockinstanceid . ''); $html .= html_writer::tag('style', '#page-blocks-cobalt_reports-viewreport .generaltable { overflow: auto; width: 100%; display: block;}'); break; case 'html': $html = html_writer::tag('style', '#page-blocks-cobalt_reports-viewreport .generaltable { overflow: auto; width: 100%; display: block;}'); break; default: break; } return $html; }
function add_jsordering() { cr_add_jsordering('#reporttable'); }