http://www.mediawiki.org/wiki/Special:Code/MediaWiki/90669
Revision: 90669
Author: hashar
Date: 2011-06-23 19:57:52 +0000 (Thu, 23 Jun 2011)
Log Message:
-----------
Xml::label now apply the 'title' attribute when provided
Modified Paths:
--------------
trunk/phase3/includes/Xml.php
Modified: trunk/phase3/includes/Xml.php
===================================================================
--- trunk/phase3/includes/Xml.php 2011-06-23 18:42:51 UTC (rev 90668)
+++ trunk/phase3/includes/Xml.php 2011-06-23 19:57:52 UTC (rev 90669)
@@ -354,14 +354,20 @@
* @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 );
}
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs