X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2FLicenses.php;h=e76ac23c8342221232661348eb1bfdd4117cf8bf;hb=817fd9632c8765ac4c2e8c6243505380354c9feb;hp=a2cbcc92214ca9bc5d30b04f6b81bafef4449525;hpb=a26d5a49d755ff4b8039b11d1f26abb5d7bc7e8c;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/Licenses.php b/includes/Licenses.php index a2cbcc9221..e76ac23c83 100644 --- a/includes/Licenses.php +++ b/includes/Licenses.php @@ -2,8 +2,7 @@ /** * A License class for use on Special:Upload * - * @package MediaWiki - * @subpackage SpecialPage + * @ingroup SpecialPage * * @author Ævar Arnfjörð Bjarmason * @copyright Copyright © 2005, Ævar Arnfjörð Bjarmason @@ -12,7 +11,7 @@ class Licenses { /**#@+ - * @access private + * @private */ /** * @var string @@ -31,12 +30,12 @@ class Licenses { /**#@-*/ /** - * Constrictor + * Constructor * - * @param string $str The string to build the licenses member from, will use + * @param $str String: the string to build the licenses member from, will use * wfMsgForContent( 'licenses' ) if null (default: null) */ - function Licenses( $str = null ) { + function __construct( $str = null ) { // PHP sucks, this should be possible in the constructor $this->msg = is_null( $str ) ? wfMsgForContent( 'licenses' ) : $str; $this->html = ''; @@ -47,7 +46,7 @@ class Licenses { } /**#@+ - * @access private + * @private */ function makeLicenses() { $levels = array(); @@ -63,12 +62,14 @@ class Licenses { $obj = new License( $line ); $this->stackItem( $this->licenses, $levels, $obj ); } else { - if ( $level < count( $levels ) ) + if ( $level < count( $levels ) ) { $levels = array_slice( $levels, 0, $level ); - if ( $level == count( $levels ) ) + } + if ( $level == count( $levels ) ) { $levels[$level - 1] = $line; - else if ( $level > count( $levels ) ) + } else if ( $level > count( $levels ) ) { $levels[] = $line; + } } } } @@ -145,6 +146,9 @@ class Licenses { function getHtml() { return $this->html; } } +/** + * A License class for use on Special:Upload (represents a single type of license). + */ class License { /** * @var string @@ -159,7 +163,7 @@ class License { /** * Constructor * - * @param string $str + * @param $str String: license name?? */ function License( $str ) { list( $text, $template ) = explode( '|', strrev( $str ), 2 ); @@ -168,4 +172,3 @@ class License { $this->text = strrev( $text ); } } -?>