Пример #1
0
}
$PAGE->navbar->add($strheading);
$string = get_string('pluginname', 'local_examtype') . ' : ' . $strheading;
$PAGE->set_title($string);
$examtypeedit = new edit_form();
$examtypeedit->set_data($tool);
if ($examtypeedit->is_cancelled()) {
    redirect($returnurl);
} else if ($data = $examtypeedit->get_data()) {
    if ($data->id > 0) {
        $data->description = $data->description['text'];
        $result = $instance->examtype_update_instance($data);
        $instance->success_error_msg($result, 'success_up_exam', 'error_up_exam', $currenturl, $data);
    } else {
        $data->description = $data->description['text'];
        $result = $instance->examtype_add_instance($data);
        $instance->success_error_msg($result, 'success_add_exam', 'error_add_exam', $currenturl, $data);
    }
    redirect($returnurl);
}
echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('manageexamtype', 'local_examtype'));
if ($id < 0)
    $currenttab = 'new';
else
    $currenttab = 'edit';
$instance->print_examtabs($currenttab, $id);
if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) {
    if ($id > 0)
        echo $OUTPUT->box(get_string('editexamdesc', 'local_examtype'));
    else