From d86a3bc2177f7996a3ba6fad30f5006ec31beb77 Mon Sep 17 00:00:00 2001 From: Antoine Musso Date: Thu, 23 Jun 2011 19:57:52 +0000 Subject: [PATCH] Xml::label now apply the 'title' attribute when provided --- includes/Xml.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/includes/Xml.php b/includes/Xml.php index b0b0938c24..a100a8bf28 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -354,14 +354,20 @@ class Xml { * @param $attribs Array an attribute array. This will usuall be * the same array as is passed to the corresponding input element, * so this function will cherry-pick appropriate attributes to - * apply to the label as well; currently only class is applied. + * apply to the label as well; only class and title are applied. * @return string HTML */ public static function label( $label, $id, $attribs = array() ) { $a = array( 'for' => $id ); + + # FIXME avoid copy pasting below: if( isset( $attribs['class'] ) ){ $a['class'] = $attribs['class']; } + if( isset( $attribs['title'] ) ){ + $a['title'] = $attribs['title']; + } + return self::element( 'label', $a, $label ); } -- 2.20.1