From 032674eebc717922212c7be4579fa780ccff1aef Mon Sep 17 00:00:00 2001 From: Marina Glancy Date: Wed, 9 Aug 2017 15:01:38 +0800 Subject: [PATCH] MDL-59775 forms: add femptylabel class to els without labels This class was present in clean/more but was forgotted in boost --- lib/form/templatable_form_element.php | 1 + theme/boost/templates/core_form/element-template.mustache | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/form/templatable_form_element.php b/lib/form/templatable_form_element.php index 7d8c2abb804..3ca1c63d295 100644 --- a/lib/form/templatable_form_element.php +++ b/lib/form/templatable_form_element.php @@ -81,6 +81,7 @@ trait templatable_form_element { $context['extraclasses'] = $extraclasses; $context['type'] = $this->getType(); $context['attributes'] = implode(' ', $otherattributes); + $context['emptylabel'] = ($this->getLabel() === ''); // Elements with multiple values need array syntax. if ($this->getAttribute('multiple')) { diff --git a/theme/boost/templates/core_form/element-template.mustache b/theme/boost/templates/core_form/element-template.mustache index aa077ba19dc..2588e2ce745 100644 --- a/theme/boost/templates/core_form/element-template.mustache +++ b/theme/boost/templates/core_form/element-template.mustache @@ -41,7 +41,7 @@ } } }} -
+
{{#required}}{{#pix}}req, core, {{#str}}required{{/str}}{{/pix}}{{/required}}