From: Siebrand Mazeland Date: Wed, 23 Apr 2014 19:40:20 +0000 (+0200) Subject: Pass phpcs-strict on skins/ X-Git-Tag: 1.31.0-rc.0~16049^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/journal.php?a=commitdiff_plain;h=75145452f9a80872377fc91299a9a29384fdb0ed;p=lhc%2Fweb%2Fwiklou.git Pass phpcs-strict on skins/ Change-Id: I2116e02445e292fdf54ac052a6b5bd82f9a79955 --- diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 3b534687a8..bd8a6776ac 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -31,9 +31,10 @@ if ( !defined( 'MEDIAWIKI' ) ) { * @ingroup Skins */ class SkinCologneBlue extends SkinTemplate { - var $skinname = 'cologneblue', $stylename = 'cologneblue', - $template = 'CologneBlueTemplate'; - var $useHeadElement = true; + public $skinname = 'cologneblue'; + public $stylename = 'cologneblue'; + public $template = 'CologneBlueTemplate'; + public $useHeadElement = true; /** * @param OutputPage $out @@ -155,7 +156,11 @@ class CologneBlueTemplate extends BaseTemplate { $navlink['text'] = wfMessage( $message )->escaped(); } - return $this->makeListItem( $key, $this->processNavlinkForDocument( $navlink ), array( 'tag' => 'span' ) ); + return $this->makeListItem( + $key, + $this->processNavlinkForDocument( $navlink ), + array( 'tag' => 'span' ) + ); } function bottomLinks() { @@ -170,10 +175,22 @@ class CologneBlueTemplate extends BaseTemplate { $editLinkMessage = $this->getSkin()->getTitle()->exists() ? 'editthispage' : 'create-this-page'; $element[] = $this->processBottomLink( 'edit', $content_nav['views']['edit'], $editLinkMessage ); - $element[] = $this->processBottomLink( 'viewsource', $content_nav['views']['viewsource'], 'viewsource' ); - - $element[] = $this->processBottomLink( 'watch', $content_nav['actions']['watch'], 'watchthispage' ); - $element[] = $this->processBottomLink( 'unwatch', $content_nav['actions']['unwatch'], 'unwatchthispage' ); + $element[] = $this->processBottomLink( + 'viewsource', + $content_nav['views']['viewsource'], + 'viewsource' + ); + + $element[] = $this->processBottomLink( + 'watch', + $content_nav['actions']['watch'], + 'watchthispage' + ); + $element[] = $this->processBottomLink( + 'unwatch', + $content_nav['actions']['unwatch'], + 'unwatchthispage' + ); $element[] = $this->talkLink(); @@ -190,11 +207,27 @@ class CologneBlueTemplate extends BaseTemplate { // Second row. Privileged actions. $element = array(); - $element[] = $this->processBottomLink( 'delete', $content_nav['actions']['delete'], 'deletethispage' ); - $element[] = $this->processBottomLink( 'undelete', $content_nav['actions']['undelete'], 'undeletethispage' ); - - $element[] = $this->processBottomLink( 'protect', $content_nav['actions']['protect'], 'protectthispage' ); - $element[] = $this->processBottomLink( 'unprotect', $content_nav['actions']['unprotect'], 'unprotectthispage' ); + $element[] = $this->processBottomLink( + 'delete', + $content_nav['actions']['delete'], + 'deletethispage' + ); + $element[] = $this->processBottomLink( + 'undelete', + $content_nav['actions']['undelete'], + 'undeletethispage' + ); + + $element[] = $this->processBottomLink( + 'protect', + $content_nav['actions']['protect'], + 'protectthispage' + ); + $element[] = $this->processBottomLink( + 'unprotect', + $content_nav['actions']['unprotect'], + 'unprotectthispage' + ); $element[] = $this->processBottomLink( 'move', $content_nav['actions']['move'], 'movethispage' ); @@ -241,8 +274,9 @@ class CologneBlueTemplate extends BaseTemplate { $message = $companionTitle->isTalkPage() ? 'talkpage' : 'articlepage'; } - // Obviously this can't be reasonable and just return the key for talk namespace, only for content ones. - // Thus we have to mangle it in exactly the same way SkinTemplate does. (bug 40805) + // Obviously this can't be reasonable and just return the key for talk + // namespace, only for content ones. Thus we have to mangle it in + // exactly the same way SkinTemplate does. (bug 40805) $key = $companionTitle->getNamespaceKey( '' ); if ( $companionTitle->isTalkPage() ) { $key = ( $key == 'main' ? 'talk' : $key . "_talk" ); @@ -255,12 +289,13 @@ class CologneBlueTemplate extends BaseTemplate { /** * Takes a navigational link generated by SkinTemplate in whichever way - * and mangles attributes unsuitable for repeated use. In particular, this modifies the ids - * and removes the accesskeys. This is necessary to be able to use the same navlink twice, - * e.g. in sidebar and in footer. + * and mangles attributes unsuitable for repeated use. In particular, this + * modifies the ids and removes the accesskeys. This is necessary to be + * able to use the same navlink twice, e.g. in sidebar and in footer. * * @param array $navlink Navigational link generated by SkinTemplate - * @param mixed $idPrefix Prefix to add to id of this navlink. If false, id is removed entirely. Default is 'cb-'. + * @param mixed $idPrefix Prefix to add to id of this navlink. If false, id + * is removed entirely. Default is 'cb-'. */ function processNavlinkForDocument( $navlink, $idPrefix = 'cb-' ) { if ( $navlink['id'] ) { @@ -296,28 +331,50 @@ class CologneBlueTemplate extends BaseTemplate { getSkin()->getCategories() ?> - data['newtalk'] ) { ?> -
data['newtalk'] ?>
- + data['newtalk'] ) { + ?> +
data['newtalk'] ?>
+
- getSkin()->getSiteNotice() ) { ?> -
getSkin()->getSiteNotice() ?>
- + getSkin()->getSiteNotice() ) { + ?> +
getSkin()->getSiteNotice() ?>
+

data['title'] ?>

- translator->translate( 'tagline' ) ) { ?> -

translator->translate( 'tagline' ) ) ?>

- - getSkin()->getOutput()->getSubtitle() ) { ?> -

getSkin()->getOutput()->getSubtitle() ?>

- - getSkin()->subPageSubtitle() ) { ?> -

getSkin()->subPageSubtitle() ?>

- + translator->translate( 'tagline' ) ) { + ?> +

translator->translate( 'tagline' ) ) + ?>

+ + getSkin()->getOutput()->getSubtitle() ) { + ?> +

getSkin()->getOutput()->getSubtitle() ?>

+ + getSkin()->subPageSubtitle() ) { + ?> +

getSkin()->subPageSubtitle() ?>

+ data['content_navigation']; $qbpageoptions = array_merge( $content_navigation['namespaces'], @@ -513,7 +571,11 @@ class CologneBlueTemplate extends BaseTemplate { foreach ( $bar as $heading => $data ) { $portletId = Sanitizer::escapeId( "p-$heading" ); $headingMsg = wfMessage( $idToMessage[$heading] ? $idToMessage[$heading] : $heading ); - $headingHTML = "

" . ( $headingMsg->exists() ? $headingMsg->escaped() : htmlspecialchars( $heading ) ) . "

"; + $headingHTML = "

"; + $headingHTML .= $headingMsg->exists() + ? $headingMsg->escaped() + : htmlspecialchars( $heading ); + $headingHTML .= "

"; $listHTML = ""; if ( is_array( $data ) ) { @@ -534,7 +596,8 @@ class CologneBlueTemplate extends BaseTemplate { if ( $listHTML ) { $role = ( $heading == 'search' ) ? 'search' : 'navigation'; - $s .= "
\n$headingHTML\n$listHTML\n
\n"; + $s .= "
\n$headingHTML\n$listHTML\n
\n"; } $s .= $this->renderAfterPortlet( $heading ); @@ -553,19 +616,25 @@ class CologneBlueTemplate extends BaseTemplate { $search = $this->getSkin()->getRequest()->getText( 'search' ); $action = $this->data['searchaction']; - $s = "
"; + $s = ""; if ( $which == 'footer' ) { $s .= wfMessage( 'qbfind' )->text() . ": "; } - $s .= $this->makeSearchInput( array( 'class' => 'mw-searchInput', 'type' => 'text', 'size' => '14' ) ); + $s .= $this->makeSearchInput( array( + 'class' => 'mw-searchInput', + 'type' => 'text', + 'size' => '14' + ) ); $s .= ( $which == 'footer' ? " " : "
" ); $s .= $this->makeSearchButton( 'go', array( 'class' => 'searchButton' ) ); if ( $wgUseTwoButtonsSearchForm ) { $s .= $this->makeSearchButton( 'fulltext', array( 'class' => 'searchButton' ) ); } else { - $s .= '
\n"; + $s .= '
\n"; } $s .= '
'; diff --git a/skins/Modern.php b/skins/Modern.php index 81c0f515fb..28e918ee00 100644 --- a/skins/Modern.php +++ b/skins/Modern.php @@ -32,8 +32,10 @@ if ( !defined( 'MEDIAWIKI' ) ) { * @ingroup Skins */ class SkinModern extends SkinTemplate { - var $skinname = 'modern', $stylename = 'modern', - $template = 'ModernTemplate', $useHeadElement = true; + public $skinname = 'modern'; + public $stylename = 'modern'; + public $template = 'ModernTemplate'; + public $useHeadElement = true; /** * @param OutputPage $out @@ -85,22 +87,45 @@ class ModernTemplate extends MonoBookTemplate {
msg( 'tagline' ) ?>
- data['newtalk'] ) { - ?>
html( 'newtalk' ) ?>
- - data['sitenotice'] ) { + data['newtalk'] ) { + ?>
html( 'newtalk' ) ?>
+ + data['sitenotice'] ) { ?>
html( 'sitenotice' ) ?>
- +
-
html( 'userlangattributes' ) ?>>html( 'subtitle' ) ?>
- - data['undelete'] ) { ?>
html( 'undelete' ) ?>
-
msg( 'jumpto' ) ?> msg( 'jumptonavigation' ) ?>msg( 'comma-separator' ) ?>msg( 'jumptosearch' ) ?>
+
html( 'userlangattributes' ) + ?>>html( 'subtitle' ) + ?>
+ + data['undelete'] ) { + ?>
html( 'undelete' ) ?>
+
msg( 'jumpto' ) ?> + msg( 'jumptonavigation' ) ?>msg( 'comma-separator' ) + ?> + msg( 'jumptosearch' ) ?> +
html( 'bodytext' ) ?>
- data['catlinks'] ) { $this->html( 'catlinks' ); } ?> + data['catlinks'] ) { + $this->html( 'catlinks' ); + } + ?> html( 'dataAfterContent' ) ?>
@@ -124,10 +149,13 @@ class ModernTemplate extends MonoBookTemplate {

msg( 'personaltools' ) ?>

@@ -140,7 +168,8 @@ class ModernTemplate extends MonoBookTemplate { foreach ( $this->getFooterLinks( "flat" ) as $aLink ) { if ( isset( $this->data[$aLink] ) && $this->data[$aLink] ) { ?> - diff --git a/skins/MonoBook.php b/skins/MonoBook.php index fe6a25f114..a64e9d00c4 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -36,8 +36,10 @@ if ( !defined( 'MEDIAWIKI' ) ) { */ class SkinMonoBook extends SkinTemplate { /** Using monobook. */ - var $skinname = 'monobook', $stylename = 'monobook', - $template = 'MonoBookTemplate', $useHeadElement = true; + public $skinname = 'monobook'; + public $stylename = 'monobook'; + public $template = 'MonoBookTemplate'; + public $useHeadElement = true; /** * @param OutputPage $out @@ -76,7 +78,13 @@ class MonoBookTemplate extends BaseTemplate { ?>
- data['sitenotice'] ) { ?>
html( 'sitenotice' ) ?>
+ data['sitenotice'] ) { + ?>
html( 'sitenotice' ) + ?>

html( 'title' ) ?>

msg( 'tagline' ) ?>
-
html( 'userlangattributes' ) ?>>html( 'subtitle' ) ?>
+
html( 'userlangattributes' ) ?>>html( 'subtitle' ) + ?>
data['undelete'] ) { ?>
html( 'undelete' ) ?>
-data['newtalk'] ) { ?> +data['newtalk'] ) { + ?>
html( 'newtalk' ) ?>
- -
msg( 'jumpto' ) ?> msg( 'jumptonavigation' ) ?>msg( 'comma-separator' ) ?>msg( 'jumptosearch' ) ?>
+ +
msg( 'jumpto' ) + ?> msg( 'jumptonavigation' ) + ?>msg( 'comma-separator' ) + ?>msg( 'jumptosearch' ) + ?>
html( 'bodytext' ) ?> - data['catlinks'] ) { $this->html( 'catlinks' ); } ?> + data['catlinks'] ) { + $this->html( 'catlinks' ); + } + ?> - data['dataAfterContent'] ) { $this->html( 'dataAfterContent' ); } ?> + data['dataAfterContent'] ) { + $this->html( 'dataAfterContent' + ); + } + ?>
@@ -110,7 +143,9 @@ class MonoBookTemplate extends BaseTemplate { getPersonalTools() as $key => $item ) { ?> makeListItem( $key, $item ); ?> - +
@@ -138,15 +173,18 @@ class MonoBookTemplate extends BaseTemplate { } else { $footerEnd = ''; } + foreach ( $validFooterIcons as $blockName => $footerIcons ) { ?>
getSkin()->makeFooterIcon( $icon ); ?> -
- 0 ) { ?> - @@ -212,12 +252,22 @@ echo $footerEnd; makeSearchInput( array( "id" => "searchInput" ) ); ?> - makeSearchButton( "go", array( "id" => "searchGoButton", "class" => "searchButton" ) ); + makeSearchButton( + "go", + array( "id" => "searchGoButton", "class" => "searchButton" ) + ); + if ( $wgUseTwoButtonsSearchForm ) { ?>  - makeSearchButton( "fulltext", array( "id" => "mw-searchButton", "class" => "searchButton" ) ); + makeSearchButton( + "fulltext", + array( "id" => "mw-searchButton", "class" => "searchButton" ) + ); } else { ?> -
@@ -283,7 +333,9 @@ echo $footerEnd; data['language_urls'] as $key => $langlink ) { ?> makeListItem( $key, $langlink ); ?> - + renderAfterPortlet( 'lang' ); ?> @@ -299,7 +351,12 @@ echo $footerEnd; * @param array|string $cont */ function customBox( $bar, $cont ) { - $portletAttribs = array( 'class' => 'generated-sidebar portlet', 'id' => Sanitizer::escapeId( "p-$bar" ), 'role' => 'navigation' ); + $portletAttribs = array( + 'class' => 'generated-sidebar portlet', + 'id' => Sanitizer::escapeId( "p-$bar" ), + 'role' => 'navigation' + ); + $tooltip = Linker::titleAttrib( "p-$bar" ); if ( $tooltip !== false ) { $portletAttribs['title'] = $tooltip; @@ -310,17 +367,24 @@ echo $footerEnd;

exists() ? $msgObj->text() : $bar ); ?>

- + -renderAfterPortlet( $bar ); ?> diff --git a/skins/Vector.php b/skins/Vector.php index 8ede82a2e0..e412c9ce59 100644 --- a/skins/Vector.php +++ b/skins/Vector.php @@ -32,12 +32,13 @@ if ( !defined( 'MEDIAWIKI' ) ) { * @ingroup Skins */ class SkinVector extends SkinTemplate { + public $useHeadElement = true; + public $skinname = 'vector'; + public $stylename = 'vector'; + public $template = 'VectorTemplate'; protected static $bodyClasses = array( 'vector-animateLayout' ); - var $skinname = 'vector', $stylename = 'vector', - $template = 'VectorTemplate', $useHeadElement = true; - /** * Initializes output page and sets up skin-specific parameters * @param OutputPage $out Object to initialize @@ -92,7 +93,6 @@ class SkinVector extends SkinTemplate { * @ingroup Skins */ class VectorTemplate extends BaseTemplate { - /* Functions */ /** @@ -105,7 +105,10 @@ class VectorTemplate extends BaseTemplate { $nav = $this->data['content_navigation']; if ( $wgVectorUseIconWatch ) { - $mode = $this->getSkin()->getUser()->isWatched( $this->getSkin()->getRelevantTitle() ) ? 'unwatch' : 'watch'; + $mode = $this->getSkin()->getUser()->isWatched( $this->getSkin()->getRelevantTitle() ) + ? 'unwatch' + : 'watch'; + if ( isset( $nav['actions'][$mode] ) ) { $nav['views'][$mode] = $nav['actions'][$mode]; $nav['views'][$mode]['class'] = rtrim( 'icon ' . $nav['views'][$mode]['class'], ' ' ); @@ -160,42 +163,81 @@ class VectorTemplate extends BaseTemplate {
- data['sitenotice'] ) { ?> + data['sitenotice'] ) { + ?>
html( 'sitenotice' ) ?>
- +

html( 'title' ) ?>

html( 'prebodyhtml' ) ?>
- data['isarticle'] ) { ?> + data['isarticle'] ) { + ?>
msg( 'tagline' ) ?>
- -
html( 'userlangattributes' ) ?>>html( 'subtitle' ) ?>
- data['undelete'] ) { ?> + +
html( 'userlangattributes' ) + ?>>html( 'subtitle' ) ?>
+ data['undelete'] ) { + ?>
html( 'undelete' ) ?>
- - data['newtalk'] ) { ?> + + data['newtalk'] ) { + ?>
html( 'newtalk' ) ?>
- +
msg( 'jumpto' ) ?> - msg( 'jumptonavigation' ) ?>msg( 'comma-separator' ) ?> + msg( 'jumptonavigation' ) + ?>msg( 'comma-separator' ) + ?> msg( 'jumptosearch' ) ?>
html( 'bodycontent' ) ?> - data['printfooter'] ) { ?> + data['printfooter'] ) { + ?>
html( 'printfooter' ); ?>
- - data['catlinks'] ) { ?> - html( 'catlinks' ); ?> - - data['dataAfterContent'] ) { ?> - html( 'dataAfterContent' ); ?> - + + data['catlinks'] ) { + ?> + html( 'catlinks' ); + ?> + + data['dataAfterContent'] ) { + ?> + html( 'dataAfterContent' ); + ?> +
html( 'debughtml' ); ?>
@@ -212,31 +254,66 @@ class VectorTemplate extends BaseTemplate {
- + renderPortals( $this->data['sidebar'] ); ?>
printTrail(); ?> @@ -298,8 +375,18 @@ class VectorTemplate extends BaseTemplate { } $msgObj = wfMessage( $msg ); ?> -