MDL-55417 forms: Change iscancel property to issecondary for submit buttons
authorDamyon Wiese <damyon@moodle.com>
Tue, 16 Aug 2016 05:53:04 +0000 (13:53 +0800)
committerDan Poltawski <dan@moodle.com>
Fri, 23 Sep 2016 09:53:31 +0000 (10:53 +0100)
This is more future proof for the template.

Part of MDL-55071

lib/form/submit.php
theme/noname/templates/core_form/element-submit.mustache

index 99712b0..692188e 100644 (file)
@@ -116,7 +116,7 @@ class MoodleQuickForm_submit extends HTML_QuickForm_submit implements templatabl
     public function export_for_template(renderer_base $output) {
         $context = $this->export_for_template_base($output);
         if ($this->getName() == 'cancel') {
-            $context['iscancel'] = true;
+            $context['secondary'] = true;
         }
         return $context;
     }
index 2f7c9a7..25f53e7 100644 (file)
@@ -2,8 +2,8 @@
     {{$element}}
         <input type="submit" {{#element.frozen}}readonly{{/element.frozen}}
                 class="btn
-                    {{^element.iscancel}}btn-primary{{/element.iscancel}}
-                    {{#element.iscancel}}btn-secondary{{/element.iscancel}}
+                    {{^element.secondary}}btn-primary{{/element.secondary}}
+                    {{#element.secondary}}btn-secondary{{/element.secondary}}
                     {{#error}} btn-danger {{/error}}"
                 name="{{element.name}}"
                 id="{{element.id}}"
@@ -13,4 +13,4 @@
                 value="{{element.value}}"
                 {{{element.attributes}}} >
     {{/element}}
-{{/ core_form/element-template }}
\ No newline at end of file
+{{/ core_form/element-template }}