Proyectos de Subversion Moodle

Rev

Rev 1 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 1 Rev 1441
Línea 27... Línea 27...
27
require_once($CFG->dirroot.'/cohort/lib.php');
27
require_once($CFG->dirroot.'/cohort/lib.php');
28
require_once($CFG->dirroot.'/cohort/edit_form.php');
28
require_once($CFG->dirroot.'/cohort/edit_form.php');
Línea 29... Línea 29...
29
 
29
 
30
$id        = optional_param('id', 0, PARAM_INT);
30
$id        = optional_param('id', 0, PARAM_INT);
31
$contextid = optional_param('contextid', 0, PARAM_INT);
-
 
32
$delete    = optional_param('delete', 0, PARAM_BOOL);
31
$contextid = optional_param('contextid', 0, PARAM_INT);
33
$show      = optional_param('show', 0, PARAM_BOOL);
32
$show      = optional_param('show', 0, PARAM_BOOL);
34
$hide      = optional_param('hide', 0, PARAM_BOOL);
-
 
35
$confirm   = optional_param('confirm', 0, PARAM_BOOL);
33
$hide      = optional_param('hide', 0, PARAM_BOOL);
Línea 36... Línea 34...
36
$returnurl = optional_param('returnurl', '', PARAM_LOCALURL);
34
$returnurl = optional_param('returnurl', '', PARAM_LOCALURL);
Línea 37... Línea 35...
37
 
35
 
Línea 84... Línea 82...
84
} else {
82
} else {
85
    navigation_node::override_active_url(new moodle_url('/cohort/index.php', array()));
83
    navigation_node::override_active_url(new moodle_url('/cohort/index.php', array()));
86
    $PAGE->set_heading($COURSE->fullname);
84
    $PAGE->set_heading($COURSE->fullname);
87
}
85
}
Línea 88... Línea -...
88
 
-
 
89
if ($delete and $cohort->id) {
-
 
90
    $PAGE->url->param('delete', 1);
-
 
91
    if ($confirm and confirm_sesskey()) {
-
 
92
        cohort_delete_cohort($cohort);
-
 
93
        redirect($returnurl);
-
 
94
    }
-
 
95
    $strheading = get_string('delcohort', 'cohort');
-
 
96
    $PAGE->navbar->add($strheading);
-
 
97
    $PAGE->set_title($strheading);
-
 
98
    echo $OUTPUT->header();
-
 
99
    echo $OUTPUT->heading($strheading);
-
 
100
    $yesurl = new moodle_url('/cohort/edit.php', array('id' => $cohort->id, 'delete' => 1,
-
 
101
        'confirm' => 1, 'sesskey' => sesskey(), 'returnurl' => $returnurl->out_as_local_url()));
-
 
102
    $message = get_string('delconfirm', 'cohort', format_string($cohort->name));
-
 
103
    echo $OUTPUT->confirm($message, $yesurl, $returnurl);
-
 
104
    echo $OUTPUT->footer();
-
 
105
    die;
-
 
106
}
-
 
107
 
86
 
108
if ($show && $cohort->id && confirm_sesskey()) {
87
if ($show && $cohort->id && confirm_sesskey()) {
109
    if (!$cohort->visible) {
88
    if (!$cohort->visible) {
110
        $record = (object)array('id' => $cohort->id, 'visible' => 1, 'contextid' => $cohort->contextid);
89
        $record = (object)array('id' => $cohort->id, 'visible' => 1, 'contextid' => $cohort->contextid);
111
        cohort_update_cohort($record);
90
        cohort_update_cohort($record);