]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-21198 $OUTPUT->single_button() resurrection, hopefully much easier to use than...
authorPetr Skoda <skodak@moodle.org>
Sun, 3 Jan 2010 15:46:14 +0000 (15:46 +0000)
committerPetr Skoda <skodak@moodle.org>
Sun, 3 Jan 2010 15:46:14 +0000 (15:46 +0000)
62 files changed:
admin/mnet/mnet_themes.html
admin/roles/define.php
admin/roles/manage.php
admin/settings.php
admin/webservice/service_functions.php
backup/restore_check.html
backup/restorelib.php
blocks/rss_client/managefeeds.php
calendar/delete.php
calendar/view.php
course/category.php
course/index.php
course/lib.php
course/pending.php
course/search.php
enrol/authorize/enrol.php
enrol/manual/enrol.html
grade/edit/outcome/import.php
grade/edit/outcome/index.php
grade/edit/scale/index.php
grade/edit/tree/index.php
grade/export/keymanager.php
grade/export/lib.php
grade/import/keymanager.php
grade/report/grader/index.php
group/groupings.php
lib/adminlib.php
lib/deprecatedlib.php
lib/outputrenderers.php
lib/simpletest/filtersettingsperformancetester.php
lib/weblib.php
login/confirm.php
message/lib.php
mod/assignment/type/online/assignment.class.php
mod/assignment/type/upload/assignment.class.php
mod/choice/report.php
mod/choice/view.php
mod/data/preset.php
mod/feedback/analysis.php
mod/feedback/analysis_course.php
mod/feedback/import.php
mod/feedback/show_entries.php
mod/forum/index.php
mod/forum/lib.php
mod/glossary/editcategories.php
mod/glossary/lib.php
mod/hotpot/review.php
mod/lesson/continue.php
mod/lesson/locallib.php
mod/lesson/view.php
mod/quiz/accessrules.php
mod/quiz/attemptlib.php
mod/quiz/editlib.php
mod/quiz/lib.php
mod/quiz/report/statistics/report.php
mod/quiz/summary.php
mod/survey/report.php
my/index.php
question/editlib.php
theme/index.php
user/profile/index.php
webservice/renderer.php

index a18e4db05a08bfd1fedf668e1f1331d0ad55b597..d105458a2af5f2ed7579329f9ca2085cc4ad8ce8 100644 (file)
@@ -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 '</td>';
     echo "</tr>";
 
@@ -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 '</td>';
         echo "</tr>";
     }
index ec8c49f854df11cccf2ebbf9d9978a82706e3808..65f6911b67fb2f7ee35352861277af9a3e60007b 100755 (executable)
         $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();
     }
 
index e13f9320a68c145bc55a2d65dee2533d6b1803e3..ed160fae539e20c6401dbb58e843ea08cfff3189 100755 (executable)
     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();
index cba9c55bade8d5816efa269b33882c0736e7d760..c8a4bd6aea8a91d62c588ec6549a9e7323e73f0d 100644 (file)
@@ -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);
index ecce2ce78435c6551ea308998539e402bf198ef9..f2153a4f5ec686bd163b13360283e9512391b62f 100644 (file)
@@ -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();
 
index a97933def719466e5f2ef27daeeda5b509213490..0d620004ab1a1980844d97b20cdf0e69e1be7806 100644 (file)
 
 
         /// 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 "</div>";
 
