From: Rob Church Date: Mon, 25 Jun 2007 20:53:40 +0000 (+0000) Subject: Xml::monthSelector() -> Allow callers to override the "id" attribute X-Git-Tag: 1.31.0-rc.0~52398 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=b48153b986d1cf4c4634424d7ce2507ff5f34131;p=lhc%2Fweb%2Fwiklou.git Xml::monthSelector() -> Allow callers to override the "id" attribute --- diff --git a/includes/Xml.php b/includes/Xml.php index c5c60cb020..94d04b8360 100644 --- a/includes/Xml.php +++ b/includes/Xml.php @@ -129,9 +129,10 @@ class Xml { * * @param $selected Mixed: the month which should be selected, default '' * @param $allmonths String: value of a special item denoting all month. Null to not include (default) + * @param string $id Element identifier * @return String: Html string containing the month selector */ - public static function monthSelector( $selected = '', $allmonths = null ) { + public static function monthSelector( $selected = '', $allmonths = null, $id = 'month' ) { global $wgLang; $options = array(); if( is_null( $selected ) ) @@ -140,7 +141,7 @@ class Xml { $options[] = self::option( wfMsg( 'monthsall' ), $allmonths, $selected === $allmonths ); for( $i = 1; $i < 13; $i++ ) $options[] = self::option( $wgLang->getMonthName( $i ), $i, $selected === $i ); - return self::openElement( 'select', array( 'id' => 'month', 'name' => 'month' ) ) + return self::openElement( 'select', array( 'id' => $id, 'name' => 'month' ) ) . implode( "\n", $options ) . self::closeElement( 'select' ); }