$attribs = array_map( array( 'UtfNormal', 'cleanUp' ), $attribs );
}
if ( $contents ) {
- wfProfileIn( __METHOD__ . '-norm' );
$contents = $wgContLang->normalize( $contents );
- wfProfileOut( __METHOD__ . '-norm' );
}
return self::element( $element, $attribs, $contents );
}
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'];
+ foreach ( array( 'class', 'title' ) as $attr ) {
+ if ( isset( $attribs[$attr] ) ) {
+ $a[$attr] = $attribs[$attr];
+ }
}
return self::element( 'label', $a, $label );