Proyectos de Subversion Moodle

Rev

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

Rev 1 Rev 1441
Línea 223... Línea 223...
223
 
223
 
224
if ($mode == 'asearch') {
224
if ($mode == 'asearch') {
225
    $PAGE->navbar->add(get_string('search'));
225
    $PAGE->navbar->add(get_string('search'));
Línea 226... Línea 226...
226
}
226
}
227
 
227
 
228
$PAGE->add_body_class('mediumwidth');
228
$PAGE->add_body_class('limitedwidth');
229
$titleparts = [
229
$titleparts = [
230
    format_string($data->name),
230
    format_string($data->name),
231
    format_string($course->fullname),
231
    format_string($course->fullname),
Línea 241... Línea 241...
241
    array_unshift($titleparts, get_string('single', 'data'));
241
    array_unshift($titleparts, get_string('single', 'data'));
242
}
242
}
243
$PAGE->set_title(implode(moodle_page::TITLE_SEPARATOR, $titleparts));
243
$PAGE->set_title(implode(moodle_page::TITLE_SEPARATOR, $titleparts));
244
$PAGE->set_heading($course->fullname);
244
$PAGE->set_heading($course->fullname);
245
$PAGE->force_settings_menu(true);
245
$PAGE->force_settings_menu(true);
246
if ($delete && confirm_sesskey() && (data_user_can_manage_entry($delete, $data, $context))) {
246
if ($delete && data_user_can_manage_entry($delete, $data, $context)) {
247
    $PAGE->activityheader->disable();
247
    $PAGE->activityheader->disable();
248
}
248
}
Línea 249... Línea 249...
249
 
249
 
250
// Check to see if groups are being used here.
250
// Check to see if groups are being used here.
Línea 282... Línea 282...
282
    $options->noclean = true;
282
    $options->noclean = true;
283
}
283
}
Línea 284... Línea 284...
284
 
284
 
Línea 285... Línea 285...
285
/// Delete any requested records
285
/// Delete any requested records
286
 
286
 
-
 
287
if ($delete && data_user_can_manage_entry($delete, $data, $context)) {
-
 
288
    if ($confirm) {
287
if ($delete && confirm_sesskey() && (data_user_can_manage_entry($delete, $data, $context))) {
289
        require_sesskey();
288
    if ($confirm) {
290
 
289
        if (data_delete_record($delete, $data, $course->id, $cm->id)) {
291
        if (data_delete_record($delete, $data, $course->id, $cm->id)) {
290
            echo $OUTPUT->notification(get_string('recorddeleted','data'), 'notifysuccess');
292
            echo $OUTPUT->notification(get_string('recorddeleted','data'), 'notifysuccess');
291
        }
293
        }
Línea 322... Línea 324...
322
// Multi-delete.
324
// Multi-delete.
323
if ($serialdelete) {
325
if ($serialdelete) {
324
    $multidelete = json_decode($serialdelete);
326
    $multidelete = json_decode($serialdelete);
325
}
327
}
Línea 326... Línea 328...
326
 
328
 
327
if ($multidelete && confirm_sesskey() && $canmanageentries) {
329
if ($multidelete && $canmanageentries) {
-
 
330
    if ($confirm) {
-
 
331
        require_sesskey();
328
    if ($confirm = optional_param('confirm', 0, PARAM_INT)) {
332
 
329
        foreach ($multidelete as $value) {
333
        foreach ($multidelete as $value) {
330
            data_delete_record($value, $data, $course->id, $cm->id);
334
            data_delete_record($value, $data, $course->id, $cm->id);
331
        }
335
        }
332
    } else {
336
    } else {
Línea 371... Línea 375...
371
 
375
 
372
    } else {
376
    } else {
373
        // Approve or disapprove any requested records
377
        // Approve or disapprove any requested records
Línea 374... Línea 378...
374
        $approvecap = has_capability('mod/data:approve', $context);
378
        $approvecap = has_capability('mod/data:approve', $context);
-
 
379
 
375
 
380
        if (($approve || $disapprove) && $approvecap) {
376
        if (($approve || $disapprove) && confirm_sesskey() && $approvecap) {
381
            require_sesskey();
377
            $newapproved = $approve ? true : false;
382
            $newapproved = $approve ? true : false;
378
            $recordid = $newapproved ? $approve : $disapprove;
383
            $recordid = $newapproved ? $approve : $disapprove;
379
            if ($approverecord = $DB->get_record('data_records', array('id' => $recordid))) {   // Need to check this is valid
384
            if ($approverecord = $DB->get_record('data_records', array('id' => $recordid))) {   // Need to check this is valid