index aac97521edcf6c1e3bd1b7c0a73c709e7ac61181..d389d4aebb5ab1dec2e2182e1e5e42f8d18061f3 100644 (file)
@@ -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 "</div>";
             }
             else {
index 650b41feb0787f0fb4632b1045206da1b38e13e4..4a7f7580341e03ec465eb3954044df10462a8922 100644 (file)
@@ -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 '<div class="actionbuttons">' . $OUTPUT->button($button) . '</div>';
+$url = $CFG->wwwroot . '/blocks/rss_client/editfeed.php?' . substr($extraparams, 1);
+echo '<div class="actionbuttons">' . $OUTPUT->single_button($url, get_string('addnewfeed', 'block_rss_client'), 'get') . '</div>';
 
 
 if ($returnurl) {
index c92ed08db579eb064b3af25a1c5b26795eebfa69..f8336ad0665e29bc5c3e971ca2987c5925c1c88b 100644 (file)
@@ -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 = '<br /><br />'.$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');
index da79b2812fb19003d43f9e59595e75df182bb9ce..127b4f316d5e6bdeb90f5e90357af32070d33643 100644 (file)
@@ -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);
index 37dcc6d75ec4e35d3d456e724ce1e7a78d6b2f5f..f64e6d1b25fe85c8ffe4d9786d459db3448be206 100644 (file)
 
         // 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();
     }
         $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) {
index 895feba4578f4436811b125834aff35a48a7f4a9..266cc20760886ad3cc9c5f81e4c7c970380f6dc5 100644 (file)
@@ -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 '</table>';
 echo '<div class="buttons">';
 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);
index 9c260cea5f10e01f251c06466ee964d1b973ca4f..a546bd09db40102302d69fd77a33ce577284fe28 100644 (file)
@@ -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 '<div class="addcoursebutton">';
-            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 '</div>';
         }
     }
@@ -2324,7 +2323,7 @@ function print_my_moodle() {
             echo "<table width=\"100%\"><tr><td align=\"center\">";
             print_course_search("", false, "short");
             echo "</td><td align=\"center\">";
-            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 "</td></tr></table>\n";
         }
 
index 3a6ff80e4e84bbcc6f8de08a5751e35ef78f03d5..38d03bdc3cfe335c79748cf34d200b9f08dad914 100644 (file)
@@ -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
index 66053e439486e38d006589148706ab21faf91d39..4cb70f3cfb412db6a998b07589675beca54fe2b0 100644 (file)
                 $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');
         }
     }
 
index 7040492622c4ffdf821ea0132ee7411a57fafa47..44747829adef62866e2add7c6d1adecd142145e3 100755 (executable)
@@ -316,8 +316,8 @@ class enrolment_plugin_authorize
                     echo $OUTPUT->box_start('generalbox notice');
                     echo '<p>'. get_string('paymentthanks', 'moodle', $course->fullname) .'</p>';
                     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();
index 4033f84054b5a995969efad14bbfd451605c65fd..b865562d9b9b2388e106d4ecb01d56909756647a 100644 (file)
@@ -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();
     }
 ?>
index 0cd188002104f31818018588ed20ff26813bcff7..32284ff40a7b696e55fc7672ede48d52993c7455 100644 (file)
@@ -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) ."<br />". 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;
index 3550e5ccc3077218cc7908a47bb875c9479328a0..6f201f437905dc0ea9fb1007cc2aad852fdbe840 100644 (file)
@@ -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());
 }
 
index d169e023331e9b4242c81bbae7b405637f28f38e..3e74bb2413c8cc928bcad3cc68f70c66ee7dd67d 100644 (file)
@@ -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();
index 90b6701cccf124581185bd3eaf00cf0a303589b1..d3a6b389fdbe9afc42a31bc4e7c410d7fa478773 100644 (file)
@@ -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();
index d09d9c635135db970dcf0ab55f2670d09ca96946..e63b06cf2f67b6f7265873798ca57d5621f05147 100644 (file)
@@ -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();
index 1c468591212c0c28e8cab43a3e8dae23c175cf2e..2e6449f7f47b333264b4f273edc79413e7319da9 100755 (executable)
@@ -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();
     }
index 46c4b7fbb5fe59cd9de133c30b918377f06f68e6..270b7de9b0c2650d6012396f3c171407b3bd58fd 100644 (file)
@@ -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();
index b5225f4f88c4d28c8e636d3da544c221bc02e3ec..ba6c99095ee432d0e12c1901403f5cb1ff161714 100644 (file)
@@ -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;
index 9d7879137f52af5085b472830571c4d99479be1d..3cec9b7101a07fc26dadb061f4fb94fdbebb4bc7 100644 (file)
@@ -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();
index a3baf54b2d810e12b8177640798693aa1e16d5ca..df29208b15429ec673c8cfd29c6e88a4cce778b3 100644 (file)
@@ -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));
index ed0eb4604345ec3a9c14fe56120190ca56395749..744fbc86695512985a4b372ed9c54cb2abf1b39f 100644 (file)
@@ -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 '';
     }
