Merge "Less wild whitespace"
[lhc/web/wiklou.git] / includes / Licenses.php
index 0cfb047..4d2229f 100644 (file)
@@ -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( /* &nbsp */ "\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;
-       }
-
        /**#@-*/
 
        /**