$rec->runreference = (bool) $runreference; $rec->runcomment = $runcomment; $DB->update_record('profiling', $rec); } // Get the requested runid $run = $DB->get_record('profiling', array('runid' => $runid), $dbfields, IGNORE_MISSING); // No run found for runid, warn and exit if (!$run) { notice(get_string('cannotfindanyrunforrunid', 'tool_profiling', $runid), 'index.php'); } // Check if there is any previous run marked as reference one $prevreferences = $DB->get_records_select('profiling', 'url = ? AND runreference = 1 AND timecreated < ?', array($run->url, $run->timecreated), 'timecreated DESC', 'runid, runcomment, timecreated', 0, 10); echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter'); $header = get_string('summaryof', 'tool_profiling', $run->url); echo $OUTPUT->heading($header); $table = profiling_print_run($run, $prevreferences); echo $table; echo $OUTPUT->box_end(); // Default: List one page of runs } else { // The flexitable that will root listings $table = new xhprof_table_sql('profiling-list-table'); $baseurl = $CFG->wwwroot . '/' . $CFG->admin . '/tool/profiling/index.php'; // Check if we are listing all or some URL ones $sqlconditions = ''; $sqlparams = array(); if (!isset($listurl)) { $header = get_string('pluginname', 'tool_profiling'); $sqlconditions = '1 = 1'; $table->set_listurlmode(false); } else {
$rec->runcomment = $runcomment; $DB->update_record('profiling', $rec); } // Get the requested runid $run = $DB->get_record('profiling', array('runid' => $runid), $dbfields, IGNORE_MISSING); // No run found for runid, warn and exit if (!$run) { notice(get_string('cannotfindanyrunforrunid', 'tool_profiling', $runid), 'index.php'); } // Check if there is any previous run marked as reference one $prevreferences = $DB->get_records_select('profiling', 'url = ? AND runreference = 1 AND timecreated < ?', array($run->url, $run->timecreated), 'timecreated DESC', 'runid', 0, 1); $prevrunid = $prevreferences ? reset($prevreferences)->runid : false; echo $OUTPUT->box_start('generalbox boxwidthwide boxaligncenter'); $header = get_string('summaryof', 'tool_profiling', $run->url); echo $OUTPUT->heading($header); $table = profiling_print_run($run, $prevrunid); echo $table; echo $OUTPUT->box_end(); // Default: List one page of runs } else { // The flexitable that will root listings $table = new xhprof_table_sql('profiling-list-table'); $baseurl = $CFG->wwwroot . '/admin/tool/profiling/index.php'; // Check if we are listing all or some URL ones $sqlconditions = ''; $sqlparams = array(); if (!isset($listurl)) { $header = get_string('pluginname', 'tool_profiling'); $sqlconditions = '1 = 1'; $table->set_listurlmode(false); } else {