示例#1
0
文件: index.php 项目: anilch/Personel
$PAGE->set_url('/local/modules/index.php');
$string = get_string('pluginname', 'local_modules') . ':' . get_string('viewmodules', 'local_modules');
$PAGE->set_title($string);
//Header and the navigation bar
$PAGE->set_heading($SITE->fullname);
$PAGE->navbar->add(get_string('managemodule', 'local_modules'));
$PAGE->navbar->add(get_string('viewmodules', 'local_modules'));
$instance = new cobalt_modules();
//echo $OUTPUT->header();
echo $OUTPUT->header();
//Heading of the page
echo $OUTPUT->heading(get_string('managemodule', 'local_modules'));
$hier = new hierarchy();
$schools = $hier->get_assignedschools();
$currenttab = "lists";
$instance->print_tabs($currenttab, -1);

// 
// Moodle 2.2 and onwards
if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) {
    echo $OUTPUT->box(get_string('allowframembedding', 'local_modules'));
}

$schools = $hier->get_school_parent($schools, $selected = array(), $inctop = false, $all = false);
if (is_siteadmin()) {
    $schools = $hier->get_school_items();
}

$schoollist_string = implode(',', array_keys($schools));
if (empty($schoollist_string)) {
    echo get_string('no_records', 'local_request');
示例#2
0
    } else {
        // Create new
        $data->description = $data->description['text'];
        $result = $instance->module_add_instance($data, $userid);
        $instance->success_error_msg($result, 'success_add_module', 'error_add_module', $currenturl, $data);
    }
    redirect($returnurl);
}

echo $OUTPUT->header();
echo $OUTPUT->heading(get_string('managemodule', 'local_modules'));
if ($id < 0)
    $currenttab = "new";
else
    $currenttab = "edit";
$instance->print_tabs($currenttab, $id);
if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) {
    if ($id < 0)
        echo $OUTPUT->box(get_string('addnewdesc', 'local_modules'));
    else
        echo $OUTPUT->box(get_string('editnewdesc', 'local_modules'));
}
if (!$exists = $DB->get_records('local_curriculum_plancourses', array('moduleid' => $id))) {
    $editform->display();
} else {
    $yesurl = new moodle_url('/local/modules/index.php');
    $message = get_string('notedit', 'local_modules');
    echo $OUTPUT->box_start('generalbox');
    echo '<h4>' . $message . '</h4>';
    echo $OUTPUT->single_button(new moodle_url('/local/modules/index.php'), get_string('continue'));
    echo $OUTPUT->box_end();