function definition()
    {
        global $CFG;
        global $currentSess;
        global $USER;
        global $DB;
        $currentRecord = $DB->get_record('block_cmanager_records', array('id' => $currentSess));
        $mform =& $this->_form;
        // Don't forget the underscore!
        $mform->addElement('header', 'mainheader', get_string('approvingcourses', 'block_cmanager'));
        // Page description text
        $mform->addElement('html', '<p></p>&nbsp;&nbsp;&nbsp;
					    	<a href="../cmanager_admin.php">< Back</a>');
        $mform->addElement('html', '<p></p><center>' . get_string('approvingcourses', 'block_cmanager') . '</center>');
        global $USER, $CFG, $DB;
        // Send Email to all concerned about the request deny.
        require_once '../lib/course_lib.php';
        $denyIds = explode(',', $_SESSION['mul']);
        foreach ($denyIds as $cid) {
            // If the id isn't blank
            if ($cid != 'null') {
                $mid = block_cmanager_create_new_course_by_record_id($cid, true);
            }
        }
        $_SESSION['mul'] = '';
        echo "<script> window.location = '../cmanager_admin.php';</script>";
    }
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */
require_once "../../../config.php";
global $CFG, $DB;
require_once "{$CFG->libdir}/formslib.php";
require_once '../../../course/lib.php';
require_once $CFG->libdir . '/completionlib.php';
require_once '../lib/course_lib.php';
require_login();
$PAGE->set_url('/blocks/cmanager/admin/approve_course_new.php');
$PAGE->set_context(context_system::instance());
$PAGE->set_title(get_string('pluginname', 'block_cmanager'));
$context = context_system::instance();
if (has_capability('block/cmanager:approverecord', $context)) {
} else {
    print_error(get_string('cannotapproverecord', 'block_cmanager'));
}
if (isset($_GET['id'])) {
    $mid = required_param('id', PARAM_INT);
    $_SESSION['mid'] = $mid;
} else {
    $mid = $_SESSION['mid'];
}
// Create the course by record ID
$nid = block_cmanager_create_new_course_by_record_id($mid, true);
if (empty($nid)) {
    echo 'New Mod ID Not set';
    die;
} else {
    echo '<script> window.location ="../../../course/edit.php?id=' . $nid . '";</script>';
}