index 6461ae5468945762f5728bcea218dcf34dacb539..668786e6dc8d596299b24a3a40d2b19894b86397 100644 (file)
@@ -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)) {
index c6bb20baf35aa328af424f77a84883b61fcab386..271378f286c0bed26e91646fb1bc415833ef4647 100644 (file)
@@ -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();
 
index d73113ce388ee6e9921841ed9f8526943e859e84..16826465c3eea247028bc07094f16df56d147093 100644 (file)
@@ -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)) {
index 09aa3e735ddf63960e64ceb7a63a9d2c24a157be..fde3b05e7330293860e8d57d2992b48d1773ef17 100644 (file)
@@ -39,7 +39,7 @@ if (!empty($data) || (!empty($p) && !empty($s))) {
         echo $OUTPUT->box_start('generalbox centerpara boxwidthnormal boxaligncenter');
         echo "<h3>".get_string("thanks").", ". fullname($user) . "</h3>\n";
         echo "<p>".get_string("alreadyconfirmed")."</p>\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 "<h3>".get_string("thanks").", ". fullname($USER) . "</h3>\n";
         echo "<p>".get_string("confirmed")."</p>\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;
index 779e0566dab40122951ffdc2a84f772c63caae48..1da4e1d9adabbd257785c7406378653915b603ec 100644 (file)
@@ -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 '<br />';
-    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 '</div>';
 }
index 9a219fb145f03c6936615a22d19f38a44a32691a..63d15c12ccfe49f60483b137340d20eb05ca706a 100644 (file)
@@ -126,8 +126,7 @@ class assignment_online extends assignment_base {
             echo $OUTPUT->box_end();
             if (!$editmode && $editable) {
                 echo "<div style='text-align:center'>";
-                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 "</div>";
             }
 
index 7bbf5c8ef1dcd5200439486886ded54a6c8f4e44..e9385e030d8a312d79444c639359bb4668471e33 100644 (file)
@@ -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 '<div style="text-align:center">';
-            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 '</div>';
         }
     }
@@ -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'));
             }
         }
 
index 7428ac58f4a1a94ed4cb8689d4e39aa7d35bd1be..d52ba36558e7bc788e981cdecdf7196bc1016d68 100644 (file)
         $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 "</td><td>";
         $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 "</td><td>";
         $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 "</td></tr></table>";
     }
index a2ed7ec55774b7a2aa8b3b1f7aab730fffe05a66..67a855d02e50290e337cc6b96b6325a0e70a8389 100644 (file)
             echo $OUTPUT->box_start('generalbox', 'notice');
             echo '<p align="center">'. get_string('noguestchoose', 'choice') .'</p>';
             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();
 
index 863b47ef3860cab931e5ba82319546a92f7f6a26..d9f93a7e7aebe0e9c33aabd4af19fae8c9043e5e 100644 (file)
@@ -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 '</td></tr>';
 
 echo '<tr><td><label>'.$strsaveaspreset.'</label>';
@@ -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 '</td></tr>';
 echo '<tr><td valign="top" colspan="2" align="center"><h3>'.$strimport.'</h3></td></tr>';
 echo '<tr><td><label for="fromfile">'.$strfromfile.'</label>';
index 950a4f0767d48bc16e6d5f452e8c111a15de1242..ce63c0a9ef7a896730216d4ce9958ad893b27def 100644 (file)
@@ -87,10 +87,8 @@ if( $capabilities->viewreports ) {
     //echo '<div class="mdl-align">';
     // echo '<div class="feedback_centered_button">';
     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();
 }
 
