X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FLicenses.php;h=4d2229f0a084793d99b544635d4dc4ba48bc5635;hb=14d53e2f53e151b6be09b014086d7ba96864edae;hp=0cfb047081df873894677d0af783c2740593315c;hpb=22c6ef5ebbacdb2ed17d323944e34c00fc9cd331;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Licenses.php b/includes/Licenses.php index 0cfb047081..4d2229f0a0 100644 --- a/includes/Licenses.php +++ b/includes/Licenses.php @@ -117,10 +117,10 @@ class Licenses extends HTMLFormField { * @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 @@ -130,37 +130,33 @@ class Licenses extends HTMLFormField { $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; - } - /**#@-*/ /**