MDL-21198 used new simple_button class when doing OUTPUT->confirm() - more consistent and hopefully easier to remember than html_form::make_button() ;-)

This commit is contained in:
Petr Skoda
2010-01-03 20:47:13 +00:00
parent 26eab8d4f5
commit dc6896efe0
24 changed files with 53 additions and 53 deletions
+4 -4
View File
@@ -23,8 +23,8 @@
if (empty($sure)) {
$optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey());
$formcontinue = html_form::make_button('delete.php', $optionsyes, get_string('yes'));
$formcancel = html_form::make_button('index.php', null, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url('delete.php', $optionsyes), get_string('yes'));
$formcancel = new single_button('index.php', get_string('no'), 'get');
echo $OUTPUT->confirm('Are you completely sure you want to delete everything inside the directory '. $deletedir .' ?', $formcontinue, $formcancel);
echo $OUTPUT->footer();
exit;
@@ -32,8 +32,8 @@
if (!data_submitted() or empty($reallysure)) {
$optionsyes = array('sure'=>'yes', 'sesskey'=>sesskey(), 'reallysure'=>'yes');
$formcontinue = html_form::make_button('delete.php', $optionsyes, get_string('yes'));
$formcancel = html_form::make_button('index.php', null, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url('delete.php', $optionsyes), get_string('yes'));
$formcancel = new signle_button('index.php', get_string('no'), 'get');
echo $OUTPUT->confirm('Are you REALLY REALLY completely sure you want to delete everything inside the directory '.
$deletedir .' (this includes all user images, and any other course files that have been created) ?',
$formcontinue, $formcancel);
+1 -1
View File
@@ -122,7 +122,7 @@
echo $OUTPUT->heading($title);
$linkcontinue = new moodle_url($returnurl, array('action' => 'delete', 'filterpath' => $filterpath, 'confirm' => 1));
$formcancel = html_form::make_button($returnurl, null, get_string('no'), 'get');
$formcancel = new single_button($returnurl, get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('deletefilterareyousuremessage', 'admin', $filtername), $linkcontinue, $formcancel);
echo $OUTPUT->footer();
exit;
+2 -2
View File
@@ -36,8 +36,8 @@
} else {
$optionsyes = array('confirm'=>'1', 'sesskey'=>sesskey());
$formcontinue = html_form::make_button('innodb.php', $optionsyes, get_string('yes'));
$formcancel = html_form::make_button('index.php', null, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url('innodb.php', $optionsyes), get_string('yes'));
$formcancel = new single_button('index.php', get_string('no'), 'get');
echo $OUTPUT->confirm('Are you sure you want convert all your tables to the InnoDB format?', $formcontinue, $formcancel);
echo $OUTPUT->footer();
}
+2 -2
View File
@@ -45,8 +45,8 @@
$MNET->get_private_key();
$SESSION->mnet_confirm_delete_key = md5(sha1($MNET->keypair['keypair_PEM'])).':'.time();
$formcontinue = html_form::make_button('index.php', array('confirm' => md5($MNET->public_key)), get_string('yes'));
$formcancel = html_form::make_button('index.php', null, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url('index.php', array('confirm' => md5($MNET->public_key))), get_string('yes'));
$formcancel = new single_button('index.php', get_string('no'), 'get');
echo $OUTPUT->confirm(get_string("deletekeycheck", "mnet"), $formcontinue, $formcancel);
exit;
} else {
+4 -4
View File
@@ -90,8 +90,8 @@
$a->shortname = $roles[$roleid]->shortname;
$a->count = $DB->count_records('role_assignments', array('roleid'=>$roleid));
$formcontinue = html_form::make_button($baseurl, array('confirm' => 1, 'msg' => $msg), get_string('yes'));
$formcancel = html_form::make_button($baseurl, $optionsno, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url($baseurl, $optionsyes), get_string('yes'));
$formcancel = new single_button($baseurl, get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('deleterolesure', 'role', $a), $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
@@ -172,8 +172,8 @@
} else {
$warning = get_string('resetrolesure', 'role', $a);
}
$formcontinue = html_form::make_button('manage.php', array('confirm' => 1, 'msg' => $msg), get_string('yes'));
$formcancel = html_form::make_button('manage.php', $optionsno, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url('manage.php', $optionsyes), get_string('yes'));
$formcancel = new single_button(new moodle_url('manage.php', $optionsno), get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('confirmmessage', 'bulkusers', $usernames), $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
+2 -2
View File
@@ -44,8 +44,8 @@ if ($confirm and confirm_sesskey()) {
$userlist = $DB->get_records_select_menu('user', "id $in", $params, 'fullname', 'id,'.$DB->sql_fullname().' AS fullname');
$usernames = implode(', ', $userlist);
echo $OUTPUT->heading(get_string('confirmation', 'admin'));
$formcontinue = html_form::make_button('user_bulk_confirm.php', array('confirm' => 1), get_string('yes'));
$formcancel = html_form::make_button('user_bulk.php', $optionsno, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url('user_bulk_confirm.php', array('confirm' => 1)), get_string('yes'));
$formcancel = new single_button('user_bulk.php', get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('confirmcheckfull', '', $usernames), $formcontinue, $formcancel);
}
+2 -2
View File
@@ -44,8 +44,8 @@ if ($confirm and confirm_sesskey()) {
$userlist = $DB->get_records_select_menu('user', "id $in", $params, 'fullname', 'id,'.$DB->sql_fullname().' AS fullname');
$usernames = implode(', ', $userlist);
echo $OUTPUT->heading(get_string('confirmation', 'admin'));
$formcontinue = html_form::make_button('user_bulk_delete.php', array('confirm' => 1), get_string('yes'));
$formcancel = html_form::make_button('user_bulk.php', $optionsno, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url('user_bulk_delete.php', array('confirm' => 1)), get_string('yes'));
$formcancel = new single_button('user_bulk.php', get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('deletecheckfull', '', $usernames), $formcontinue, $formcancel);
}
+2 -2
View File
@@ -60,8 +60,8 @@ if ($confirm and confirm_sesskey()) {
$usernames .= ', ...';
}
echo $OUTPUT->heading(get_string('confirmation', 'admin'));
$formcontinue = html_form::make_button('user_bulk_forcepasswordchange.php', array('confirm' => 1), get_string('yes'));
$formcancel = html_form::make_button('user_bulk.php', array(), get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url('user_bulk_forcepasswordchange.php', array('confirm' => 1)), get_string('yes'));
$formcancel = new single_button('user_bulk.php', get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('forcepasswordchangecheckfull', '', $usernames), $formcontinue, $formcancel);
}
+2 -2
View File
@@ -59,8 +59,8 @@ if ($msgform->is_cancelled()) {
echo $OUTPUT->heading(get_string('confirmation', 'admin'));
echo $OUTPUT->box($msg, 'boxwidthnarrow boxaligncenter generalbox', 'preview');
$formcontinue = html_form::make_button('user_bulk_message.php', array('confirm' => 1, 'msg' => $msg), get_string('yes'));
$formcancel = html_form::make_button('user_bulk.php', $optionsno, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url('user_bulk_message.php', array('confirm' => 1, 'msg' => $msg)), get_string('yes'));
$formcancel = new single_button('user_bulk.php', get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('confirmmessage', 'bulkusers', $usernames), $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
+2 -2
View File
@@ -48,8 +48,8 @@ if ($action == 'delete' and confirm_sesskey() and $service and empty($service->c
admin_externalpage_print_header();
$optionsyes = array('id'=>$id, 'action'=>'delete', 'confirm'=>1, 'sesskey'=>sesskey());
$optionsno = array('section'=>'externalservices');
$formcontinue = html_form::make_button('service.php', $optionsyes, get_string('delete'), 'post');
$formcancel = html_form::make_button("$CFG->wwwroot/$CFG->admin/settings.php", $optionsno, get_string('cancel'), 'get');
$formcontinue = new single_button(new moodle_url('service.php', $optionsyes), get_string('delete'), 'post');
$formcancel = new single_button(new moodle_url("$CFG->wwwroot/$CFG->admin/settings.php", $optionsno), get_string('cancel'), 'get');
echo $OUTPUT->confirm(get_string('deleteserviceconfirm', 'webservice', $service->name), $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
+2 -2
View File
@@ -48,8 +48,8 @@ if ($action === 'delete' and confirm_sesskey() and $service and empty($service->
admin_externalpage_print_header();
$optionsyes = array('id'=>$id, 'action'=>'delete', 'confirm'=>1, 'sesskey'=>sesskey(), 'fid'=>$function->id);
$optionsno = array('id'=>$id);
$formcontinue = html_form::make_button('service_functions.php', $optionsyes, get_string('delete'), 'post');
$formcancel = html_form::make_button('service_functions.php', $optionsno, get_string('cancel'), 'get');
$formcontinue = new single_button(new moodle_url('service_functions.php', $optionsyes), get_string('delete'));
$formcancel = new single_button(new moodle_url('service_functions.php', $optionsno), get_string('cancel'), 'get');
echo $OUTPUT->confirm(get_string('removefunctionconfirm', 'webservice', (object)array('service'=>$service->name, 'function'=>$function->name)), $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
+2 -2
View File
@@ -112,8 +112,8 @@ if (!empty($add)) {
// print_simple_box_start('center', '60%', '#FFAAAA', 20, 'noticebox');
echo $OUTPUT->box_start('noticebox');
$formcontinue = html_form::make_button("$CFG->wwwroot/course/mod.php", $optionsyes, get_string('yes'));
$formcancel = html_form::make_button($return, $optionsno, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url("$CFG->wwwroot/course/mod.php", $optionsyes), get_string('yes'));
$formcancel = new single_button(new moodle_url($return, $optionsno), get_string('no'), 'get');
echo $OUTPUT->confirm($strdeletecheckfull, $formcontinue, $formcancel);
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
+2 -2
View File
@@ -164,8 +164,8 @@ switch ($action) {
$strdeletecheckfull = get_string('deletecheck', '', $object->get_name());
$optionsyes = array('eid'=>$eid, 'confirm'=>1, 'sesskey'=>sesskey(), 'id'=>$course->id, 'action'=>'delete');
$optionsno = array('id'=>$course->id);
$formcontinue = html_form::make_button('index.php', $optionsyes, get_string('yes'));
$formcancel = html_form::make_button('index.php', $optionsno, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url('index.php', $optionsyes), get_string('yes'));
$formcancel = new signle_button(new moodle_url('index.php', $optionsno), get_string('no'), 'get');
echo $OUTPUT->confirm($strdeletecheckfull, $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
+2 -2
View File
@@ -76,8 +76,8 @@ if ($id and $delete) {
echo $OUTPUT->header();
$optionsyes = array('id'=>$id, 'delete'=>1, 'courseid'=>$courseid, 'sesskey'=>sesskey(), 'confirm'=>1);
$optionsno = array('id'=>$courseid);
$formcontinue = html_form::make_button('key.php', $optionsyes, get_string('yes'), 'get');
$formcancel = html_form::make_button('keymanager.php', $optionsno, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url('key.php', $optionsyes), get_string('yes'), 'get');
$formcancel = new single_button(new moodle_url('keymanager.php', $optionsno), get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('deletekeyconfirm', 'userkey', $key->value), $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
+2 -2
View File
@@ -76,8 +76,8 @@ if ($id and $delete) {
echo $OUTPUT->header();
$optionsyes = array('id'=>$id, 'delete'=>1, 'courseid'=>$courseid, 'sesskey'=>sesskey(), 'confirm'=>1);
$optionsno = array('id'=>$courseid);
$formcontinue = html_form::make_button('key.php', $optionsyes, get_string('yes'), 'get');
$formcancel = html_form::make_button('keymanager.php', $optionsno, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url('key.php', $optionsyes), get_string('yes'), 'get');
$formcancel = new single_button(new moodle_url('keymanager.php', $optionsno), get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('deletekeyconfirm', 'userkey', $key->value), $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
+2 -2
View File
@@ -70,8 +70,8 @@ if ($confirm && data_submitted()) {
}
$message.='</ul>';
}
$formcontinue = html_form::make_button('delete.php', $optionsyes, get_string('yes'), 'post');
$formcancel = html_form::make_button('index.php', $optionsno, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url('delete.php', $optionsyes), get_string('yes'), 'post');
$formcancel = new single_button(new moodle_url('index.php', $optionsno), get_string('no'), 'get');
echo $OUTPUT->confirm($message, $formcontinue, $formcancel);
echo $OUTPUT->footer();
}
+2 -2
View File
@@ -67,8 +67,8 @@ if ($id and $delete) {
echo $OUTPUT->header();
$optionsyes = array('id'=>$id, 'delete'=>1, 'courseid'=>$courseid, 'sesskey'=>sesskey(), 'confirm'=>1);
$optionsno = array('id'=>$courseid);
$formcontinue = html_form::make_button('group.php', $optionsyes, get_string('yes'), 'get');
$formcancel = html_form::make_button($baseurl, $optionsno, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url('group.php', $optionsyes), get_string('yes'), 'get');
$formcancel = new single_button(new moodle_url($baseurl, $optionsno), get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('deletegroupconfirm', 'group', $group->name), $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
+2 -2
View File
@@ -62,8 +62,8 @@ if ($id and $delete) {
echo $OUTPUT->header();
$optionsyes = array('id'=>$id, 'delete'=>1, 'courseid'=>$courseid, 'sesskey'=>sesskey(), 'confirm'=>1);
$optionsno = array('id'=>$courseid);
$formcontinue = html_form::make_button('grouping.php', $optionsyes, get_string('yes'), 'get');
$formcancel = html_form::make_button('groupings.php', $optionsno, get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url('grouping.php', $optionsyes), get_string('yes'), 'get');
$formcancel = new single_button(new moodle_url('groupings.php', $optionsno), get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('deletegroupingconfirm', 'group', $grouping->name), $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
+1 -1
View File
@@ -92,7 +92,7 @@ class lesson_page_type_branchtable extends lesson_page {
$params['pageid'] = $this->properties->id;
$params['sesskey'] = sesskey();
$params['jumpto'] = $answer->jumpto;
$buttons[] = $renderer->button(html_form::make_button($CFG->wwwroot.'/mod/lesson/continue.php', $params, strip_tags(format_text($answer->answer, FORMAT_MOODLE, $options))));
$buttons[] = $renderer->button(new single_button(new moodle_url($CFG->wwwroot.'/mod/lesson/continue.php', $params), strip_tags(format_text($answer->answer, FORMAT_MOODLE, $options))));
$i++;
}
// Set the orientation
+3 -3
View File
@@ -218,10 +218,10 @@ if (empty($pageid)) {
echo $lessonoutput->header($lesson, $cm);
if ($lesson->timed) {
if ($lesson->retake) {
$continuelink = html_form::make_button($CFG->wwwroot.'/mod/lesson/view.php', array('id'=>$cm->id, 'pageid'=>$lesson->firstpageid, 'startlastseen'=>'no'), get_string('continue', 'lesson'), 'get');
$continuelink = new single_button(new moodle_url($CFG->wwwroot.'/mod/lesson/view.php', array('id'=>$cm->id, 'pageid'=>$lesson->firstpageid, 'startlastseen'=>'no')), get_string('continue', 'lesson'), 'get');
echo $lessonoutput->message(get_string('leftduringtimed', 'lesson'), $continuelink);
} else {
$courselink = html_form::make_button($CFG->wwwroot.'/course/view.php', array('id'=>$PAGE->course->id), get_string('returntocourse', 'lesson'), 'get');
$courselink = new single_button(new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$PAGE->course->id)), get_string('returntocourse', 'lesson'), 'get');
echo $lessonoutput->message(get_string('leftduringtimednoretake', 'lesson'), $courselink);
}
} else {
@@ -234,7 +234,7 @@ if (empty($pageid)) {
if ($attemptflag) {
if (!$lesson->retake) {
echo $lessonoutput->header($lesson, $cm, 'view');
$courselink = html_form::make_button($CFG->wwwroot.'/course/view.php', array('id'=>$PAGE->course->id), get_string('returntocourse', 'lesson'), 'get');
$courselink = new single_button(new moodle_url($CFG->wwwroot.'/course/view.php', array('id'=>$PAGE->course->id)), get_string('returntocourse', 'lesson'), 'get');
echo $lessonoutput->message(get_string("noretake", "lesson"), $courselink);
echo $lessonoutput->footer();
exit();
+2 -2
View File
@@ -94,8 +94,8 @@ if (!empty($dataid)) {
} else {
$exporter->print_header('confirmcancel');
echo $OUTPUT->box_start();
$yesbutton = html_form::make_button($CFG->wwwroot . '/portfolio/add.php', array('id' => $dataid, 'cancel' => 1, 'cancelsure' => 1, 'logreturn' => $logreturn));
$nobutton = html_form::make_button($CFG->wwwroot . '/portfolio/add.php', array('id' => $dataid), get_string('no'));
$yesbutton = new single_button(new moodle_url($CFG->wwwroot . '/portfolio/add.php', array('id' => $dataid, 'cancel' => 1, 'cancelsure' => 1, 'logreturn' => $logreturn)). get_string('yes'));
$nobutton = new single_button(new moodle_url($CFG->wwwroot . '/portfolio/add.php', array('id' => $dataid)), get_string('no'));
if ($logreturn) {
$nobutton->url = $CFG->wwwroot . '/user/portfoliologs.php';
}
+2 -2
View File
@@ -220,8 +220,8 @@ if (!empty($edit) || !empty($new)) {
}
exit;
}
$formcontinue = html_form::make_button($baseurl, array('delete' => $delete, 'sure' => 'yes'), get_string('yes'));
$formcancel = html_form::make_button($baseurl, array(), get_string('no'));
$formcontinue = new single_button(new moodle_url($baseurl, array('delete' => $delete, 'sure' => 'yes')), get_string('yes'));
$formcancel = new single_button($baseurl, get_string('no'));
echo $OUTPUT->confirm(get_string('confirmdelete', 'repository', $instance->name), $formcontinue, $formcancel);
$return = false;
} else {
+2 -2
View File
@@ -81,8 +81,8 @@ echo '<object id="policyframe" data="'.$CFG->sitepolicy.'" type="'.$mimetype.'">
echo '<a href="'.$CFG->sitepolicy.'" onclick="this.target=\'_blank\'">'.$strpolicyagreementclick.'</a>';
echo '</object></div>';
$formcontinue = html_form::make_button('policy.php', array('agree'=>1), get_string('yes'));
$formcancel = html_form::make_button($CFG->wwwroot.'/login/logout.php', array(), get_string('no'));
$formcontinue = new single_button(new moodle_url('policy.php', array('agree'=>1)), get_string('yes'));
$formcancel = new single_button($CFG->wwwroot.'/login/logout.php', get_string('no'));
echo $OUTPUT->confirm($strpolicyagree, $formcontinue, $formcancel);
echo $OUTPUT->footer();
+4 -4
View File
@@ -54,8 +54,8 @@ switch ($action) {
admin_externalpage_print_header();
echo $OUTPUT->heading('profiledeletecategory', 'admin');
$formcontinue = html_form::make_button($redirect, $optionsyes, get_string('yes'), 'post');
$formcancel = html_form::make_button($redirect, array(), get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url($redirect, $optionsyes), get_string('yes'), 'post');
$formcancel = new single_button($redirect, get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('profileconfirmcategorydeletion', 'admin', $fieldcount), $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;
@@ -76,8 +76,8 @@ switch ($action) {
$PAGE->navbar->add($strheading);
admin_externalpage_print_header();
echo $OUTPUT->heading($strheading);
$formcontinue = html_form::make_button($redirect, $optionsyes, get_string('yes'), 'post');
$formcancel = html_form::make_button($redirect, array(), get_string('no'), 'get');
$formcontinue = new single_button(new moodle_url($redirect, $optionsyes), get_string('yes'), 'post');
$formcancel = new single_button($redirect, get_string('no'), 'get');
echo $OUTPUT->confirm(get_string('profileconfirmfielddeletion', 'admin', $datacount), $formcontinue, $formcancel);
echo $OUTPUT->footer();
die;