summaryrefslogtreecommitdiff
path: root/includes/Licenses.php
diff options
context:
space:
mode:
authorPierre Schmitz <pierre@archlinux.de>2011-06-22 11:28:20 +0200
committerPierre Schmitz <pierre@archlinux.de>2011-06-22 11:28:20 +0200
commit9db190c7e736ec8d063187d4241b59feaf7dc2d1 (patch)
tree46d1a0dee7febef5c2d57a9f7b972be16a163b3d /includes/Licenses.php
parent78677c7bbdcc9739f6c10c75935898a20e1acd9e (diff)
update to MediaWiki 1.17.0
Diffstat (limited to 'includes/Licenses.php')
-rw-r--r--includes/Licenses.php14
1 files changed, 6 insertions, 8 deletions
diff --git a/includes/Licenses.php b/includes/Licenses.php
index 12a1f938..45944c73 100644
--- a/includes/Licenses.php
+++ b/includes/Licenses.php
@@ -31,7 +31,7 @@ class Licenses extends HTMLFormField {
*/
public function __construct( $params ) {
parent::__construct( $params );
-
+
$this->msg = empty( $params['licenses'] ) ? wfMsgForContent( 'licenses' ) : $params['licenses'];
$this->selected = null;
@@ -69,8 +69,6 @@ class Licenses extends HTMLFormField {
}
protected function trimStars( $str ) {
- $i = $count = 0;
-
$numStars = strspn( $str, '*' );
return array( $numStars, ltrim( substr( $str, $numStars ), ' ' ) );
}
@@ -107,7 +105,7 @@ class Licenses extends HTMLFormField {
protected function outputOption( $text, $value, $attribs = null, $depth = 0 ) {
$attribs['value'] = $value;
if ( $value === $this->selected )
- $attribs['selected'] = 'selected';
+ $attribs['selected'] = 'selected';
$val = str_repeat( /* &nbsp */ "\xc2\xa0", $depth * 2 ) . $text;
return str_repeat( "\t", $depth ) . Xml::element( 'option', $attribs, $val ) . "\n";
}
@@ -133,18 +131,18 @@ class Licenses extends HTMLFormField {
*/
public function getInputHTML( $value ) {
$this->selected = $value;
-
+
$this->html = $this->outputOption( wfMsg( 'nolicense' ), '',
(bool)$this->selected ? null : array( 'selected' => 'selected' ) );
$this->makeHtml( $this->getLicenses() );
-
+
$attribs = array(
'name' => $this->mName,
'id' => $this->mID
);
if ( !empty( $this->mParams['disabled'] ) )
$attibs['disabled'] = 'disabled';
-
+
return Html::rawElement( 'select', $attribs, $this->html );
}
}
@@ -168,7 +166,7 @@ class License {
*
* @param $str String: license name??
*/
- function License( $str ) {
+ function __construct( $str ) {
list( $text, $template ) = explode( '|', strrev( $str ), 2 );
$this->template = strrev( $template );