dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1402422
)
Xml: Simplify processing of attributes in Xml::label
author
Ricordisamoa
<ricordisamoa@openmailbox.org>
Wed, 10 Dec 2014 07:43:28 +0000
(07:43 +0000)
committer
Krinkle
<krinklemail@gmail.com>
Wed, 10 Dec 2014 19:40:03 +0000
(19:40 +0000)
Comment inserted by Antoine Musso with
d86a3bc2177f79
.
Also fixed wrong indentation.
Change-Id: I054762929413f90090b446c603b60ed9544c06d1
includes/Xml.php
patch
|
blob
|
history
diff --git
a/includes/Xml.php
b/includes/Xml.php
index
159f711
..
c07ac73
100644
(file)
--- a/
includes/Xml.php
+++ b/
includes/Xml.php
@@
-368,12
+368,10
@@
class Xml {
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 );