libdir.'/adminlib.php'); admin_externalpage_setup("block_gradelevel_default_levels"); $action = optional_param('action', null, PARAM_ALPHA); $data = optional_param('data', null, PARAM_ALPHA); if(!empty($data)) { $data = json_decode($data); } if(!empty($action) && confirm_sesskey()) { switch($action) { case 'submitchanges': print_r($data); redirect($PAGE->url); break; } } else { $PAGE->requires->js_call_amd('block_gradelevel/leveleditor', 'init'); print $OUTPUT->header(); print $OUTPUT->heading(get_string('cfgpage_globallevels', 'block_gradelevel')); $global_levels = $DB->get_records('block_gradelevel_levels', array('levelset_id' => 0)); usort( $global_levels, function( $a, $b) { return ( $a->points < $b->points ) ? -1 : 1; } ); $skill_id = 0; print "

".get_string('levelcfg_description','block_gradelevel')."

"; print ""; print ""; print ""; foreach($global_levels as $lvl) { $color = ltrim($lvl->badgecolor,"#"); print ""; } print ""; print ""; print "
".get_string('levelcfg_head_points','block_gradelevel')."".get_string('levelcfg_head_color','block_gradelevel')."
".get_string("levelcfg_addlevel",'block_gradelevel')."
"; print "

"; print $OUTPUT->footer(); }