moodle-block_mytreestudyplan/cfg_globallevels.php
pmk fa285134cb Finished level management
On assigning the block to a course, a skill needs to be selected in the config,
instead of creating a new skill by default
2018-09-23 22:06:52 +02:00

35 lines
1.0 KiB
PHP

<?php
if(isset($_SERVER['SCRIPT_FILENAME']))
{
// If SCRIPT_FILENAME is set, use that so the symlinked directories the developmen environment uses are handled correctly
$root = dirname(dirname(dirname($_SERVER['SCRIPT_FILENAME'])));
error_log("Using {$root}/config.php");
require_once($root."/config.php");
}
else
{
// If not, assume the cwd is not symlinked and proceed as we are used to
require_once("../../config.php");
}
// HOW DID WE ENSURE ONLY ADMINS CAN VIEW THIS PAGE?
require_once($CFG->libdir.'/adminlib.php');
admin_externalpage_setup("block_gradelevel_default_levels");
$systemcontext = context_system::instance();
// Check if user has capability to manage skills
require_capability('block/gradelevel:skillmanager', $systemcontext);
$PAGE->requires->js_call_amd('block_gradelevel/leveleditor', 'init');
print $OUTPUT->header();
print $OUTPUT->heading(get_string('cfgpage_globallevels', 'block_gradelevel'));
// render page for skill level 0 (global)
print block_gradelevel_skillmgmtservice::render_leveltable(0);
print $OUTPUT->footer();