r23404 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23403‎ | r23404 | r23405 >
Date:20:53, 25 June 2007
Author:robchurch
Status:old
Tags:
Comment:
Xml::monthSelector() -> Allow callers to override the "id" attribute
Modified paths:
  • /trunk/phase3/includes/Xml.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Xml.php
@@ -129,9 +129,10 @@
130130 *
131131 * @param $selected Mixed: the month which should be selected, default ''
132132 * @param $allmonths String: value of a special item denoting all month. Null to not include (default)
 133+ * @param string $id Element identifier
133134 * @return String: Html string containing the month selector
134135 */
135 - public static function monthSelector( $selected = '', $allmonths = null ) {
 136+ public static function monthSelector( $selected = '', $allmonths = null, $id = 'month' ) {
136137 global $wgLang;
137138 $options = array();
138139 if( is_null( $selected ) )
@@ -140,7 +141,7 @@
141142 $options[] = self::option( wfMsg( 'monthsall' ), $allmonths, $selected === $allmonths );
142143 for( $i = 1; $i < 13; $i++ )
143144 $options[] = self::option( $wgLang->getMonthName( $i ), $i, $selected === $i );
144 - return self::openElement( 'select', array( 'id' => 'month', 'name' => 'month' ) )
 145+ return self::openElement( 'select', array( 'id' => $id, 'name' => 'month' ) )
145146 . implode( "\n", $options )
146147 . self::closeElement( 'select' );
147148 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r23407Merged revisions 23203-23405 via svnmerge from...david23:00, 25 June 2007

Status & tagging log