Ejemplo n.º 1
0
if ($CFG->forcelogin) {
    require_login();
} else {
    user_accesstime_log();
}
if (!has_capability('local/modules:view', $systemcontext)) {
    print_error('You dont have permissions');
}
$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'));
}
Ejemplo n.º 2
0
$perpage = optional_param('perpage', $defaultperpage, PARAM_INT); // how many per page
global $DB;
require_login();
$systemcontext = context_system::instance();
//get the admin layout
$PAGE->set_pagelayout('admin');
//check the context level of the user and check weather the user is login to the system or not
$PAGE->set_context($systemcontext);
$PAGE->set_heading($SITE->fullname);
$PAGE->navbar->add(get_string('managemodule', 'local_modules'), "/local/modules/index.php", get_string('viewmodules', 'local_modules'));
$PAGE->navbar->add(get_string('assigncourses', 'local_modules'));
$PAGE->set_url(new moodle_url('/local/modules/assigncourse.php', array('id' => $id)));
$string = get_string('managemodule', 'local_modules') . ':' . get_string('assigncourses', 'local_modules');
$PAGE->set_title($string);
$PAGE->set_pagelayout('admin');
$instance = new cobalt_modules();
echo $OUTPUT->header();

$returnurl = new moodle_url('/local/modules/assigncourse.php', array('id' => $id));

if (!empty($moveto) and $data = data_submitted()) {
    ;
    if (!$destcategory = $DB->get_record('local_module', array('id' => $data->moveto))) {
        print_error('cannotfindmodules', '', '', $data->moveto);
    }
    $courses = array();
    foreach ($data as $key => $value) {
        if (preg_match('/^c\d+$/', $key)) {
            $courseid = substr($key, 1);
            array_push($courses, $courseid);
        }
Ejemplo n.º 3
0
//check the context level of the user and check weather the user is login to the system or not
$PAGE->set_context($systemcontext);
if ($CFG->forcelogin) {
    require_login();
} else {
    user_accesstime_log();
}
$PAGE->set_url('/local/curriculum/index.php');

//Header and the navigation bar
$PAGE->set_heading($SITE->fullname);
$PAGE->navbar->add(get_string('managemodule', 'local_modules'), "/local/modules/index.php", get_string('managemodule', 'local_modules'));
$PAGE->navbar->add(get_string('viewmodules', 'local_modules'));
echo $OUTPUT->header();
$tools = $DB->get_records('local_module_course', array('moduleid' => $proid));
$instance = new cobalt_modules();
$data = array();
if ($tools) {
    foreach ($tools as $tool) {
        $line = array();
        $coursename = $instance->get_coursename($tool->courseid);
        $line[] = $coursename;
        $data[] = $line;
    }
} else {
    $line = array();
    $line[] = get_string('no_course', 'local_modules');
    $data[] = $line;
}
// Moodle 2.2 and onwards
$modulelist = $DB->get_record('local_module', array('id' => $proid));
Ejemplo n.º 4
0
if ($CFG->forcelogin) {
    require_login();
} else {
    user_accesstime_log();
}
$PAGE->set_heading($SITE->fullname);
if ($id > 0)
    $string = get_string('pluginname', 'local_modules') . ':' . get_string('editmodule', 'local_modules');
else
    $string = get_string('pluginname', 'local_modules') . ':' . get_string('createmodule', 'local_modules');
$PAGE->set_title($string);
//this is the return url 
$returnurl = new moodle_url('/local/modules/index.php', array('id' => $id));
$currenturl = "{$CFG->wwwroot}/local/modules/index.php";
$strheading = get_string('createmodule', 'local_modules');
$instance = new cobalt_modules();
/* Start of delete the module */
if ($delete) {
    $PAGE->url->param('delete', 1);
    if ($confirm and confirm_sesskey()) {
        $result = $instance->module_delete_instance($id);
        $instance->success_error_msg($result, 'success_del_module', 'error_del_module', $currenturl, null);
        redirect($returnurl);
    }
    $strheading = get_string('deletemodule', 'local_modules');
    $PAGE->navbar->add(get_string('managemodule', 'local_modules'), "/local/modules/index.php", get_string('viewmodules', 'local_modules'));
    $PAGE->navbar->add($strheading);

    echo $OUTPUT->header();
    echo $OUTPUT->heading($strheading);
    $checkexistmodule = $DB->get_records('local_module_permissions', array('moduleid' => $id));
Ejemplo n.º 5
0
if ($CFG->forcelogin) {
    require_login();
} else {
    user_accesstime_log();
}
if (!has_capability('local/modules:manage', $systemcontext)) {
    print_error('You dont have permissions');
}
$PAGE->set_url('/local/modules/info.php');
$PAGE->set_title(get_string('pluginname', 'local_modules'));
//Header and the navigation bar
$PAGE->set_heading($SITE->fullname);
$PAGE->navbar->add(get_string('managemodule', 'local_modules'), new moodle_url('/local/modules/index.php'));
$PAGE->navbar->add(get_string('info', 'local_modules'));
$instance = new cobalt_modules();
//echo $OUTPUT->header();
echo $OUTPUT->header();
//Heading of the page
echo $OUTPUT->heading(get_string('modules:manage', 'local_modules'));
$currenttab = "info";
$instance = new cobalt_modules();
$instance->print_tabs($currenttab, -1);
// Moodle 2.2 and onwards
if (isset($CFG->allowframembedding) and ! $CFG->allowframembedding) {
    echo $OUTPUT->box(get_string('helpinfo', 'local_modules'));
}
$content = get_string('info_help', 'local_modules');
echo '<div class="help_cont">' . $content . '<div>';

echo $OUTPUT->footer();