index 5e5f9f30af705dd82722acc49af0dbbdfd456d1b..dfa80152cb480d47f1ebd9732df726d17276e3ca 100644 (file)
@@ -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();
 }
 
index 0a9fd2e1f6f723c4afd2c37ac1a6baa155f23337..1c2796585fe943487a77694d3354f94e45882d2c 100644 (file)
                 <tr>
                      <td>&nbsp;</td>
                      <td><?php
-                        $form = new html_form();
-                        $form->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';
                         ?>
                           <input type="submit" name="save" value="<?php print_string('importfromthisfile', 'feedback'); ?>" />
                     </td>
      <?php
 
     echo $OUTPUT->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();
 
index c3b029f1e0088b21eeffcf15b9fdc0948da38b4a..151a6e30a3d7b01c80375f207bad3625ac02f7c4 100644 (file)
@@ -152,10 +152,8 @@ if($do_show == 'showentries'){
                             </td>
                             <td align="right">
                             <?php
-                                $show_button_link = $ME;
-                                $show_button_options = array('sesskey'=>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'));
                             ?>
                             </td>
                 <?php
@@ -163,10 +161,8 @@ if($do_show == 'showentries'){
                 ?>
                             <td align="right">
                             <?php
-                                $delete_button_link = 'delete_completed.php';
-                                $delete_button_options = array('sesskey'=>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'));
                             ?>
                             </td>
                 <?php
@@ -187,10 +183,8 @@ if($do_show == 'showentries'){
                 </td>
                 <td align="right">
                     <?php
-                        $show_anon_button_link = 'show_entries_anonym.php';
-                        $show_anon_button_options = array('sesskey'=>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'));
                     ?>
                 </td>
             </tr>
index 4d82d549eb1faff6e3d7f715f42cf7b6e46d24d3..eb924b34bccda87a1b789f355975dc088ddfcef2 100644 (file)
@@ -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));
                         }
                     }
                 }
index beab9d6088cbd491ed4870d40fe38e74752e8cac..c7558824ce85dd6248383ea7129ffaaf02a3c1af 100644 (file)
@@ -5019,9 +5019,8 @@ function forum_get_subscribe_link($forum, $context, $messages = array(), $cantac
             $link = "<noscript>";
         }
         $options ['id'] = $forum->id;
-        $form = html_form::make_button($CFG->wwwroot.'/mod/forum/subscribe.php', $options, $linktext);
-        $form->button->title = $linktitle;
-        $link .= $OUTPUT->button($form);
+        $url = new moodle_url($CFG->wwwroot.'/mod/forum/subscribe.php', $options);
+        $link .= $OUTPUT->single_button($url, $linktext, 'get', array('title'=>$linktitle));
         if ($fakelink) {
             $link .= '</noscript>';
         }
@@ -5075,9 +5074,8 @@ function forum_get_tracking_link($forum, $messages=array(), $fakelink=true) {
         // use <noscript> to print button in case javascript is not enabled
         $link .= '<noscript>';
     }
-    $form = html_form::make_button($CFG->wwwroot.'/mod/forum/settracking.php?id=' . $forum->id, $options, $linktext);
-    $form->button->title = $linktitle;
-    $link .= $OUTPUT->button($form);
+    $url = new moodle_url($CFG->wwwroot.'/mod/forum/settracking.php', array('id'=>$forum->id));
+    $link .= $OUTPUT->single_button($url, $linktext, 'get', array('title'=>$linktitle));
 
     if ($fakelink) {
         $link .= '</noscript>';
index 4a2dcae74606e680adc842eeebdf0bfda628cb9b..f61d282c1485b7261e0f9442580aa77b0819bfcc 100644 (file)
@@ -146,7 +146,7 @@ if ( $hook >0 ) {
 <?php
             unset($options);
             $options = array ("id" => $id);
-            echo $OUTPUT->button(html_form::make_button("editcategories.php", $options, get_string("no")));
+            echo $OUTPUT->single_button(new moodle_url("editcategories.php", $options), get_string("no"));
             echo "</td></tr></table>";
             echo "</div>";
             echo $OUTPUT->box_end();
@@ -241,12 +241,12 @@ if ( $action ) {
              $options['action'] = "add";
 
              echo "<table border=\"0\"><tr><td align=\"right\">";
-             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 "</td><td align=\"left\">";
              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 "</td></tr>";
              echo "</table>";
 
index 57b8fd38cfa936e53226c55d1957d19dbf33d271..9e69d6b716c852d9751c6433251fc486527340dd 100644 (file)
@@ -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 '</td>';
 
index 894a3a8d688ac820fb6dbd14c41d675f7fc9e989..a4ae2113b6e01ede94cbefa7a987c75178bc43af 100644 (file)
@@ -138,12 +138,12 @@ function hotpot_print_review_buttons(&$course, &$hotpot, &$attempt, $context) {
 
     print "\n".'<table border="0" align="center" cellpadding="2" cellspacing="2" class="generaltable">';
     print "\n<tr>\n".'<td align="center">';
-    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 "</td>\n".'<td align="center">';
-        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 "</td>\n".'<td align="center">';
-        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;
index b38517f7c2ea2ecba9506ab1d64ad025b44a0a17..175c42721f645cefe0ae6c699a77cb3c619ef67e 100644 (file)
@@ -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
index 2f4ff0c0ce4e9eb78d4859c235ca04044f9b9589..06b71a1e92a1f73d08e3805525ca0bdc7dfa1e49 100644 (file)
@@ -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
+}
index e73f5595b8b1f45e9b0d607047373c6cd2b13467..56830f66a460d87ec3502b781ad35409c053fc9c 100644 (file)
@@ -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)."<br />";
             }
index d8621cd91007818c7d6f8ad277ef8ad45070700d..3cc1d45a1367e570e246bd8eb62cd1be7a1330ed 100644 (file)
@@ -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 "</div>\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);
     }
 
     /**
index a69f8db102b6651efefe6298f148e1b52d657cac..5dbd38319ec66bb820a846a6863eb893062369d0 100644 (file)
@@ -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();
     }
 
index 9b784237e3c4187ef67b5c7b6757f9c0d33500e0..530a8c08a9f42b278ff4357103b7f4b9f7589388 100644 (file)
@@ -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;
index 24b536978069ffaa29443eae9b41a59097f3769c..6dcc4ec354cad5395a00d30a2d83e0f5f530c49e 100644 (file)
@@ -554,8 +554,8 @@ function quiz_grade_item_update($quiz, $grades=NULL) {
                 echo $OUTPUT->box_start('generalbox', 'notice');
                 echo '<p>'. $message .'</p>';
                 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();
 
index 1ea18cdd39269ed2b248bc392f7a6c9ab536a718..fc40d0c0a0c95f5eb619c3b0624c4ce31d96468d 100644 (file)
@@ -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();
index 0f918e4ee4975f15ac65b70dde7c2ec8fedde9c2..275da221d3f510239d283c71b94630f755dc4492 100644 (file)
@@ -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
index 72d51eae7bc9b4ded64863a608d28945da89e687..a2b58903257771ff9dd7a3797f7996fb7b92cf3d 100644 (file)
         $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;
index 46dfad0854d4df0999060c413da97d070611be89..13597c395eefce0352b8cbfa47b79a1d3cec8122 100644 (file)
         $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);
index 937d1fd9d00daff5c397cb7ded6d281414e87ae2..eb1443c790afa85d4c073143f8b8e3f1bcf5ead9 100644 (file)
@@ -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');
index 70bac97979f0332db85d07e7ea4f828324a3e5f2..3a00b4a379a820b9a296d0cf945ea3539df240d5 100644 (file)
@@ -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;
index a32dc56dae4f5a859fcd24cde1ac8c99792202ea..6b5bdc5f4e6aaee86e0564119aaedda309814b69 100644 (file)
@@ -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 '</div>';
 
index 25c47fd1155e727e1cec74ffd8efdf01070ff954..83dca26b227f8b601074cac3f4f5912a8a686175 100644 (file)
@@ -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());