- function Licenses( $str = null ) {
- // PHP sucks, this should be possible in the constructor
-
- global $wgLanguageCode ;
- if ( is_null( $str ) ) {
- # Try for language-localized license list; if not, try the deault
- $t = 'licenses/'.$wgLanguageCode ;
- $s = wfMsgForContent( $t ) ;
- if ( $s == '<'.$t.'>' )
- $t = wfMsgForContent( 'licenses' ) ;
- $this->msg = $s ;
- } else {
- # Use passed string
- $this->msg = $str ;
- }
-# $this->msg = is_null( $str ) ? wfMsgForContent( 'licenses' ) : $str; # Old code, do not use!
- $this->html = '';
+ public function __construct( $params ) {
+ parent::__construct( $params );
+
+ $this->msg = empty( $params['licenses'] ) ? wfMsgForContent( 'licenses' ) : $params['licenses'];
+ $this->selected = null;