MDL-64587 tool_xmldb: Change Continue to Back link for consistency
authorJun Pataleta <jun@moodle.com>
Mon, 18 Feb 2019 08:09:50 +0000 (16:09 +0800)
committerJun Pataleta <jun@moodle.com>
Mon, 18 Feb 2019 08:09:50 +0000 (16:09 +0800)
* For consistency with the rest of navigation links in the tool, change
the Continue button to a Back link.

admin/tool/xmldb/actions/add_persistent_mandatory/add_persistent_mandatory.class.php

index 05a819f..a323c1e 100644 (file)
@@ -39,7 +39,7 @@ class add_persistent_mandatory extends XMLDBAction {
             'persistentfieldsconfirm' => 'tool_xmldb',
             'persistentfieldscomplete' => 'tool_xmldb',
             'persistentfieldsexist' => 'tool_xmldb',
-            'continue' => 'core'
+            'back' => 'core'
         ));
 
     }
@@ -95,7 +95,8 @@ class add_persistent_mandatory extends XMLDBAction {
             'action' => 'edit_table'
         ]);
 
-        $continuebutton = $OUTPUT->single_button($returnurl, $this->str['continue']);
+        $backbutton = html_writer::link($returnurl, '[' . $this->str['back'] . ']');
+        $actionbuttons = html_writer::tag('p', $backbutton, ['class' => 'centerpara buttons']);
 
         if (!$confirm) {
 
@@ -106,7 +107,7 @@ class add_persistent_mandatory extends XMLDBAction {
                 $this->output .= $OUTPUT->notification($message);
 
                 if (count($existing) == count($fields)) {
-                    $this->output .= $continuebutton;
+                    $this->output .= $actionbuttons;
                     return true;
                 }
             }
@@ -144,7 +145,7 @@ class add_persistent_mandatory extends XMLDBAction {
             $message .= html_writer::alist(array_diff($fields, $existing));
             $this->output .= $OUTPUT->notification($message, 'success');
 
-            $this->output .= $continuebutton;
+            $this->output .= $actionbuttons;
         }
 
         return $result;