Пример #1
0
 /**
  * Validate conversion of empty table object to HTML representation
  */
 public function test_logtablehtmlreturnsemptymessage()
 {
     global $CFG, $OUTPUT;
     require_once $CFG->dirroot . '/local/datahub/lib.php';
     // Create table object.
     $table = new html_table();
     $output = rlip_log_table_html($table);
     // Validation.
     $this->assertEquals($output, $OUTPUT->heading(get_string('nologmessage', 'local_datahub')));
 }
Пример #2
0
require_once '../../config.php';
require_once $CFG->dirroot . '/lib/adminlib.php';
require_once $CFG->dirroot . '/local/datahub/lib.php';
require_once $CFG->dirroot . '/local/datahub/lib/rlip_log_filtering.class.php';
//permissions checking
require_login();
$context = context_system::instance();
require_capability('moodle/site:config', $context);
//page information
$page = optional_param('page', 0, PARAM_INT);
$baseurl = $CFG->wwwroot . '/local/datahub/viewlogs.php';
//header
admin_externalpage_setup('rliplogs');
$PAGE->requires->css('/local/datahub/styles.css');
echo $OUTPUT->header();
//filters
$filtering = new rlip_log_filtering();
list($extrasql, $params) = $filtering->get_sql_filter();
//top paging bar
$numrecords = rlip_count_logs($extrasql, $params);
echo $OUTPUT->paging_bar($numrecords, $page, RLIP_LOGS_PER_PAGE, $baseurl);
$filtering->display_add();
$filtering->display_active();
//display main table
$logs = rlip_get_logs($extrasql, $params, $page);
$table = rlip_get_log_table($logs);
echo rlip_log_table_html($table);
//bottom paging bar
echo $OUTPUT->paging_bar($numrecords, $page, RLIP_LOGS_PER_PAGE, $baseurl);
//footer
echo $OUTPUT->footer();