]> git.mjollnir.org Git - moodle.git/commitdiff
MDL-19756 Changed html_button->label to html_button->text
authornicolasconnault <nicolasconnault>
Wed, 29 Jul 2009 01:10:30 +0000 (01:10 +0000)
committernicolasconnault <nicolasconnault>
Wed, 29 Jul 2009 01:10:30 +0000 (01:10 +0000)
lib/deprecatedlib.php
lib/simpletest/testoutputlib.php

index 5ca3bbd46cb2817fc7b5b6d6a7227f2435f7f56a..28a28e8be2fd55f708a1807f90f8b0d85fb234f1 100644 (file)
@@ -2618,7 +2618,7 @@ function print_single_button($link, $options, $label='OK', $method='get', $notus
     $form = new html_form();
     $form->url = new moodle_url($link, $options);
     $form->button = new html_button();
-    $form->button->label = $label;
+    $form->button->text = $label;
     $form->button->disabled = $disabled;
     $form->button->title = $tooltip;
     $form->method = $method;
@@ -3020,12 +3020,12 @@ function notice_yesno($message, $linkyes, $linkno, $optionsyes=NULL, $optionsno=
 
     $formcontinue = new html_form();
     $formcontinue->url = new moodle_url($linkyes, $optionsyes);
-    $formcontinue->button->label = get_string('yes');
+    $formcontinue->button->text = get_string('yes');
     $formcontinue->method = $methodyes;
 
     $formcancel = new html_form();
     $formcancel->url = new moodle_url($linkno, $optionsno);
-    $formcancel->button->label = get_string('no');
+    $formcancel->button->text = get_string('no');
     $formcancel->method = $methodno;
 
     echo $OUTPUT->confirm($message, $formcontinue, $formcancel);
index ab927fe7e6f6e71f634a4aca9e6f1ba3c34ac724..e8ffc1286d2275a6066e312ef8f32def20c4abe3 100644 (file)
@@ -948,7 +948,7 @@ class moodle_core_renderer_test extends UnitTestCase {
     public function test_button() {
         global $CFG;
         $originalform = new html_form();
-        $originalform->button->label = 'Click Here';
+        $originalform->button->text = 'Click Here';
         $originalform->url = '/index.php';
 
         $form = clone($originalform);
@@ -1011,9 +1011,9 @@ class moodle_core_renderer_test extends UnitTestCase {
         $this->expectException();
         $html = $this->renderer->link($link->url->out());
     }
-    
+
     /**
-     * NOTE: consider the degree of detail in which we test HTML output, because 
+     * NOTE: consider the degree of detail in which we test HTML output, because
      * the unit tests may be run under a different theme, with different HTML
      * renderers. Maybe we should limit unit tests to standardwhite.
      */
@@ -1035,7 +1035,7 @@ class moodle_core_renderer_test extends UnitTestCase {
         $this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'cancel', 'value' => 1)), $html);
         $this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())), $html);
         $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => get_string('no'), 'class' => 'singlebutton')), $html);
-        
+
         // Use html_forms with default values, should produce exactly the same output as above
         $formcontinue = new html_form();
         $formcancel = new html_form();
@@ -1053,23 +1053,23 @@ class moodle_core_renderer_test extends UnitTestCase {
         $this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'cancel', 'value' => 1)), $html);
         $this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())), $html);
         $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => get_string('no'), 'class' => 'singlebutton')), $html);
-        
+
         // Give the buttons some different labels
         $formcontinue = new html_form();
         $formcancel = new html_form();
         $formcontinue->url = new moodle_url($continueurl);
         $formcancel->url = new moodle_url($cancelurl);
-        $formcontinue->button->label = 'Continue anyway';
-        $formcancel->button->label = 'Wow OK, I get it, backing out!';
+        $formcontinue->button->text = 'Continue anyway';
+        $formcancel->button->text = 'Wow OK, I get it, backing out!';
         $html = $this->renderer->confirm($message, $formcontinue, $formcancel);
         $this->assert(new ContainsTagWithAttributes('form', array('method' => 'post', 'action' => 'http://www.test.com/index.php')), $html);
         $this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'continue', 'value' => 1)), $html);
         $this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())), $html);
-        $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => $formcontinue->button->label, 'class' => 'singlebutton')), $html);
+        $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => $formcontinue->button->text, 'class' => 'singlebutton')), $html);
         $this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'cancel', 'value' => 1)), $html);
         $this->assert(new ContainsTagWithAttributes('input', array('type' => 'hidden', 'name' => 'sesskey', 'value' => sesskey())), $html);
-        $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => $formcancel->button->label, 'class' => 'singlebutton')), $html);
-        
+        $this->assert(new ContainsTagWithAttributes('input', array('type' => 'submit', 'value' => $formcancel->button->text, 'class' => 'singlebutton')), $html);
+
         // Change the method and add extra variables
         $formcontinue = new html_form();
         $formcancel = new html_form();