Example #1
0
    public function execute() {

        global $CFG, $DB, $USER;
        $mapletadp = new \mod_mapletadp\controller\Mapleta($DB, $CFG, $USER);
        $mapletadp->refreshAllData();
    }
Example #2
0
require_once('../../config.php');
require_login();
$synchro = optional_param('synchro', false, PARAM_BOOL);
$context = context_system::instance();
$PAGE->set_context($context);
$base_url = new moodle_url('/local/mapleta/index.php');
$PAGE->set_url($base_url);
$PAGE->set_pagelayout('standard');

echo $OUTPUT->header();

echo $OUTPUT->heading(get_string('heading', 'local_mapleta'));
$url = new moodle_url('local/mapleta/monitor.php');
echo "<a href='" . $CFG->wwwroot . "/local/mapleta/monitor.php'>" . get_string('monitor', 'local_mapleta') . "</a><br/>";
echo "<a href='" . $CFG->wwwroot . "/local/mapleta/index.php?synchro=true'>" . get_string('synchro', 'local_mapleta') . "</a><br/>";
echo "<a href='" . $CFG->wwwroot . "/admin/cron.php'>" . get_string('cronlink', 'local_mapleta') . "</a><br/>";

if ($synchro) {
    echo '<div id="synchro">';
    $mapletadp = new \mod_mapletadp\controller\Mapleta($DB, $CFG, $USER);
    if($mapletadp->refreshAllData()){
        echo "<h4>".  get_string('synchrodone','local_mapleta')."</h4>";
    }else{
        echo "<h4>".  get_string('synchrofail','local_mapleta')."</h4>";
    }
    echo '</div>';
}

echo $OUTPUT->footer();
exit();
Example #3
0
<?php

global $PAGE, $OUTPUT, $DB, $CFG, $USER;

require_once('../../config.php');
require_login();

$context = context_system::instance();
$PAGE->set_context($context);
$base_url = new moodle_url('/local/mapleta/index.php');
$PAGE->set_url($base_url);
$PAGE->set_pagelayout('standard');
$controller = new \mod_mapletadp\controller\Connector($DB, $CFG, $USER);

echo $OUTPUT->header();

echo $OUTPUT->heading(get_string('monitorheader', 'local_mapleta'));
$mapletadp = new \mod_mapletadp\controller\Mapleta($DB, $CFG, $USER);

$monitors = $mapletadp->getMonitors();
if(count($monitors) && $monitors){
    echo "<table  cellspacing='0' class='flexible generaltable generalbox'>";
    foreach($monitors as $key => $value){
        echo "<tr><td>".  get_string($key,'local_mapleta')."</td><td><b>".$value."</b></td></tr>";
    }
    echo "</table>";
}
echo $OUTPUT->footer();
exit();