From 9b2a2ffe2aa2c17e9de18b4f0172ef814c10bf20 Mon Sep 17 00:00:00 2001 From: David Scotson Date: Thu, 6 Mar 2014 12:03:40 +0000 Subject: [PATCH 1/2] MDL-44468 backup: use notification API Replace a hardcoded div.notifyproblem with a API call that, in Standard theme, outputs the same HTML. Also removes the .notifyproblem class from the heading, as that might cause problems for themers who expect it to be used consistently with the API. --- backup/util/ui/renderer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup/util/ui/renderer.php b/backup/util/ui/renderer.php index abe6842a450..5194f6242be 100644 --- a/backup/util/ui/renderer.php +++ b/backup/util/ui/renderer.php @@ -222,8 +222,8 @@ class core_backup_renderer extends plugin_renderer_base { public function backup_details_unknown(moodle_url $nextstageurl) { $html = html_writer::start_tag('div', array('class' => 'unknownformat')); - $html .= $this->output->heading(get_string('errorinvalidformat', 'backup'), 2, 'notifyproblem'); - $html .= html_writer::tag('div', get_string('errorinvalidformatinfo', 'backup'), array('class' => 'notifyproblem')); + $html .= $this->output->heading(get_string('errorinvalidformat', 'backup'), 2); + $html .= $this->output->notification(get_string('errorinvalidformatinfo', 'backup'), 'notifyproblem'); $html .= $this->output->single_button($nextstageurl, get_string('continue'), 'post'); $html .= html_writer::end_tag('div'); From a1071322f715903a3732d806f6a80c3d4da0610a Mon Sep 17 00:00:00 2001 From: David Scotson Date: Thu, 6 Mar 2014 12:11:42 +0000 Subject: [PATCH 2/2] MDL-44468 backup: use html_writer::div call Simplify the renderer code with the new html_writer div function. --- backup/util/ui/renderer.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/backup/util/ui/renderer.php b/backup/util/ui/renderer.php index 5194f6242be..a297c481898 100644 --- a/backup/util/ui/renderer.php +++ b/backup/util/ui/renderer.php @@ -221,11 +221,11 @@ class core_backup_renderer extends plugin_renderer_base { */ public function backup_details_unknown(moodle_url $nextstageurl) { - $html = html_writer::start_tag('div', array('class' => 'unknownformat')); + $html = html_writer::start_div('unknownformat'); $html .= $this->output->heading(get_string('errorinvalidformat', 'backup'), 2); $html .= $this->output->notification(get_string('errorinvalidformatinfo', 'backup'), 'notifyproblem'); $html .= $this->output->single_button($nextstageurl, get_string('continue'), 'post'); - $html .= html_writer::end_tag('div'); + $html .= html_writer::end_div(); return $html; }