Handle extension dependencies in the installer
[lhc/web/wiklou.git] / includes / installer / WebInstaller.php
index 9d7e051..8fb9807 100644 (file)
@@ -915,6 +915,7 @@ class WebInstaller extends Installer {
         *    Parameters are:
         *      var:         The variable to be configured (required)
         *      label:       The message name for the label (required)
+        *      labelAttribs:Additional attributes for the label element (optional)
         *      attribs:     Additional attributes for the input element (optional)
         *      controlName: The name for the input element (optional)
         *      value:       The current value of the variable (optional)
@@ -937,6 +938,9 @@ class WebInstaller extends Installer {
                if ( !isset( $params['help'] ) ) {
                        $params['help'] = "";
                }
+               if ( !isset( $params['labelAttribs'] ) ) {
+                       $params['labelAttribs'] = [];
+               }
                if ( isset( $params['rawtext'] ) ) {
                        $labelText = $params['rawtext'];
                } else {
@@ -945,17 +949,19 @@ class WebInstaller extends Installer {
 
                return "<div class=\"config-input-check\">\n" .
                        $params['help'] .
-                       "<label>\n" .
-                       Xml::check(
-                               $params['controlName'],
-                               $params['value'],
-                               $params['attribs'] + [
-                                       'id' => $params['controlName'],
-                                       'tabindex' => $this->nextTabIndex(),
-                               ]
-                       ) .
-                       $labelText . "\n" .
-                       "</label>\n" .
+                       Html::rawElement(
+                               'label',
+                               $params['labelAttribs'],
+                               Xml::check(
+                                       $params['controlName'],
+                                       $params['value'],
+                                       $params['attribs'] + [
+                                               'id' => $params['controlName'],
+                                               'tabindex' => $this->nextTabIndex(),
+                                       ]
+                               ) .
+                               $labelText . "\n"
+                               ) .
                        "</div>\n";
        }