コード例 #1
0
 * @version Moodle 2.x
 */
require_once $CFG->dirroot . '/blocks/dashboard/lib.php';
require_once $CFG->dirroot . '/blocks/dashboard/extradblib.php';
if (file_exists($CFG->libdir . '/jqplotlib.php')) {
    $graphlibs = $CFG->libdir;
    $graphwww = '/lib';
} else {
    $graphlibs = '_goodies/lib';
    $graphwww = '/blocks/dashboard/_goodies/lib';
}
require_once $graphlibs . '/jqplotlib.php';
require_once $graphlibs . '/googleplotlib.php';
require_once $graphlibs . '/timelinelib.php';
include_once $CFG->libdir . '/tablelib.php';
require_jqplot_libs($graphwww);
timeline_require_js($graphwww);
global $PAGE;
$PAGE->requires->js('/blocks/dashboard/js/module.js');
$PAGE->requires->js('/blocks/dashboard/js/dhtmlxCalendar/codebase/dhtmlxcalendar.css');
$PAGE->requires->js('/blocks/dashboard/js/dhtmlxCalendar/codebase/skins/dhtmlxcalendar_dhx_web.css');
class block_dashboard extends block_base
{
    var $devmode = true;
    // use local moodle database to develop virual tools.
    var $filtervalues;
    // collects effective filter values set by user
    var $paramvalues;
    // collects effective param values set by user
    var $filters;
    // stores filter definitions
コード例 #2
0
require_login();
$systemcontext = context_system::instance();
require_capability('moodle/site:config', $systemcontext);
// Process controller
$reset = optional_param('reset', 0, PARAM_INT);
if ($reset) {
    $DB->delete_records('local_ent_installer', array());
}
if (file_exists($CFG->libdir . '/jqplotlib.php')) {
    include_once $CFG->libdir . '/jqplotlib.php';
    $libroot = $CFG->libdir . '/jqplot';
} else {
    include_once $CFG->dirroot . '/local/ent_installer/js/jqplotlib.php';
    $libroot = $CFG->dirroot . '/local/ent_installer/js/jqplot';
}
require_jqplot_libs($libroot);
$titlestr = get_string('synctimetitle', 'local_ent_installer');
$PAGE->set_context($systemcontext);
$PAGE->set_heading($titlestr);
$PAGE->set_pagelayout('admin');
$PAGE->navbar->add(get_string('pluginname', 'local_ent_installer'), new moodle_url('/admin/settings.php', array('section' => 'local_ent_installer')));
$PAGE->navbar->add(get_string('syncbench', 'local_ent_installer'));
echo $OUTPUT->header();
echo $OUTPUT->heading($titlestr);
// Three month horizon.
$horizon = time() - DAYSECS * 90;
$sumduration = 0;
$minduration = null;
$maxduration = 0;
$suminserts = 0;
$sumupdates = 0;