Added post-commit callback support to DB classes.
[lhc/web/wiklou.git] / includes / Licenses.php
index 0cfb047..ba504a9 100644 (file)
@@ -120,7 +120,7 @@ class Licenses extends HTMLFormField {
                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,7 +130,7 @@ 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
                                );
@@ -138,13 +138,15 @@ class Licenses extends HTMLFormField {
        }
 
        /**
-        * @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 )
                        $attribs['selected'] = 'selected';
@@ -152,15 +154,6 @@ class Licenses extends HTMLFormField {
                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;
-       }
-
        /**#@-*/
 
        /**