* @param $depth int
*/
protected function makeHtml( $tagset, $depth = 0 ) {
- foreach ( $tagset as $key => $val )
+ foreach ( $tagset as $key => $val ) {
if ( is_array( $val ) ) {
$this->html .= $this->outputOption(
- $this->msg( $key ), '',
+ $key, '',
array(
'disabled' => 'disabled',
'style' => 'color: GrayText', // for MSIE
$this->makeHtml( $val, $depth + 1 );
} else {
$this->html .= $this->outputOption(
- $this->msg( $val->text ), $val->template,
+ $val->text, $val->template,
array( 'title' => '{{' . $val->template . '}}' ),
$depth
);
}
+ }
}
/**
- * @param $text
+ * @param $message
* @param $value
* @param $attribs null
* @param $depth int
* @return string
*/
- protected function outputOption( $text, $value, $attribs = null, $depth = 0 ) {
+ protected function outputOption( $message, $value, $attribs = null, $depth = 0 ) {
+ $msgObj = $this->msg( $message );
+ $text = $msgObj->exists() ? $msgObj->text() : $message;
$attribs['value'] = $value;
- if ( $value === $this->selected )
+ if ( $value === $this->selected ) {
$attribs['selected'] = 'selected';
+ }
+
$val = str_repeat( /*   */ "\xc2\xa0", $depth * 2 ) . $text;
return str_repeat( "\t", $depth ) . Xml::element( 'option', $attribs, $val ) . "\n";
}
- /**
- * @param $str string
- * @return String
- */
- protected function msg( $str ) {
- $msg = wfMessage( $str );
- return $msg->exists() ? $msg->text() : $str;
- }
-
/**#@-*/
/**
/**
* Constructor
*
- * @param $str String: license name??
+ * @param string $str license name??
*/
function __construct( $str ) {
list( $text, $template ) = explode( '|', strrev( $str ), 2 );