diff --git a/admin/mnet/mnet_themes.html b/admin/mnet/mnet_themes.html
index a18e4db05a0..d105458a2af 100644
--- a/admin/mnet/mnet_themes.html
+++ b/admin/mnet/mnet_themes.html
@@ -38,7 +38,7 @@ $original_theme = fullclone($THEME);
$options['choose'] = $unlikely_name;// Something unlikely to ever be a theme name... initially $unlikely_name = 'ZoqZoqZ';
$options['sesskey'] = $sesskey;
$options['hostid'] = $mnet_peer->id;
- echo $OUTPUT->button(html_form::make_button('mnet_themes.php', $options, $strchoose));
+ echo $OUTPUT->single_button(new moodle_url('mnet_themes.php', $options), $strchoose);
echo '';
echo "";
@@ -111,7 +111,7 @@ $original_theme = fullclone($THEME);
$options['choose'] = $theme;
$options['sesskey'] = $sesskey;
$options['hostid'] = $mnet_peer->id;
- echo $OUTPUT->button(html_form::make_button('mnet_themes.php', $options, $strchoose));
+ echo $OUTPUT->single_button(new moodle_url('mnet_themes.php', $options), $strchoose);
echo '';
echo "";
}
diff --git a/admin/roles/define.php b/admin/roles/define.php
index ec8c49f854d..65f6911b67f 100755
--- a/admin/roles/define.php
+++ b/admin/roles/define.php
@@ -135,16 +135,16 @@
$options = array();
$options['roleid'] = $roleid;
$options['action'] = 'edit';
- echo $OUTPUT->button(html_form::make_button($defineurl, $options, get_string('edit')));
+ echo $OUTPUT->single_button(new moodle_url($defineurl, $options), get_string('edit'));
$options['action'] = 'reset';
if ($definitiontable->get_legacy_type()) {
- echo $OUTPUT->button(html_form::make_button($manageurl, $options, get_string('resetrole', 'role')));
+ echo $OUTPUT->single_button(new moodle_url($manageurl, $options), get_string('resetrole', 'role'));
} else {
- echo $OUTPUT->button(html_form::make_button($manageurl, $options, get_string('resetrolenolegacy', 'role')));
+ echo $OUTPUT->single_button(new moodle_url($manageurl, $options), get_string('resetrolenolegacy', 'role'));
}
$options['action'] = 'duplicate';
- echo $OUTPUT->button(html_form::make_button($defineurl, $options, get_string('duplicaterole', 'role')));
- echo $OUTPUT->button(html_form::make_button($manageurl, null, get_string('listallroles', 'role')));
+ echo $OUTPUT->single_button(new moodle_url($defineurl, $options), get_string('duplicaterole', 'role'));
+ echo $OUTPUT->single_button(new moodle_url($manageurl), get_string('listallroles', 'role'));
echo $OUTPUT->container_end();
}
diff --git a/admin/roles/manage.php b/admin/roles/manage.php
index e13f9320a68..ed160fae539 100755
--- a/admin/roles/manage.php
+++ b/admin/roles/manage.php
@@ -265,7 +265,7 @@
echo $OUTPUT->table($table);
echo $OUTPUT->container_start('buttons');
- echo $OUTPUT->button(html_form::make_button($defineurl, array('action' => 'add'), get_string('addrole', 'role'), 'get'));
+ echo $OUTPUT->single_button(new moodle_url($defineurl, array('action' => 'add')), get_string('addrole', 'role'), 'get');
echo $OUTPUT->container_end();
echo $OUTPUT->footer();
diff --git a/admin/settings.php b/admin/settings.php
index cba9c55bade..c8a4bd6aea8 100644
--- a/admin/settings.php
+++ b/admin/settings.php
@@ -90,15 +90,15 @@ if (empty($SITE->fullname)) {
} else {
if ($PAGE->user_allowed_editing()) {
- $options = $PAGE->url->params();
+ $url = clone($PAGE->url);
if ($PAGE->user_is_editing()) {
$caption = get_string('blockseditoff');
- $options['adminedit'] = 'off';
+ $url->param('adminedit', 'off');
} else {
$caption = get_string('blocksediton');
- $options['adminedit'] = 'on';
+ $url->param('adminedit', 'on');
}
- $buttons = $OUTPUT->button(html_form::make_button($PAGE->url->out(), $options, $caption, 'get'));
+ $buttons = $OUTPUT->single_button($url, $caption, 'get');
}
$visiblepathtosection = array_reverse($settingspage->visiblepath);
diff --git a/admin/webservice/service_functions.php b/admin/webservice/service_functions.php
index ecce2ce7843..f2153a4f5ec 100644
--- a/admin/webservice/service_functions.php
+++ b/admin/webservice/service_functions.php
@@ -130,19 +130,13 @@ echo $OUTPUT->table($table);
// we can edit only custom functions, the build-in would be overridden after each upgrade
if (empty($service->component)) {
- $form = new html_form();
- $form->url = new moodle_url('service_functions.php', array('sesskey'=>sesskey(), 'id'=>$service->id, 'action'=>'add'));
- $form->button->text = get_string('add');
- $form->method = 'get';
- echo $OUTPUT->button($form);
+ $url = new moodle_url('service_functions.php', array('sesskey'=>sesskey(), 'id'=>$service->id, 'action'=>'add'));
+ echo $OUTPUT->single_button($url, get_string('add'), 'get');
}
// simple back button
-$form = new html_form();
-$form->url = new moodle_url('../settings.php', array('section'=>'externalservices'));
-$form->button->text = get_string('back');
-$form->method = 'get';
-echo $OUTPUT->button($form);
+$url = new moodle_url('../settings.php', array('section'=>'externalservices'));
+echo $OUTPUT->single_button($url, get_string('back'), 'get');
echo $OUTPUT->footer();
diff --git a/backup/restore_check.html b/backup/restore_check.html
index a97933def71..0d620004ab1 100644
--- a/backup/restore_check.html
+++ b/backup/restore_check.html
@@ -401,7 +401,7 @@
/// Restore button
- echo $OUTPUT->button(html_form::make_button("restore.php", $hidden, get_string("restorecoursenow")));
+ echo $OUTPUT->single_button(new moodle_url("restore.php", $hidden), get_string("restorecoursenow"));
}
echo "";
diff --git a/backup/restorelib.php b/backup/restorelib.php
index aac97521edc..d389d4aebb5 100644
--- a/backup/restorelib.php
+++ b/backup/restorelib.php
@@ -8296,7 +8296,7 @@ define('RESTORE_GROUPS_GROUPINGS', 3);
$hidden["launch"] = "form";
$hidden["file"] = $file;
$hidden["id"] = $id;
- echo $OUTPUT->button(html_form::make_button("restore.php", $hidden, get_string("continue")));
+ echo $OUTPUT->single_button(new moodle_url("restore.php", $hidden), get_string("continue"));
echo "";
}
else {
diff --git a/blocks/rss_client/managefeeds.php b/blocks/rss_client/managefeeds.php
index 650b41feb07..4a7f7580341 100644
--- a/blocks/rss_client/managefeeds.php
+++ b/blocks/rss_client/managefeeds.php
@@ -132,12 +132,8 @@ foreach($feeds as $feed) {
$table->print_html();
-$button = new html_form();
-$button->method = 'get';
-$button->url = $CFG->wwwroot . '/blocks/rss_client/editfeed.php?' . substr($extraparams, 1);
-$button->showbutton = true;
-$button->button->text = get_string('addnewfeed', 'block_rss_client');
-echo '
' . $OUTPUT->button($button) . '
';
+$url = $CFG->wwwroot . '/blocks/rss_client/editfeed.php?' . substr($extraparams, 1);
+echo '' . $OUTPUT->single_button($url, get_string('addnewfeed', 'block_rss_client'), 'get') . '
';
if ($returnurl) {
diff --git a/calendar/delete.php b/calendar/delete.php
index c92ed08db57..f8336ad0665 100644
--- a/calendar/delete.php
+++ b/calendar/delete.php
@@ -100,26 +100,19 @@ echo $OUTPUT->header();
echo $OUTPUT->box_start('eventlist');
// Delete this event button is always shown
-$deleteone = new html_form();
-$deleteone->button->text = get_string('delete');
-$deleteone->url = new moodle_url(CALENDAR_URL.'delete.php', array('id'=>$event->id, 'confirm'=>true));
-$buttons = $OUTPUT->button($deleteone);
+$url = new moodle_url(CALENDAR_URL.'delete.php', array('id'=>$event->id, 'confirm'=>true));
+$buttons = $OUTPUT->single_button($url, get_string('delete'));
// If there are repeated events then add a Delete Repeated button
$repeatspan = '';
if (!empty($event->eventrepeats) && $event->eventrepeats > 0) {
- $deleteall = new html_form();
- $deleteall->button->text = get_string('deleteall');
- $deleteall->url = new moodle_url(CALENDAR_URL.'delete.php', array('id'=>$event->repeatid, 'confirm'=>true, 'repeats'=>true));
- $buttons .= $OUTPUT->button($deleteall);
+ $url = new moodle_url(CALENDAR_URL.'delete.php', array('id'=>$event->repeatid, 'confirm'=>true, 'repeats'=>true));
+ $buttons .= $OUTPUT->single_button($url, get_string('deleteall'));
$repeatspan = '
'.$OUTPUT->span(get_string('youcandeleteallrepeats', 'calendar'));
}
// And add the cancel button
-$cancel = new html_form();
-$cancel->button->text = get_string('cancel');
-$cancel->url = $viewcalendarurl;
-$buttons .= $OUTPUT->button($cancel);
+$buttons .= $OUTPUT->single_button($viewcalendarurl, get_string('cancel'));
// And show the buttons and notes
echo $OUTPUT->box_start('generalbox', 'notice');
diff --git a/calendar/view.php b/calendar/view.php
index da79b2812fb..127b4f316d5 100644
--- a/calendar/view.php
+++ b/calendar/view.php
@@ -183,7 +183,7 @@ switch($view) {
//Link to calendar export page
echo $OUTPUT->container_start('bottom');
if (!empty($CFG->enablecalendarexport)) {
- echo $OUTPUT->button(html_form::make_button('export.php', array('course'=>$courseid), get_string('exportcalendar', 'calendar')));
+ echo $OUTPUT->single_button(new moodle_url('export.php', array('course'=>$courseid)), get_string('exportcalendar', 'calendar'));
if (!empty($USER->id)) {
$authtoken = sha1($USER->username . $USER->password . $CFG->calendar_exportsalt);
diff --git a/course/category.php b/course/category.php
index 37dcc6d75ec..f64e6d1b25f 100644
--- a/course/category.php
+++ b/course/category.php
@@ -207,11 +207,11 @@
// Print button to update this category
$options = array('id' => $category->id);
- echo $OUTPUT->button(html_form::make_button($CFG->wwwroot.'/course/editcategory.php', $options, get_string('editcategorythis'), 'get'));
+ echo $OUTPUT->single_button(new moodle_url($CFG->wwwroot.'/course/editcategory.php', $options), get_string('editcategorythis'), 'get');
// Print button for creating new categories
$options = array('parent' => $category->id);
- echo $OUTPUT->button(html_form::make_button($CFG->wwwroot.'/course/editcategory.php', $options, get_string('addsubcategory'), 'get'));
+ echo $OUTPUT->single_button(new moodle_url($CFG->wwwroot.'/course/editcategory.php', $options), get_string('addsubcategory'), 'get');
echo $OUTPUT->container_end();
}
@@ -451,14 +451,14 @@
$options['id'] = $category->id;
$options['resort'] = 'name';
$options['sesskey'] = sesskey();
- echo $OUTPUT->button(html_form::make_button('category.php', $options, get_string('resortcoursesbyname'), 'get'));
+ echo $OUTPUT->single_button(new moodle_url('category.php', $options), get_string('resortcoursesbyname'), 'get');
}
if (has_capability('moodle/course:create', $context)) {
/// Print button to create a new course
unset($options);
$options['category'] = $category->id;
- echo $OUTPUT->button(html_form::make_button('edit.php', $options, get_string('addnewcourse'), 'get'));
+ echo $OUTPUT->single_button(new moodle_url('edit.php', $options), get_string('addnewcourse'), 'get');
}
if (!empty($CFG->enablecourserequests) && $category->id == $CFG->enablecourserequests) {
diff --git a/course/index.php b/course/index.php
index 895feba4578..266cc207608 100644
--- a/course/index.php
+++ b/course/index.php
@@ -103,9 +103,7 @@ if (!$adminediting) {
/// Print link to create a new course
/// Get the 1st available category
$options = array('category' => $CFG->defaultrequestcategory);
- $form = html_form::make_button('edit.php', $options, get_string('addnewcourse'));
- $form->method = 'get';
- echo $OUTPUT->button($form);
+ echo $OUTPUT->single_button(new moodle_url('edit.php', $options), get_string('addnewcourse'), 'get');
}
print_course_request_buttons($systemcontext);
echo $OUTPUT->container_end();
@@ -265,20 +263,14 @@ echo '';
echo '';
if (has_capability('moodle/course:create', $systemcontext)) {
// print create course link to first category
- $options = array();
$options = array('category' => $CFG->defaultrequestcategory);
- $form = html_form::make_button('edit.php', $options, get_string('addnewcourse'));
- $form->method = 'get';
- echo $OUTPUT->button($form);
+ echo $OUTPUT->single_button(new moodle_url('edit.php', $options), get_string('addnewcourse'), 'get');
}
// Print button for creating new categories
if (has_capability('moodle/category:manage', $systemcontext)) {
- $options = array();
- $options['parent'] = 0;
- $form = html_form::make_button('editcategory.php', $options, get_string('addnewcategory'));
- $form->method = 'get';
- echo $OUTPUT->button($form);
+ $options = array('parent'=>0);
+ echo $OUTPUT->single_button(new moodle_url('editcategory.php', $options), get_string('addnewcategory'), 'get');
}
print_course_request_buttons($systemcontext);
diff --git a/course/lib.php b/course/lib.php
index 9c260cea5f1..a546bd09db4 100644
--- a/course/lib.php
+++ b/course/lib.php
@@ -2047,13 +2047,12 @@ function print_course_request_buttons($systemcontext) {
}
if (isloggedin() && !isguestuser() && !has_capability('moodle/course:create', $systemcontext) && has_capability('moodle/course:request', $systemcontext)) {
/// Print a button to request a new course
- echo $OUTPUT->button(html_form::make_button('request.php', NULL, get_string('requestcourse'), 'get'));
+ echo $OUTPUT->single_button('request.php', get_string('requestcourse'), 'get');
}
/// Print a button to manage pending requests
if (has_capability('moodle/site:approvecourse', $systemcontext)) {
- $form = html_form::make_button('pending.php', NULL, get_string('coursespending'), 'get');
- $form->button->disabled = !$DB->record_exists('course_request', array());
- echo $OUTPUT->button($form);
+ $disabled = !$DB->record_exists('course_request', array());
+ echo $OUTPUT->single_button('pending.php', get_string('coursespending'), 'get', array('disabled'=>$disabled));
}
}
@@ -2100,7 +2099,7 @@ function update_category_button($categoryid = 0) {
} else {
$page = 'index.php';
}
- return $OUTPUT->button(html_form::make_button($CFG->wwwroot . '/course/' . $page, $options, $label, 'get'));
+ return $OUTPUT->single_button(new moodle_url($CFG->wwwroot . '/course/' . $page, $options), $label, 'get');
}
/**
@@ -2146,7 +2145,7 @@ function print_courses($category) {
$options = array();
$options['category'] = $category->id;
echo '
';
- echo $OUTPUT->button(html_form::make_button($CFG->wwwroot.'/course/edit.php', $options, get_string("addnewcourse")));
+ echo $OUTPUT->single_button(new moodle_url($CFG->wwwroot.'/course/edit.php', $options), get_string("addnewcourse"));
echo '
';
}
}
@@ -2324,7 +2323,7 @@ function print_my_moodle() {
echo "
| ";
print_course_search("", false, "short");
echo " | ";
- echo $OUTPUT->button(html_form::make_button("$CFG->wwwroot/course/index.php", NULL, get_string("fulllistofcourses"), "get"));
+ echo $OUTPUT->single_button("$CFG->wwwroot/course/index.php", get_string("fulllistofcourses"), "get");
echo " |
\n";
}
diff --git a/course/pending.php b/course/pending.php
index 3a6ff80e4e8..38d03bdc3cf 100644
--- a/course/pending.php
+++ b/course/pending.php
@@ -106,7 +106,7 @@ if (empty($pending)) {
$strrequireskey = get_string('requireskey');
// Loop over requested courses.
- $keyicon = $OUTPUT->image('y/key', array('alt'=>$strrequireskey, 'class'=>'icon'));
+ $keyicon = $OUTPUT->image('i/key', array('alt'=>$strrequireskey, 'class'=>'icon'));
foreach ($pending as $course) {
$course = new course_request($course);
@@ -127,8 +127,8 @@ if (empty($pending)) {
$row[] = fullname($course->get_requester());
$row[] = $course->summary;
$row[] = format_string($course->reason);
- $row[] = $OUTPUT->button(html_form::make_button($baseurl, array('approve' => $course->id, 'sesskey' => sesskey()), get_string('approve'), 'get')) .
- $OUTPUT->button(html_form::make_button($baseurl, array('reject' => $course->id), get_string('rejectdots'), 'get'));
+ $row[] = $OUTPUT->single_button(new moodle_url($baseurl, array('approve' => $course->id, 'sesskey' => sesskey())), get_string('approve'), 'get') .
+ $OUTPUT->single_button(new moodle_url($baseurl, array('reject' => $course->id)), get_string('rejectdots'), 'get');
/// Add the row to the table.
$table->data[] = $row;
@@ -144,5 +144,5 @@ if (empty($pending)) {
}
/// Finish off the page.
-echo $OUTPUT->button(html_form::make_button($CFG->wwwroot . '/course/index.php', array(), get_string('backtocourselisting')));
+echo $OUTPUT->single_button($CFG->wwwroot . '/course/index.php', get_string('backtocourselisting'));
echo $OUTPUT->footer();
\ No newline at end of file
diff --git a/course/search.php b/course/search.php
index 66053e43948..4cb70f3cfb4 100644
--- a/course/search.php
+++ b/course/search.php
@@ -188,16 +188,13 @@
$edit = "on";
}
- $form = new html_form();
- $form->url = new moodle_url("$CFG->wwwroot/course/search.php", array(
+ $aurl = new moodle_url("$CFG->wwwroot/course/search.php", array(
'edit' => $edit,
'sesskey' => sesskey(),
- 'search' => s($search, true),
+ 'search' => $search,
'page' => $page,
'perpage' => $perpage));
- $form->method = 'get';
- $form->button->text = s($string);
- $searchform = $OUTPUT->button($form);
+ $searchform = $OUTPUT->single_button($aurl, $string, 'get');
}
}
diff --git a/enrol/authorize/enrol.php b/enrol/authorize/enrol.php
index 7040492622c..44747829ade 100755
--- a/enrol/authorize/enrol.php
+++ b/enrol/authorize/enrol.php
@@ -316,8 +316,8 @@ class enrolment_plugin_authorize
echo $OUTPUT->box_start('generalbox notice');
echo '
'. get_string('paymentthanks', 'moodle', $course->fullname) .'
';
echo $OUTPUT->container_start('buttons');
- echo $OUTPUT->button(html_form::make_button("$CFG->wwwroot/enrol/authorize/index.php", array('order'=>$order->id), get_string('payments')));
- echo $OUTPUT->button(html_form::make_button("$CFG->wwwroot/course/view.php", array('id'=>$course->id), $course->fullname));
+ echo $OUTPUT->single_button(new moodle_url("$CFG->wwwroot/enrol/authorize/index.php", array('order'=>$order->id)), get_string('payments'));
+ echo $OUTPUT->single_button(new moodle_url("$CFG->wwwroot/course/view.php", array('id'=>$course->id)), $course->fullname);
echo $OUTPUT->container_end();
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
diff --git a/enrol/manual/enrol.html b/enrol/manual/enrol.html
index 4033f84054b..b865562d9b9 100644
--- a/enrol/manual/enrol.html
+++ b/enrol/manual/enrol.html
@@ -41,7 +41,7 @@
if (isguestuser()) {
echo $OUTPUT->box_start('centerpara');
$loginurl = get_login_url();
- echo $OUTPUT->button(html_form::make_button($loginurl, null, get_string('login')));
+ echo $OUTPUT->single_button($loginurl, get_string('login'));
echo $OUTPUT->box_end();
}
?>
diff --git a/grade/edit/outcome/import.php b/grade/edit/outcome/import.php
index 0cd18800210..32284ff40a7 100644
--- a/grade/edit/outcome/import.php
+++ b/grade/edit/outcome/import.php
@@ -135,7 +135,7 @@ if ($handle = fopen($imported_file['userfile']['tmp_name'], 'r')) {
if ($error) {
echo $OUTPUT->box_start('generalbox importoutcomenofile');
echo get_string('importoutcomenofile', 'grades', $line);
- echo $OUTPUT->button(html_form::make_button($CFG->wwwroot.'/grade/edit/outcome/index.php', array('id'=> $courseid), get_string('back'), 'get'));
+ echo $OUTPUT->single_button(new moodle_url($CFG->wwwroot.'/grade/edit/outcome/index.php', array('id'=> $courseid)), get_string('back'), 'get');
echo $OUTPUT->box_end();
$fatal_error = true;
break;
@@ -154,7 +154,7 @@ if ($handle = fopen($imported_file['userfile']['tmp_name'], 'r')) {
if ( count($csv_data) != count($file_headers) ) {
echo $OUTPUT->box_start('generalbox importoutcomenofile');
echo get_string('importoutcomenofile', 'grades', $line);
- echo $OUTPUT->button(html_form::make_button($CFG->wwwroot.'/grade/edit/outcome/index.php', array('id'=> $courseid), get_string('back'), 'get'));
+ echo $OUTPUT->single_button(new moodle_url($CFG->wwwroot.'/grade/edit/outcome/index.php', array('id'=> $courseid)), get_string('back'), 'get');
echo $OUTPUT->box_end();
$fatal_error = true;
//echo $OUTPUT->box(var_export($csv_data, true) ."
". var_export($header, true));
@@ -166,7 +166,7 @@ if ($handle = fopen($imported_file['userfile']['tmp_name'], 'r')) {
if ($csv_data[$imported_headers[$header]] == '') {
echo $OUTPUT->box_start('generalbox importoutcomenofile');
echo get_string('importoutcomenofile', 'grades', $line);
- echo $OUTPUT->button(html_form::make_button($CFG->wwwroot.'/grade/edit/outcome/index.php', array('id'=> $courseid), get_string('back'), 'get'));
+ echo $OUTPUT->single_button(new moodle_url($CFG->wwwroot.'/grade/edit/outcome/index.php', array('id'=> $courseid)), get_string('back'), 'get');
echo $OUTPUT->box_end();
$fatal_error = true;
break;
diff --git a/grade/edit/outcome/index.php b/grade/edit/outcome/index.php
index 3550e5ccc30..6f201f43790 100644
--- a/grade/edit/outcome/index.php
+++ b/grade/edit/outcome/index.php
@@ -247,9 +247,9 @@ foreach($outcomes_tables as $table) {
}
echo $OUTPUT->container_start('buttons');
-echo $OUTPUT->button(html_form::make_button('edit.php', array('courseid'=>$courseid), $strcreatenewoutcome));
+echo $OUTPUT->single_button(new moodle_url('edit.php', array('courseid'=>$courseid)), $strcreatenewoutcome);
if ( !empty($outcomes_tables) ) {
- echo $OUTPUT->button(html_form::make_button('export.php', array('id'=>$courseid, 'sesskey'=>sesskey()), get_string('exportalloutcomes', 'grades')));
+ echo $OUTPUT->single_button(new moodle_url('export.php', array('id'=>$courseid, 'sesskey'=>sesskey())), get_string('exportalloutcomes', 'grades'));
}
echo $OUTPUT->container_end();
@@ -268,7 +268,6 @@ function grade_print_scale_link($courseid, $scale, $gpr) {
global $CFG, $OUTPUT;
$url = new moodle_url($CFG->wwwroot.'/grade/edit/scale/edit.php', array('courseid' => $courseid, 'id' => $scale->id));
$url = $gpr->add_url_params($url);
- $link = html_link::make($url, $scale->get_name());
- return $OUTPUT->link($link);
+ return $OUTPUT->link($url, $scale->get_name());
}
diff --git a/grade/edit/scale/index.php b/grade/edit/scale/index.php
index d169e023331..3e74bb2413c 100644
--- a/grade/edit/scale/index.php
+++ b/grade/edit/scale/index.php
@@ -162,6 +162,6 @@ echo $OUTPUT->table($table);
echo $OUTPUT->heading($strstandardscale, 3, 'main');
echo $OUTPUT->table($table2);
echo $OUTPUT->container_start('buttons');
-echo $OUTPUT->button(html_form::make_button('edit.php', array('courseid'=>$courseid), $srtcreatenewscale));
+echo $OUTPUT->single_button(new moodle_url('edit.php', array('courseid'=>$courseid)), $srtcreatenewscale);
echo $OUTPUT->container_end();
echo $OUTPUT->footer();
diff --git a/grade/edit/tree/index.php b/grade/edit/tree/index.php
index 90b6701cccf..d3a6b389fdb 100644
--- a/grade/edit/tree/index.php
+++ b/grade/edit/tree/index.php
@@ -341,16 +341,16 @@ echo $OUTPUT->box_end();
echo $OUTPUT->container_start('buttons');
if ($moving) {
- echo $OUTPUT->button(html_form::make_button('index.php', array('id'=>$course->id), get_string('cancel'), 'get'));
+ echo $OUTPUT->single_button(new moodle_url('index.php', array('id'=>$course->id)), get_string('cancel'), 'get');
} else {
- echo $OUTPUT->button(html_form::make_button('category.php', array('courseid'=>$course->id), get_string('addcategory', 'grades'), 'get'));
- echo $OUTPUT->button(html_form::make_button('item.php', array('courseid'=>$course->id), get_string('additem', 'grades'), 'get'));
+ echo $OUTPUT->single_button(new moodle_url('category.php', array('courseid'=>$course->id)), get_string('addcategory', 'grades'), 'get');
+ echo $OUTPUT->single_button(new moodle_url('item.php', array('courseid'=>$course->id)), get_string('additem', 'grades'), 'get');
if (!empty($CFG->enableoutcomes)) {
- echo $OUTPUT->button(html_form::make_button('outcomeitem.php', array('courseid'=>$course->id), get_string('addoutcomeitem', 'grades'), 'get'));
+ echo $OUTPUT->single_button(new moodle_url('outcomeitem.php', array('courseid'=>$course->id)), get_string('addoutcomeitem', 'grades'), 'get');
}
- //print_single_button('index.php', array('id'=>$course->id, 'action'=>'autosort'), get_string('autosort', 'grades'), 'get');
+ //echo $OUTPUT->(new moodle_url('index.php', array('id'=>$course->id, 'action'=>'autosort')), get_string('autosort', 'grades'), 'get');
}
echo $OUTPUT->container_end();
diff --git a/grade/export/keymanager.php b/grade/export/keymanager.php
index d09d9c63513..e63b06cf2f6 100644
--- a/grade/export/keymanager.php
+++ b/grade/export/keymanager.php
@@ -77,7 +77,7 @@ $table->data = $data;
echo $OUTPUT->table($table);
echo $OUTPUT->container_start('buttons mdl-align');
-echo $OUTPUT->button(html_form::make_button('key.php', array('courseid'=>$course->id), get_string('newuserkey', 'userkey')));
+echo $OUTPUT->single_button(new moodle_url('key.php', array('courseid'=>$course->id)), get_string('newuserkey', 'userkey'));
echo $OUTPUT->container_end();
echo $OUTPUT->footer();
diff --git a/grade/export/lib.php b/grade/export/lib.php
index 1c468591212..2e6449f7f47 100755
--- a/grade/export/lib.php
+++ b/grade/export/lib.php
@@ -295,8 +295,7 @@ abstract class grade_export {
echo $OUTPUT->container_start('gradeexportlink');
if (!$this->userkey) { // this button should trigger a download prompt
- echo $OUTPUT->button(html_form::make_button($CFG->wwwroot.'/grade/export/'.$this->plugin.'/export.php',
- $params, get_string('download', 'admin')));
+ echo $OUTPUT->single_button(new moodle_url($CFG->wwwroot.'/grade/export/'.$this->plugin.'/export.php', $params), get_string('download', 'admin'));
} else {
$paramstr = '';
@@ -308,7 +307,7 @@ abstract class grade_export {
$link = $CFG->wwwroot.'/grade/export/'.$this->plugin.'/dump.php'.$paramstr.'&key='.$this->userkey;
- echo get_string('download', 'admin').': ' . $OUTPUT->link(html_link::make($link, $link));
+ echo get_string('download', 'admin').': ' . $OUTPUT->link($link, $link);
}
echo $OUTPUT->container_end();
}
diff --git a/grade/import/keymanager.php b/grade/import/keymanager.php
index 46c4b7fbb5f..270b7de9b0c 100644
--- a/grade/import/keymanager.php
+++ b/grade/import/keymanager.php
@@ -74,7 +74,7 @@ $table->data = $data;
echo $OUTPUT->table($table);
echo $OUTPUT->container_start('buttons mdl-align');
-echo $OUTPUT->button(html_form::make_button('key.php', array('courseid'=>$course->id), get_string('newuserkey', 'userkey')));
+echo $OUTPUT->single_button(new moodle_url('key.php', array('courseid'=>$course->id)), get_string('newuserkey', 'userkey'));
echo $OUTPUT->container_end();
echo $OUTPUT->footer();
diff --git a/grade/report/grader/index.php b/grade/report/grader/index.php
index b5225f4f88c..ba6c99095ee 100644
--- a/grade/report/grader/index.php
+++ b/grade/report/grader/index.php
@@ -84,7 +84,7 @@ if (has_capability('moodle/grade:edit', $context)) {
$string = get_string('turneditingon');
}
- $buttons = $OUTPUT->button(html_form::make_button('index.php', $options, $string, 'get'));
+ $buttons = $OUTPUT->single_button(new moodle_url('index.php', $options), $string, 'get');
} else {
$USER->gradeediting[$course->id] = 0;
diff --git a/group/groupings.php b/group/groupings.php
index 9d7879137f5..3cec9b7101a 100644
--- a/group/groupings.php
+++ b/group/groupings.php
@@ -101,7 +101,7 @@ $table->data = $data;
echo $OUTPUT->table($table);
echo $OUTPUT->container_start('buttons');
-echo $OUTPUT->button(html_form::make_button('grouping.php', array('courseid'=>$courseid), $srtnewgrouping));
+echo $OUTPUT->single_button(new moodle_url('grouping.php', array('courseid'=>$courseid)), $srtnewgrouping);
echo $OUTPUT->container_end();
echo $OUTPUT->footer();
diff --git a/lib/adminlib.php b/lib/adminlib.php
index a3baf54b2d8..df29208b154 100644
--- a/lib/adminlib.php
+++ b/lib/adminlib.php
@@ -5263,7 +5263,9 @@ function admin_externalpage_print_header($focus='') {
$caption = get_string('blocksediton');
$options['adminedit'] = 'on';
}
- $buttons = $OUTPUT->button(html_form::make_button($PAGE->url->out(), $options, $caption, 'get'));
+ $url = clone($PAGE->url);
+ $url->params($options);
+ $buttons = $OUTPUT->single_button($url, $caption, 'get');
}
$PAGE->set_title("$SITE->shortname: " . implode(": ",$visiblepathtosection));
diff --git a/lib/deprecatedlib.php b/lib/deprecatedlib.php
index ed0eb460434..744fbc86695 100644
--- a/lib/deprecatedlib.php
+++ b/lib/deprecatedlib.php
@@ -2472,7 +2472,7 @@ function button_to_popup_window ($url, $name=null, $linkname=null,
$id=null, $class=null) {
global $OUTPUT;
- debugging('button_to_popup_window() has been deprecated. Please change your code to use $OUTPUT->button().');
+ debugging('button_to_popup_window() has been deprecated. Please change your code to use $OUTPUT->single_button().');
if ($options == 'none') {
$options = null;
@@ -2516,7 +2516,7 @@ function button_to_popup_window ($url, $name=null, $linkname=null,
}
$form->button->add_action(new popup_action('click', $url, $name, $popupparams));
- $output = $OUTPUT->button($form);
+ $output = $OUTPUT->single_button($form);
if ($return) {
return $output;
@@ -2546,7 +2546,7 @@ function print_single_button($link, $options, $label='OK', $method='get', $notus
$return=false, $tooltip='', $disabled = false, $jsconfirmmessage='', $formid = '') {
global $OUTPUT;
- debugging('print_single_button() has been deprecated. Please change your code to use $OUTPUT->button().');
+ debugging('print_single_button() has been deprecated. Please change your code to use $OUTPUT->single_button().');
// Cast $options to array
$options = (array) $options;
@@ -2562,7 +2562,7 @@ function print_single_button($link, $options, $label='OK', $method='get', $notus
$form->button->add_confirm_action($jsconfirmmessage);
}
- $output = $OUTPUT->button($form);
+ $output = $OUTPUT->single_button($form);
if ($return) {
return $output;
@@ -3561,10 +3561,8 @@ function update_module_button($cmid, $ignored, $string) {
if (has_capability('moodle/course:manageactivities', get_context_instance(CONTEXT_MODULE, $cmid))) {
$string = get_string('updatethis', '', $string);
- $form = new html_form();
- $form->url = new moodle_url("$CFG->wwwroot/course/mod.php", array('update' => $cmid, 'return' => true, 'sesskey' => sesskey()));
- $form->button->text = $string;
- return $OUTPUT->button($form);
+ $url = new moodle_url("$CFG->wwwroot/course/mod.php", array('update' => $cmid, 'return' => true, 'sesskey' => sesskey()));
+ return $OUTPUT->single_button($url, $string);
} else {
return '';
}
diff --git a/lib/outputrenderers.php b/lib/outputrenderers.php
index 6461ae54689..668786e6dc8 100644
--- a/lib/outputrenderers.php
+++ b/lib/outputrenderers.php
@@ -995,20 +995,26 @@ class core_renderer extends renderer_base {
/**
* Returns a form with single button.
+ * If first parameter is html_form instance all other parameters are ignored.
*
* @param string|moodle_url|html_form $url_or_form
* @param string $label button text
* @param string $method get or post submit method
+ * @param array $options associative array {disabled, title}
* @return string HTML fragment
*/
- public function single_button($url_or_form, $label=null, $method='get') {
+ public function single_button($url_or_form, $label=null, $method='post', array $options=null) {
if ($url_or_form instanceof html_form) {
- $form = clone($url_or_form);
- if (!is_null($label)) {
- $form->button->text = $label;
+ $form = $url_or_form;
+ if (func_num_args() > 1) {
+ debugging('html_form instance used as first parameter of $OUTPUT->single_button(), all other parameters are ignored.');
}
} else {
$form = html_form::make_button($url_or_form, null, $label, $method);
+ $form->button->disabled = !empty($options['disabled']);
+ if (!empty($options['title'])) {
+ $form->button->title = $options['title'];
+ }
}
return $this->button($form);
@@ -1058,7 +1064,7 @@ class core_renderer extends renderer_base {
$buttonoutput = null;
if (empty($contents) && !empty($form->button)) {
- debugging("You probably want to use \$OUTPUT->button(\$form), please read that function's documentation", DEBUG_DEVELOPER);
+ debugging("You probably want to use \$OUTPUT->single_button(\$form), please read that function's documentation", DEBUG_DEVELOPER);
} else if (empty($contents)) {
$contents = $this->output_empty_tag('input', array('type' => 'submit', 'value' => get_string('ok')));
} else if (!empty($form->button)) {
diff --git a/lib/simpletest/filtersettingsperformancetester.php b/lib/simpletest/filtersettingsperformancetester.php
index c6bb20baf35..271378f286c 100644
--- a/lib/simpletest/filtersettingsperformancetester.php
+++ b/lib/simpletest/filtersettingsperformancetester.php
@@ -116,17 +116,14 @@ $DB = $realdb;
echo $OUTPUT->container_start();
-$form = html_form::make_button($baseurl, array('action' => 'setup'), 'Set up test tables', 'get');
-$form->button->disabled = $issetup > 0;
-echo $OUTPUT->button($form);
+$aurl = new moodle_url($baseurl, array('action' => 'setup'));
+echo $OUTPUT->single_button($aurl, 'Set up test tables', 'get', array('disabled'=>($issetup > 0)));
-$form = html_form::make_button($baseurl, array('action' => 'teardown'), 'Drop test tables', 'get');
-$form->button->disabled = $issetup == 0;
-echo $OUTPUT->button($form);
+$aurl = new moodle_url($baseurl, array('action' => 'teardown'));
+echo $OUTPUT->single_button($aurl, 'Drop test tables', 'get', array('disabled'=>($issetup == 0)));
-$form = html_form::make_button($baseurl, array('action' => 'test'), 'Run tests', 'get');
-$form->button->disabled = $issetup != count($requiredtables);
-echo $OUTPUT->button($form);
+$aurl = new moodle_url($baseurl, array('action' => 'test'));
+echo $OUTPUT->single_button($aurl, 'Run tests', 'get', array('disabled'=>($issetup != count($requiredtables))));
echo $OUTPUT->container_end();
diff --git a/lib/weblib.php b/lib/weblib.php
index d73113ce388..16826465c3e 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -2218,7 +2218,7 @@ function switchroles_form($courseid) {
$options['sesskey'] = sesskey();
$options['switchrole'] = 0;
- return $OUTPUT->button(html_form::make_button($CFG->wwwroot.'/course/view.php', $options, get_string('switchrolereturn')));
+ return $OUTPUT->single_button(new moodle_url($CFG->wwwroot.'/course/view.php', $options), get_string('switchrolereturn'));
}
if (has_capability('moodle/role:switchroles', $context)) {
diff --git a/login/confirm.php b/login/confirm.php
index 09aa3e735dd..fde3b05e733 100644
--- a/login/confirm.php
+++ b/login/confirm.php
@@ -39,7 +39,7 @@ if (!empty($data) || (!empty($p) && !empty($s))) {
echo $OUTPUT->box_start('generalbox centerpara boxwidthnormal boxaligncenter');
echo "
".get_string("thanks").", ". fullname($user) . "
\n";
echo "
".get_string("alreadyconfirmed")."
\n";
- echo $OUTPUT->button(html_form::make_button("$CFG->wwwroot/course/", null, get_string('courses')));
+ echo $OUTPUT->single_button("$CFG->wwwroot/course/", get_string('courses'));
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
exit;
@@ -66,7 +66,7 @@ if (!empty($data) || (!empty($p) && !empty($s))) {
echo $OUTPUT->box_start('generalbox centerpara boxwidthnormal boxaligncenter');
echo "
".get_string("thanks").", ". fullname($USER) . "
\n";
echo "
".get_string("confirmed")."
\n";
- echo $OUTPUT->button(html_form::make_button("$CFG->wwwroot/course/", null, get_string('courses')));
+ echo $OUTPUT->single_button("$CFG->wwwroot/course/", get_string('courses'));
echo $OUTPUT->box_end();
echo $OUTPUT->footer();
exit;
diff --git a/message/lib.php b/message/lib.php
index 779e0566dab..1da4e1d9ada 100644
--- a/message/lib.php
+++ b/message/lib.php
@@ -179,7 +179,7 @@ function message_print_contacts() {
echo $OUTPUT->container_end();
echo $OUTPUT->container_start('messagejsmanualrefresh aligncenter');
- echo $OUTPUT->button(html_form::make_button('index.php', false, get_string('refresh')));
+ echo $OUTPUT->single_button('index.php', get_string('refresh'));
echo $OUTPUT->container_end();
}
@@ -518,7 +518,7 @@ function message_print_search_results($frm) {
}
echo '
';
- echo $OUTPUT->button(html_form::make_button('index.php', array( 'tab' => 'search'), get_string('newsearch', 'message')));
+ echo $OUTPUT->single_button(new moodle_url('index.php', array('tab' => 'search')), get_string('newsearch', 'message'));
echo '
';
}
diff --git a/mod/assignment/type/online/assignment.class.php b/mod/assignment/type/online/assignment.class.php
index 9a219fb145f..63d15c12ccf 100644
--- a/mod/assignment/type/online/assignment.class.php
+++ b/mod/assignment/type/online/assignment.class.php
@@ -126,8 +126,7 @@ class assignment_online extends assignment_base {
echo $OUTPUT->box_end();
if (!$editmode && $editable) {
echo "";
- echo $OUTPUT->button(html_form::make_button('view.php', array('id'=>$this->cm->id,'edit'=>'1'),
- get_string('editmysubmission', 'assignment')));
+ echo $OUTPUT->single_button(new moodle_url('view.php', array('id'=>$this->cm->id, 'edit'=>'1')), get_string('editmysubmission', 'assignment'));
echo "
";
}
diff --git a/mod/assignment/type/upload/assignment.class.php b/mod/assignment/type/upload/assignment.class.php
index 7bbf5c8ef1d..e9385e030d8 100644
--- a/mod/assignment/type/upload/assignment.class.php
+++ b/mod/assignment/type/upload/assignment.class.php
@@ -180,7 +180,7 @@ class assignment_upload extends assignment_base {
if ($this->can_update_notes($submission)) {
$options = array ('id'=>$this->cm->id, 'action'=>'editnotes');
echo '';
- echo $OUTPUT->button(html_form::make_button('upload.php', $options, get_string('edit')));
+ echo $OUTPUT->single_button(new moodle_url('upload.php', $options), get_string('edit'));
echo '
';
}
}
@@ -376,10 +376,10 @@ class assignment_upload extends assignment_base {
if ($this->drafts_tracked() and $this->isopen() and has_capability('mod/assignment:grade', $this->context) and $mode != '') { // we do not want it on view.php page
if ($this->can_unfinalize($submission)) {
$options = array ('id'=>$this->cm->id, 'userid'=>$userid, 'action'=>'unfinalize', 'mode'=>$mode, 'offset'=>$offset);
- $output .= $OUTPUT->button(html_form::make_button('upload.php', $options, get_string('unfinalize', 'assignment')));
+ $output .= $OUTPUT->single_button(new moodle_url('upload.php', $options), get_string('unfinalize', 'assignment'));
} else if ($this->can_finalize($submission)) {
$options = array ('id'=>$this->cm->id, 'userid'=>$userid, 'action'=>'finalizeclose', 'mode'=>$mode, 'offset'=>$offset);
- $output .= $OUTPUT->button(html_form::make_button('upload.php', $options, get_string('finalize', 'assignment')));
+ $output .= $OUTPUT->single_button(new moodle_url('upload.php', $options), get_string('finalize', 'assignment'));
}
}
diff --git a/mod/choice/report.php b/mod/choice/report.php
index 7428ac58f4a..d52ba36558e 100644
--- a/mod/choice/report.php
+++ b/mod/choice/report.php
@@ -224,13 +224,13 @@
$options = array();
$options["id"] = "$cm->id";
$options["download"] = "ods";
- echo $OUTPUT->button(html_form::make_button("report.php", $options, get_string("downloadods")));
+ echo $OUTPUT->single_button(new moodle_url("report.php", $options), get_string("downloadods"));
echo "";
$options["download"] = "xls";
- echo $OUTPUT->button(html_form::make_button("report.php", $options, get_string("downloadexcel")));
+ echo $OUTPUT->single_button(new moodle_url("report.php", $options), get_string("downloadexcel"));
echo " | ";
$options["download"] = "txt";
- echo $OUTPUT->button(html_form::make_button("report.php", $options, get_string("downloadtext")));
+ echo $OUTPUT->single_button(new moodle_url("report.php", $options), get_string("downloadtext"));
echo " | ";
}
diff --git a/mod/choice/view.php b/mod/choice/view.php
index a2ed7ec5577..67a855d02e5 100644
--- a/mod/choice/view.php
+++ b/mod/choice/view.php
@@ -141,7 +141,7 @@
echo $OUTPUT->box_start('generalbox', 'notice');
echo ''. get_string('noguestchoose', 'choice') .'
';
echo $OUTPUT->container_start('continuebutton');
- echo $OUTPUT->button(html_form::make_button($CFG->wwwroot.'/course/enrol.php?id='.$course->id, NULL, get_string('enrolme', '', format_string($course->shortname))));
+ echo $OUTPUT->single_button(new moodle_url($CFG->wwwroot.'/course/enrol.php?', array('id'=>$course->id)), get_string('enrolme', '', format_string($course->shortname)));
echo $OUTPUT->container_end();
echo $OUTPUT->box_end();
diff --git a/mod/data/preset.php b/mod/data/preset.php
index 863b47ef386..d9f93a7e7ae 100644
--- a/mod/data/preset.php
+++ b/mod/data/preset.php
@@ -339,7 +339,7 @@ $options = array();
$options['sesskey'] = sesskey();
$options['action'] = 'export';
$options['d'] = $data->id;
-echo $OUTPUT->button(html_form::make_button('preset.php', $options, $strexport));
+echo $OUTPUT->single_button(new moodle_url('preset.php', $options), $strexport);
echo '';
echo '| ';
@@ -349,7 +349,7 @@ $options = array();
$options['sesskey'] = sesskey();
$options['action'] = 'save1';
$options['d'] = $data->id;
-echo $OUTPUT->button(html_form::make_button('preset.php', $options, $strsave));
+echo $OUTPUT->single_button(new moodle_url('preset.php', $options), $strsave);
echo ' |
';
echo ''.$strimport.' |
';
echo '';
diff --git a/mod/feedback/analysis.php b/mod/feedback/analysis.php
index 950a4f0767d..ce63c0a9ef7 100644
--- a/mod/feedback/analysis.php
+++ b/mod/feedback/analysis.php
@@ -87,10 +87,8 @@ if( $capabilities->viewreports ) {
//echo '';
// echo ' ';
echo $OUTPUT->container_start('form-buttons');
- $export_button_link = 'analysis_to_excel.php';
- $export_button_options = array('sesskey'=>sesskey(), 'id'=>$id);
- $export_button_label = get_string('export_to_excel', 'feedback');
- echo $OUTPUT->button(html_form::make_button($export_button_link, $export_button_options, $export_button_label));
+ $aurl = new moodle_url('analysis_to_excel.php', array('sesskey'=>sesskey(), 'id'=>$id));
+ echo $OUTPUT->single_button($aurl, get_string('export_to_excel', 'feedback'));
echo $OUTPUT->container_end();
}
diff --git a/mod/feedback/analysis_course.php b/mod/feedback/analysis_course.php
index 5e5f9f30af7..dfa80152cb4 100644
--- a/mod/feedback/analysis_course.php
+++ b/mod/feedback/analysis_course.php
@@ -84,10 +84,8 @@ echo $OUTPUT->box_start('generalbox boxaligncenter boxwidthwide');
if( $capabilities->viewreports ) {
//button "export to excel"
echo $OUTPUT->container_start('mdl-align');
- $export_button_link = 'analysis_to_excel.php';
- $export_button_options = array('sesskey'=>sesskey(), 'id'=>$id, 'coursefilter'=>$coursefilter);
- $export_button_label = get_string('export_to_excel', 'feedback');
- echo $OUTPUT->button(html_form::make_button($export_button_link, $export_button_options, $export_button_label));
+ $aurl = new moodle_url('analysis_to_excel.php', array('sesskey'=>sesskey(), 'id'=>$id, 'coursefilter'=>$coursefilter));
+ echo $OUTPUT->single_button($aurl, get_string('export_to_excel', 'feedback'));
echo $OUTPUT->container_end();
}
diff --git a/mod/feedback/import.php b/mod/feedback/import.php
index 0a9fd2e1f6f..1c2796585fe 100644
--- a/mod/feedback/import.php
+++ b/mod/feedback/import.php
@@ -123,12 +123,7 @@
| |
button->text = get_string('choosefile', 'feedback');
- $form->button->title = $form->button->text;
- $form->url = "/files/index.php?id={$course->id}&choose=form.choosefile";
- $form->button->add_action(new popup_action('click', $form->url, "coursefiles", array('width' => 750, 'height' => 500)));
- echo $OUTPUT->button($form);
+ echo 'TODO: implement new file picker and file ahdnling - MDL-14493';
?>
|
@@ -141,7 +136,7 @@
container_start('mdl-align');
- echo $OUTPUT->button(html_form::make_button('edit.php', array('id'=>$id, 'do_show'=>'templates'), get_string('cancel')));
+ echo $OUTPUT->single_button(new moodle_url('edit.php', array('id'=>$id, 'do_show'=>'templates')), get_string('cancel'));
echo $OUTPUT->container_end();
echo $OUTPUT->footer();
diff --git a/mod/feedback/show_entries.php b/mod/feedback/show_entries.php
index c3b029f1e00..151a6e30a3d 100644
--- a/mod/feedback/show_entries.php
+++ b/mod/feedback/show_entries.php
@@ -152,10 +152,8 @@ if($do_show == 'showentries'){
sesskey(), 'userid'=>$student->id, 'do_show'=>'showoneentry', 'id'=>$id);
- $show_button_label = get_string('show_entries', 'feedback');
- echo $OUTPUT->button(html_form::make_button($show_button_link, $show_button_options, $show_button_label));
+ $aurl = new moodle_url($ME, array('sesskey'=>sesskey(), 'userid'=>$student->id, 'do_show'=>'showoneentry', 'id'=>$id));
+ echo $OUTPUT->single_button($aurl, get_string('show_entries', 'feedback'));
?>
|
sesskey(), 'completedid'=>$feedbackcompleted->id, 'do_show'=>'showoneentry', 'id'=>$id);
- $delete_button_label = get_string('delete_entry', 'feedback');
- echo $OUTPUT->button(html_form::make_button($delete_button_link, $delete_button_options, $delete_button_label));
+ $aurl = new moodle_url('delete_completed.php', array('sesskey'=>sesskey(), 'completedid'=>$feedbackcompleted->id, 'do_show'=>'showoneentry', 'id'=>$id));
+ echo $OUTPUT->single_button($aurl, get_string('delete_entry', 'feedback'));
?>
|
sesskey(), 'userid'=>0, 'do_show'=>'showoneentry', 'id'=>$id);
- $show_anon_button_label = get_string('show_entries', 'feedback');
- echo $OUTPUT->button(html_form::make_button($show_anon_button_link, $show_anon_button_options, $show_anon_button_label));
+ $aurl = new moodle_url('show_entries_anonym.php', array('sesskey'=>sesskey(), 'userid'=>0, 'do_show'=>'showoneentry', 'id'=>$id));
+ echo $OUTPUT->single_button($aurl, get_string('show_entries', 'feedback'));
?>
|
diff --git a/mod/forum/index.php b/mod/forum/index.php
index 4d82d549eb1..eb924b34bcc 100644
--- a/mod/forum/index.php
+++ b/mod/forum/index.php
@@ -208,15 +208,11 @@ if ($generalforums) {
$trackedlink = $stryes;
} else {
- $options = array('id'=>$forum->id);
+ $aurl = new moodle_url($CFG->wwwroot.'/mod/forum/settracking.php', array('id'=>$forum->id));
if (!isset($untracked[$forum->id])) {
- $form = html_form::make_button($CFG->wwwroot.'/mod/forum/settracking.php', $options, $stryes);
- $form->button->title = $strnotrackforum;
- $trackedlink = $OUTPUT->button($form);
+ $trackedlink = $OUTPUT->single_button($aurl, $stryes, 'post', array('title'=>$strnotrackforum));
} else {
- $form = html_form::make_button($CFG->wwwroot.'/mod/forum/settracking.php', $options, $strno);
- $form->button->title = $strtrackforum;
- $trackedlink = $OUTPUT->button($form);
+ $trackedlink = $OUTPUT->single_button($aurl, $strno, 'post', array('title'=>$strtrackforum));
}
}
}
@@ -335,15 +331,11 @@ if ($course->id != SITEID) { // Only real courses have learning forums
$trackedlink = $stryes;
} else {
- $options = array('id'=>$forum->id);
+ $aurl = new moodle_url($CFG->wwwroot.'/mod/forum/settracking.php', array('id'=>$forum->id));
if (!isset($untracked[$forum->id])) {
- $form = html_form::make_button($CFG->wwwroot.'/mod/forum/settracking.php', $options, $stryes);
- $form->button->title = $strnotrackforum;
- $trackedlink = $OUTPUT->button($form);
+ $trackedlink = $OUTPUT->single_button($aurl, $stryes, 'post', array('title'=>$strnotrackforum));
} else {
- $form = html_form::make_button($CFG->wwwroot.'/mod/forum/settracking.php', $options, $strno);
- $form->button->title = $strtrackforum;
- $trackedlink = $OUTPUT->button($form);
+ $trackedlink = $OUTPUT->single_button($aurl, $strno, 'post', array('title'=>$strtrackforum));
}
}
}
diff --git a/mod/forum/lib.php b/mod/forum/lib.php
index beab9d6088c..c7558824ce8 100644
--- a/mod/forum/lib.php
+++ b/mod/forum/lib.php
@@ -5019,9 +5019,8 @@ function forum_get_subscribe_link($forum, $context, $messages = array(), $cantac
$link = "';
}
@@ -5075,9 +5074,8 @@ function forum_get_tracking_link($forum, $messages=array(), $fakelink=true) {
// use |
";
echo "";
echo $OUTPUT->box_end();
@@ -241,12 +241,12 @@ if ( $action ) {
$options['action'] = "add";
echo "| ";
- echo $OUTPUT->button(html_form::make_button("editcategories.php", $options, get_string("add") . " " . get_string("category","glossary")));
+ echo $OUTPUT->single_button(new moodle_url("editcategories.php", $options), get_string("add") . " " . get_string("category","glossary"));
echo " | ";
unset($options['action']);
$options['mode'] = 'cat';
$options['hook'] = $hook;
- echo $OUTPUT->button(html_form::make_button("view.php", $options, get_string("back","glossary")));
+ echo $OUTPUT->single_button(new moodle_url("view.php", $options), get_string("back","glossary"));
echo " |
";
echo "
";
diff --git a/mod/glossary/lib.php b/mod/glossary/lib.php
index 57b8fd38cfa..9e69d6b716c 100644
--- a/mod/glossary/lib.php
+++ b/mod/glossary/lib.php
@@ -1492,7 +1492,7 @@ function glossary_print_categories_menu($cm, $glossary, $hook, $category) {
$options['id'] = $cm->id;
$options['mode'] = 'cat';
$options['hook'] = $hook;
- echo $OUTPUT->button(html_form::make_button("editcategories.php", $options, get_string("editcategories","glossary"), "get"));
+ echo $OUTPUT->single_button(new moodle_url("editcategories.php", $options), get_string("editcategories","glossary"), "get");
}
echo '';
diff --git a/mod/hotpot/review.php b/mod/hotpot/review.php
index 894a3a8d688..a4ae2113b6e 100644
--- a/mod/hotpot/review.php
+++ b/mod/hotpot/review.php
@@ -138,12 +138,12 @@ function hotpot_print_review_buttons(&$course, &$hotpot, &$attempt, $context) {
print "\n".'';
print "\n\n".'| ';
- echo $OUTPUT->button(html_form::make_button("report.php?hp=$hotpot->id", NULL, get_string('continue')));
+ echo $OUTPUT->single_button(new moodle_url("report.php", array('hp'=>$hotpot->id)), get_string('continue'));
if (has_capability('mod/hotpot:viewreport',$context) && $DB->record_exists('hotpot_details', array('attempt'=>$attempt->id))) {
print " | \n".'';
- echo $OUTPUT->button(html_form::make_button("review.php?hp=$hotpot->id&attempt=$attempt->id&action=showxmlsource", NULL, get_string('showxmlsource', 'hotpot')));
+ echo $OUTPUT->single_button(new moodle_url("review.php", array('hp'=>$hotpot->id, 'attempt'=>$attempt->id, 'action'=>'showxmlsource')), get_string('showxmlsource', 'hotpot'));
print " | \n".'';
- echo $OUTPUT->button(html_form::make_button("review.php?hp=$hotpot->id&attempt=$attempt->id&action=showxmltree", NULL, get_string('showxmltree', 'hotpot')));
+ echo $OUTPUT->single_button(new moodle_url("review.php", array('hp'=>$hotpot->id,'attempt'=>$attempt->id, 'action'=>'showxmltree')), get_string('showxmltree', 'hotpot'));
$colspan = 3;
} else {
$colspan = 1;
diff --git a/mod/lesson/continue.php b/mod/lesson/continue.php
index b38517f7c2e..175c42721f6 100644
--- a/mod/lesson/continue.php
+++ b/mod/lesson/continue.php
@@ -186,14 +186,13 @@ if ($lesson->review && !$result->correctanswer && !$result->noanswer && !$result
echo $OUTPUT->form($form);
}
-$url = $CFG->wwwroot.'/mod/lesson/view.php';
-$options = array('id'=>$cm->id, 'pageid'=>$result->newpageid);
+$url = new moodle_url($CFG->wwwroot.'/mod/lesson/view.php', array('id'=>$cm->id, 'pageid'=>$result->newpageid));
if ($lesson->review && !$result->correctanswer && !$result->noanswer && !$result->isessayquestion) {
// Review button continue
- $form = html_form::make_button($url, $options, get_string('reviewquestioncontinue', 'lesson'));
+ echo $OUTPUT->single_button($url, get_string('reviewquestioncontinue', 'lesson'));
} else {
// Normal continue button
- $form = html_form::make_button($url, $options, get_string('continue', 'lesson'));
+ echo $OUTPUT->single_button($url, get_string('continue', 'lesson'));
}
-echo $OUTPUT->button($form);
+
echo $lessonoutput->footer();
\ No newline at end of file
diff --git a/mod/lesson/locallib.php b/mod/lesson/locallib.php
index 2f4ff0c0ce4..06b71a1e92a 100644
--- a/mod/lesson/locallib.php
+++ b/mod/lesson/locallib.php
@@ -567,9 +567,8 @@ function lesson_add_header_buttons($cm, $context, $extraeditbuttons=false, $less
print_error('invalidpageid', 'lesson');
}
if (!empty($lessonpageid) && $lessonpageid != LESSON_EOL) {
- $options = array('id'=>$cm->id, 'redirect'=>'navigation', 'pageid'=>$lessonpageid);
- $buttonform = html_form::make_button($CFG->wwwroot.'/mod/lesson/lesson.php', $options, get_string('editpagecontent', 'lesson'));
- $PAGE->set_button($OUTPUT->button($buttonform));
+ $url = new moodle_url($CFG->wwwroot.'/mod/lesson/lesson.php', array('id'=>$cm->id, 'redirect'=>'navigation', 'pageid'=>$lessonpageid));
+ $PAGE->set_button($OUTPUT->single_button($url, get_string('editpagecontent', 'lesson')));
}
}
-}
\ No newline at end of file
+}
diff --git a/mod/lesson/view.php b/mod/lesson/view.php
index e73f5595b8b..56830f66a46 100644
--- a/mod/lesson/view.php
+++ b/mod/lesson/view.php
@@ -507,9 +507,8 @@ if ($pageid != LESSON_EOL) {
}
if (!$highscores or $madeit) {
$lessoncontent .= $lessonoutput->paragraph(get_string("youmadehighscore", "lesson", $lesson->maxhighscores), 'center');
- $params = array('id'=>$PAGE->cm->id, 'sesskey'=>sesskey());
- $highscoresbutton = html_form::make_button($CFG->wwwroot.'/mod/lesson/highscores.php', $params, get_string('clicktopost', 'lesson'));
- $lessoncontent .= $OUTPUT->button($highscoresbutton);
+ $aurl = new moodle_url($CFG->wwwroot.'/mod/lesson/highscores.php', array('id'=>$PAGE->cm->id, 'sesskey'=>sesskey()));
+ $lessoncontent .= $OUTPUT->single_button($aurl, get_string('clicktopost', 'lesson'));
} else {
$lessoncontent .= get_string("nothighscore", "lesson", $lesson->maxhighscores)." ";
}
diff --git a/mod/quiz/accessrules.php b/mod/quiz/accessrules.php
index d8621cd9100..3cc1d45a136 100644
--- a/mod/quiz/accessrules.php
+++ b/mod/quiz/accessrules.php
@@ -224,7 +224,7 @@ class quiz_access_manager {
if ($strconfirmstartattempt) {
$form->button->add_confirm_action($strconfirmstartattempt);
}
- echo $OUTPUT->button($form);
+ echo $OUTPUT->single_button($form);
}
echo "\n";
}
@@ -750,7 +750,7 @@ class securewindow_access_rule extends quiz_access_rule_base {
$form->button->title = $form->button->text;
$form->url = $this->_quizobj->review_url($attemptid);
$form->button->add_action(new popup_action('click', $form->url, 'quizpopup', $this->windowoptions));
- return $OUTPUT->button($form);
+ return $OUTPUT->single_button($form);
}
/**
diff --git a/mod/quiz/attemptlib.php b/mod/quiz/attemptlib.php
index a69f8db102b..5dbd38319ec 100644
--- a/mod/quiz/attemptlib.php
+++ b/mod/quiz/attemptlib.php
@@ -742,8 +742,8 @@ class quiz_attempt extends quiz {
public function print_restart_preview_button() {
global $CFG, $OUTPUT;
echo $OUTPUT->container_start('controls');
- $options = array('cmid' => $this->cm->id, 'forcenew' => true);
- echo $OUTPUT->button(html_form::make_button($this->start_attempt_url(), $options, get_string('startagain', 'quiz')));
+ $url = new moodle_url($this->start_attempt_url(), array('cmid' => $this->cm->id, 'forcenew' => true));
+ echo $OUTPUT->single_button($url, get_string('startagain', 'quiz'));
echo $OUTPUT->container_end();
}
diff --git a/mod/quiz/editlib.php b/mod/quiz/editlib.php
index 9b784237e3c..530a8c08a9f 100644
--- a/mod/quiz/editlib.php
+++ b/mod/quiz/editlib.php
@@ -603,15 +603,8 @@ function quiz_print_question_list($quiz, $pageurl, $allowdelete = true,
if (!$reordertool && !$quiz->shufflequestions) {
echo $OUTPUT->container_start('addpage');
- $form = html_form::make_button($pageurl->out(true),
- array('cmid' => $quiz->cmid,
- 'courseid' => $quiz->course,
- 'addpage' => $count,
- 'sesskey' => sesskey()),
- get_string('addpagehere', 'quiz'),
- 'get');
- $form->button->disabled = $hasattempts;
- echo $OUTPUT->button($form);
+ $url = new moodle_url($pageurl->out(true), array('cmid' => $quiz->cmid, 'courseid' => $quiz->course, 'addpage' => $count, 'sesskey' => sesskey()));
+ echo $OUTPUT->single_button($url, get_string('addpagehere', 'quiz'), 'get', $hasattempts);
echo $OUTPUT->container_end();
}
$pageopen = false;
diff --git a/mod/quiz/lib.php b/mod/quiz/lib.php
index 24b53697806..6dcc4ec354c 100644
--- a/mod/quiz/lib.php
+++ b/mod/quiz/lib.php
@@ -554,8 +554,8 @@ function quiz_grade_item_update($quiz, $grades=NULL) {
echo $OUTPUT->box_start('generalbox', 'notice');
echo ''. $message .' ';
echo $OUTPUT->container_start('buttons');
- echo $OUTPUT->button(html_form::make_button($regrade_link, null, get_string('regradeanyway', 'grades')));
- echo $OUTPUT->button(html_form::make_button($back_link, null, get_string('cancel')));
+ echo $OUTPUT->single_button($regrade_link, get_string('regradeanyway', 'grades'));
+ echo $OUTPUT->single_button($back_link, get_string('cancel'));
echo $OUTPUT->container_end();
echo $OUTPUT->box_end();
diff --git a/mod/quiz/report/statistics/report.php b/mod/quiz/report/statistics/report.php
index 1ea18cdd392..fc40d0c0a0c 100644
--- a/mod/quiz/report/statistics/report.php
+++ b/mod/quiz/report/statistics/report.php
@@ -409,8 +409,8 @@ class quiz_statistics_report extends quiz_default_report {
}
$quizinformationtablehtml .= $OUTPUT->box_start('boxaligncenter generalbox boxwidthnormal mdl-align');
$quizinformationtablehtml .= get_string('lastcalculated', 'quiz_statistics', $a);
- $quizinformationtablehtml .= $OUTPUT->button(html_form::make_button($reporturl->out(true), $reporturl->params()+array('recalculate'=>1),
- get_string('recalculatenow', 'quiz_statistics')));
+ $aurl = new moodle_url($reporturl->out(true), $reporturl->params()+array('recalculate'=>1));
+ $quizinformationtablehtml .= $OUTPUT->single_button($aurl, get_string('recalculatenow', 'quiz_statistics'));
$quizinformationtablehtml .= $OUTPUT->box_end();
}
$downloadoptions = $this->table->get_download_menu();
diff --git a/mod/quiz/summary.php b/mod/quiz/summary.php
index 0f918e4ee49..275da221d3f 100644
--- a/mod/quiz/summary.php
+++ b/mod/quiz/summary.php
@@ -128,7 +128,7 @@ $form = html_form::make_button($attemptobj->processattempt_url(), $options, get_
$form->id = 'responseform';
$form->button->add_confirm_action(get_string('confirmclose', 'quiz'));
-echo $OUTPUT->button($form);
+echo $OUTPUT->single_button($form);
echo $OUTPUT->container_end();
/// Finish the page
diff --git a/mod/survey/report.php b/mod/survey/report.php
index 72d51eae7bc..a2b58903257 100644
--- a/mod/survey/report.php
+++ b/mod/survey/report.php
@@ -484,13 +484,13 @@
$options["group"] = $currentgroup;
$options["type"] = "ods";
- echo $OUTPUT->button(html_form::make_button("download.php", $options, get_string("downloadods")));
+ echo $OUTPUT->single_button(new moodle_url("download.php", $options), get_string("downloadods"));
$options["type"] = "xls";
- echo $OUTPUT->button(html_form::make_button("download.php", $options, get_string("downloadexcel")));
+ echo $OUTPUT->single_button(new moodle_url("download.php", $options), get_string("downloadexcel"));
$options["type"] = "txt";
- echo $OUTPUT->button(html_form::make_button("download.php", $options, get_string("downloadtext")));
+ echo $OUTPUT->single_button(new moodle_url("download.php", $options), get_string("downloadtext"));
echo $OUTPUT->container_end();
break;
diff --git a/my/index.php b/my/index.php
index 46dfad0854d..13597c395ee 100644
--- a/my/index.php
+++ b/my/index.php
@@ -37,10 +37,8 @@
$edit = '1';
}
- $form = new html_form();
- $form->url = new moodle_url("$CFG->wwwroot/my/index.php", array('edit' => $edit));
- $form->button->text = $string;
- $button = $OUTPUT->button($form);
+ $url = new moodle_url("$CFG->wwwroot/my/index.php", array('edit' => $edit));
+ $button = $OUTPUT->single_button($url, $string);
$header = $SITE->shortname . ': ' . $strmymoodle;
$PAGE->navbar->add($strmymoodle);
diff --git a/question/editlib.php b/question/editlib.php
index 937d1fd9d00..eb1443c790a 100644
--- a/question/editlib.php
+++ b/question/editlib.php
@@ -1927,10 +1927,8 @@ function create_new_question_button($categoryid, $params, $caption, $tooltip = '
global $CFG, $PAGE, $OUTPUT;
static $choiceformprinted = false;
$params['category'] = $categoryid;
- $form = html_form::make_button($CFG->wwwroot . '/question/addquestion.php', $params, $caption,'get');
- $form->button->title = $tooltip;
- $form->button->disabled = $disabled;
- echo $OUTPUT->button($form);
+ $url = new moodle_url($CFG->wwwroot . '/question/addquestion.php', $params);
+ echo $OUTPUT->single_button($url, $caption, 'get', array('disabled'=>$disabled, 'title'=>$tooltip));
echo $OUTPUT->help_icon('types', get_string('createnewquestion', 'question'), 'question');
$PAGE->requires->yui2_lib('dragdrop');
diff --git a/theme/index.php b/theme/index.php
index 70bac97979f..3a00b4a379a 100644
--- a/theme/index.php
+++ b/theme/index.php
@@ -59,7 +59,7 @@ if ($reset and confirm_sesskey()) {
admin_externalpage_print_header('themeselector');
echo $OUTPUT->heading(get_string('themes'));
-echo $OUTPUT->button(html_form::make_button('index.php', array('sesskey'=>sesskey(),'reset'=>1), get_string('themeresetcaches', 'admin')));
+echo $OUTPUT->single_button(new moodle_url('index.php', array('sesskey'=>sesskey(),'reset'=>1)), get_string('themeresetcaches', 'admin'));
$table = new html_table();
$table->id = 'adminthemeselector';
@@ -95,7 +95,7 @@ foreach ($themes as $themename => $themedir) {
// Contents of the second cell.
$infocell = $OUTPUT->heading($themename, 3);
if ($themename != $CFG->theme) {
- $infocell .= $OUTPUT->button(html_form::make_button('index.php', array('choose' => $themename, 'sesskey' => sesskey()), get_string('choose'), 'get'));
+ $infocell .= $OUTPUT->single_button(new moodle_url('index.php', array('choose' => $themename, 'sesskey' => sesskey())), get_string('choose'), 'get');
}
$row[] = $infocell;
diff --git a/user/profile/index.php b/user/profile/index.php
index a32dc56dae4..6b5bdc5f4e6 100644
--- a/user/profile/index.php
+++ b/user/profile/index.php
@@ -151,7 +151,7 @@ echo $OUTPUT->select(html_select::make_popup_form($popupurl, 'datatype', $option
/// Create a new category link
$options = array('action'=>'editcategory');
-echo $OUTPUT->button(html_form::make_button('index.php', $options, get_string('profilecreatecategory', 'admin')));
+echo $OUTPUT->single_button(new moodle_url('index.php', $options), get_string('profilecreatecategory', 'admin'));
echo '';
diff --git a/webservice/renderer.php b/webservice/renderer.php
index 25c47fd1155..83dca26b227 100644
--- a/webservice/renderer.php
+++ b/webservice/renderer.php
@@ -278,13 +278,8 @@ EOF;
/// Print button
$form = new html_form();
$parameters = array ('wsusername' => $username, 'wspassword' => $password, 'print' => true);
- $form->url = new moodle_url($CFG->wwwroot.'/webservice/wsdoc.php', $parameters); // Required
- $form->button = new html_button();
- $form->button->text = get_string('print','webservice'); // Required
- $form->button->disabled = false;
- $form->button->title = get_string('print','webservice');
- $form->method = 'post';
- $documentationhtml .= $OUTPUT->button($form);
+ $url = new moodle_url($CFG->wwwroot.'/webservice/wsdoc.php', $parameters); // Required
+ $documentationhtml .= $OUTPUT->single_button($url, get_string('print','webservice'));
$documentationhtml .= $this->output_empty_tag('br', array());
|