From dc6896efe08aa25ea0b937b6c67a716b9fd4ce84 Mon Sep 17 00:00:00 2001 From: Petr Skoda Date: Sun, 3 Jan 2010 20:47:13 +0000 Subject: [PATCH] MDL-21198 used new simple_button class when doing OUTPUT->confirm() - more consistent and hopefully easier to remember than html_form::make_button() ;-) --- admin/delete.php | 8 ++++---- admin/filters.php | 2 +- admin/innodb.php | 4 ++-- admin/mnet/index.php | 4 ++-- admin/roles/manage.php | 8 ++++---- admin/user/user_bulk_confirm.php | 4 ++-- admin/user/user_bulk_delete.php | 4 ++-- admin/user/user_bulk_forcepasswordchange.php | 4 ++-- admin/user/user_bulk_message.php | 4 ++-- admin/webservice/service.php | 4 ++-- admin/webservice/service_functions.php | 4 ++-- course/mod.php | 4 ++-- grade/edit/tree/index.php | 4 ++-- grade/export/key.php | 4 ++-- grade/import/key.php | 4 ++-- group/delete.php | 4 ++-- group/group.php | 4 ++-- group/grouping.php | 4 ++-- mod/lesson/pagetypes/branchtable.php | 2 +- mod/lesson/view.php | 6 +++--- portfolio/add.php | 4 ++-- repository/manage_instances.php | 4 ++-- user/policy.php | 4 ++-- user/profile/index.php | 8 ++++---- 24 files changed, 53 insertions(+), 53 deletions(-) diff --git a/admin/delete.php b/admin/delete.php index d025c8b841..6f7f86d341 100644 --- a/admin/delete.php +++ b/admin/delete.php @@ -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); diff --git a/admin/filters.php b/admin/filters.php index 4cd4486714..aee822176d 100644 --- a/admin/filters.php +++ b/admin/filters.php @@ -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; diff --git a/admin/innodb.php b/admin/innodb.php index c1dda3c672..5715641c5d 100644 --- a/admin/innodb.php +++ b/admin/innodb.php @@ -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(); } diff --git a/admin/mnet/index.php b/admin/mnet/index.php index 32378c864a..2dc12e35a6 100644 --- a/admin/mnet/index.php +++ b/admin/mnet/index.php @@ -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 { diff --git a/admin/roles/manage.php b/admin/roles/manage.php index ed160fae53..1aeaf6130d 100755 --- a/admin/roles/manage.php +++ b/admin/roles/manage.php @@ -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; diff --git a/admin/user/user_bulk_confirm.php b/admin/user/user_bulk_confirm.php index f6603a05b1..a129b85953 100755 --- a/admin/user/user_bulk_confirm.php +++ b/admin/user/user_bulk_confirm.php @@ -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); } diff --git a/admin/user/user_bulk_delete.php b/admin/user/user_bulk_delete.php index 0b398668f5..a30b3fe179 100755 --- a/admin/user/user_bulk_delete.php +++ b/admin/user/user_bulk_delete.php @@ -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); } diff --git a/admin/user/user_bulk_forcepasswordchange.php b/admin/user/user_bulk_forcepasswordchange.php index e32e6169e1..9af2050b6c 100644 --- a/admin/user/user_bulk_forcepasswordchange.php +++ b/admin/user/user_bulk_forcepasswordchange.php @@ -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); } diff --git a/admin/user/user_bulk_message.php b/admin/user/user_bulk_message.php index 67819be736..21d8d7f459 100755 --- a/admin/user/user_bulk_message.php +++ b/admin/user/user_bulk_message.php @@ -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; diff --git a/admin/webservice/service.php b/admin/webservice/service.php index 5ce40846ea..8abde5c75f 100644 --- a/admin/webservice/service.php +++ b/admin/webservice/service.php @@ -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; diff --git a/admin/webservice/service_functions.php b/admin/webservice/service_functions.php index f2153a4f5e..9c20ee309d 100644 --- a/admin/webservice/service_functions.php +++ b/admin/webservice/service_functions.php @@ -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; diff --git a/course/mod.php b/course/mod.php index 2233f0b948..ef70af60e9 100644 --- a/course/mod.php +++ b/course/mod.php @@ -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(); diff --git a/grade/edit/tree/index.php b/grade/edit/tree/index.php index d3a6b389fd..d35bafad4b 100644 --- a/grade/edit/tree/index.php +++ b/grade/edit/tree/index.php @@ -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; diff --git a/grade/export/key.php b/grade/export/key.php index 962b3714f9..0bfc019660 100644 --- a/grade/export/key.php +++ b/grade/export/key.php @@ -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; diff --git a/grade/import/key.php b/grade/import/key.php index 93f3b35869..ddf135bc2b 100644 --- a/grade/import/key.php +++ b/grade/import/key.php @@ -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; diff --git a/group/delete.php b/group/delete.php index 7fa0ec66ec..c953e2cf56 100644 --- a/group/delete.php +++ b/group/delete.php @@ -70,8 +70,8 @@ if ($confirm && data_submitted()) { } $message.=''; } - $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(); } diff --git a/group/group.php b/group/group.php index 4e35548246..d8924ffe76 100644 --- a/group/group.php +++ b/group/group.php @@ -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; diff --git a/group/grouping.php b/group/grouping.php index 7890ab0049..e56d720c0d 100644 --- a/group/grouping.php +++ b/group/grouping.php @@ -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; diff --git a/mod/lesson/pagetypes/branchtable.php b/mod/lesson/pagetypes/branchtable.php index ce8d63a4b4..c059c75570 100644 --- a/mod/lesson/pagetypes/branchtable.php +++ b/mod/lesson/pagetypes/branchtable.php @@ -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 diff --git a/mod/lesson/view.php b/mod/lesson/view.php index 56830f66a4..fe21fa9562 100644 --- a/mod/lesson/view.php +++ b/mod/lesson/view.php @@ -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(); diff --git a/portfolio/add.php b/portfolio/add.php index e9a7f1b080..ec0c9293f0 100644 --- a/portfolio/add.php +++ b/portfolio/add.php @@ -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'; } diff --git a/repository/manage_instances.php b/repository/manage_instances.php index ac823dac0d..db1d5c9beb 100644 --- a/repository/manage_instances.php +++ b/repository/manage_instances.php @@ -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 { diff --git a/user/policy.php b/user/policy.php index 5a6b551523..1509d2313d 100644 --- a/user/policy.php +++ b/user/policy.php @@ -81,8 +81,8 @@ echo ' echo ''.$strpolicyagreementclick.''; echo ''; -$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(); diff --git a/user/profile/index.php b/user/profile/index.php index 6b5bdc5f4e..e6457fd723 100644 --- a/user/profile/index.php +++ b/user/profile/index.php @@ -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; -- 2.39.5