function get_delete_element_form($elemid) { global $CURMAN; $elemrecord = $CURMAN->db->get_record(CRSCOMPTABLE, 'id', $elemid); if (!$elemrecord) { error('Undefined completion element.'); } $crs = new course($elemrecord->courseid); $url = 'index.php'; $message = get_string('confirm_delete_completion', 'block_curr_admin', $elemrecord->idnumber); $optionsyes = array('s' => 'crs', 'section' => 'curr', 'action' => 'confirmdelem', 'id' => $crs->id, 'elemid' => $elemid, 'confirm' => md5($elemid)); $optionsno = array('s' => 'crs', 'section' => 'curr', 'id' => $crs->id, 'action' => 'lelem'); echo cm_delete_form($url, $message, $optionsyes, $optionsno); }
/** * Returns the delete instructor form. * * @param string $action Delete or confirm. * @param int $id The id of the instructor. * @return string HTML for the form. * */ function get_delete_form($insid) { $ins = new instructor($insid); $url = 'index.php'; $message = get_string('confirm_delete_instructor', 'block_curr_admin', cm_fullname($ins->user)); $optionsyes = array('s' => 'ins', 'section' => 'curr', 'id' => $ins->classid, 'action' => 'confirm', 'association_id' => $insid, 'confirm' => md5($insid)); $optionsno = array('s' => 'ins', 'section' => 'curr', 'id' => $ins->classid, 'search' => $ins->cmclass->idnumber); echo cm_delete_form($url, $message, $optionsyes, $optionsno); }
/** * Returns the delete student form. * * @param int $id The ID of the student. * @return string HTML for the form. * */ function print_delete_form($stu) { $url = 'index.php'; $message = get_string('student_deleteconfirm', 'block_curr_admin', cm_fullname($stu->user)); $optionsyes = array('s' => 'stu', 'section' => 'curr', 'id' => $stu->classid, 'action' => 'confirm', 'association_id' => $stu->id, 'confirm' => md5($stu->id)); $optionsno = array('s' => 'stu', 'section' => 'curr', 'id' => $stu->classid); echo cm_delete_form($url, $message, $optionsyes, $optionsno); }
function process_selection($data) { global $OUTPUT; $id = $this->required_param('id', PARAM_INT); if (empty($data->_selection)) { $tmppage = new waitlistpage(array('id' => $id)); print_error('no_items_selected', self::LANG_FILE, $tmppage->url); } else { $sparam = new stdClass(); $sparam->num = count($data->_selection); $sparam->action = $data->do; $msg = get_string('confirm_waitlist', self::LANG_FILE, $sparam); echo cm_delete_form('index.php', $msg, array('s' => $this->pagename, 'id' => $id, 'action' => $data->do, 'selected' => implode(',', $data->_selection)), array('s' => $this->pagename, 'id' => $id)); // TBD } }
function get_delete_element_form($elemid) { global $DB; $elemrecord = $DB->get_record(coursecompletion::TABLE, array('id' => $elemid)); if (!$elemrecord) { print_error('Undefined completion element.'); } $crs = new course($elemrecord->courseid); $url = 'index.php'; $message = get_string('confirm_delete_completion', 'local_elisprogram', $elemrecord->idnumber); $optionsyes = array('s' => 'crs', 'section' => 'curr', 'action' => 'confirmdelem', 'id' => $crs->id, 'elemid' => $elemid, 'confirm' => md5($elemid)); $optionsno = array('s' => 'crs', 'section' => 'curr', 'id' => $crs->id, 'action' => 'lelem'); echo cm_delete_form($url, $message, $optionsyes, $optionsno); }
/** * Returns the delete track class association form. * * @param int $id The id of the track class association record. * @return string HTML for the form. * */ function get_delete_form($id) { $trk = new trackassignmentclass($id); $url = 'index.php'; $a = new stdClass(); $a->name = $trk->track->name; $a->idnumber = $trk->course->idnumber; $message = get_string('confirm_delete_track_assignment', 'block_curr_admin', $a); $optionsyes = array('s' => 'trkcls', 'section' => 'curr', 'action' => 'confirm', 'id' => $trk->id, 'trackid' => $trk->trackid, 'confirm' => md5($trk->id)); $optionsno = array('s' => 'trkcls', 'section' => 'curr'); $bc = '<span class="breadcrumb"><a href="index.php?s=trkcls&search=' . urlencode($trk->course->name) . '&trackid=' . $trk->trackid . '">' . get_string('trackasso_genericmanage_crumb', 'block_curr_admin') . '</a> ' . '» ' . get_string('trackasso_delete', 'block_curr_admin', $trk->track->name) . '"</span>'; echo cm_print_heading_block($bc, '', true); echo '<br />' . "\n"; echo cm_delete_form($url, $message, $optionsyes, $optionsno); }
/** * Prints a deletion confirmation form. * @param $obj record whose deletion is being confirmed */ function print_delete_form($obj) { $url = 'index.php'; $a = new object(); $a->object_name = $obj->to_string(); $a->type_name = $obj->get_verbose_name(); $a->id = $obj->id; $message = get_string('confirm_delete', 'block_curr_admin', $a); $optionsyes = array('s' => $this->pagename, 'action' => 'confirm', 'id' => $obj->id, 'confirm' => md5($obj->id)); $optionsno = array('s' => $this->pagename); echo cm_delete_form($url, $message, $optionsyes, $optionsno); }
/** * Prints the delete confirmation form. * @param $obj Basic data object being associated with. */ function print_delete_form($obj) { $id = required_param('id', PARAM_INT); $a_id = required_param('association_id', PARAM_INT); $url = 'index.php'; $a = new object(); //$a->object_name = $obj->to_string(); //$a->type_name = $obj->get_verbose_name(); $a->id = $a_id; $message = get_string('confirm_delete_association', 'block_curr_admin', $a); $optionsyes = array('s' => $this->pagename, 'action' => 'confirm', 'association_id' => $a_id, 'id' => $id, 'confirm' => md5($a_id)); $optionsno = array('s' => $this->pagename, 'id' => $id); echo '<br />' . "\n"; echo cm_delete_form($url, $message, $optionsyes, $optionsno); }