$newgrade = optional_param('newgrade', 0, PARAM_INT); $att->add_status($newacronym, $newdescription, $newgrade); break; case local_att_preferences_page_params::ACTION_DELETE: if (local_att_has_logs_for_status($att->pageparams->statusid)) { print_error('cantdeletestatus', 'local_attendance', "attsettings.php?id=$id"); } $confirm = optional_param('confirm', null, PARAM_INT); if (isset($confirm)) { $att->remove_status($att->pageparams->statusid); redirect($att->url_preferences(), get_string('statusdeleted', 'local_attendance')); } $statuses = $att->get_statuses(); $status = $statuses[$att->pageparams->statusid]; $message = get_string('deletecheckfull', '', get_string('variable', 'local_attendance')); $message .= str_repeat(html_writer::empty_tag('br'), 2); $message .= $status->acronym.': '. ($status->description ? $status->description : get_string('nodescription', 'local_attendance')); $params = array_merge($att->pageparams->get_significant_params(), array('confirm' => 1)); echo $OUTPUT->header(); echo $OUTPUT->heading(get_string('attendanceforthecourse', 'local_attendance').' :: ' .$course->fullname); echo $OUTPUT->confirm($message, $att->url_preferences($params), $att->url_preferences()); echo $OUTPUT->footer(); exit; case local_att_preferences_page_params::ACTION_HIDE: $att->update_status($att->pageparams->statusid, null, null, null, 0); break; case local_att_preferences_page_params::ACTION_SHOW:
public function __construct(local_attendance $att) { $this->statuses = $att->get_statuses(false); foreach ($this->statuses as $st) { $st->haslogs = local_att_has_logs_for_status($st->id); } $this->att = $att; }