fa285134cb
On assigning the block to a course, a skill needs to be selected in the config, instead of creating a new skill by default
36 lines
1.1 KiB
PHP
36 lines
1.1 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_config_skills");
|
|
|
|
$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/skilleditor', 'init');
|
|
$PAGE->requires->js_call_amd('block_gradelevel/renderbadge', 'init');
|
|
|
|
print $OUTPUT->header();
|
|
print $OUTPUT->heading(get_string('cfgpage_skills', 'block_gradelevel'));
|
|
|
|
// render page for skill level 0 (global)
|
|
print block_gradelevel_skillmgmtservice::render_skill_list(0);
|
|
print $OUTPUT->footer();
|