Foxtrott has uploaded a new change for review.
https://gerrit.wikimedia.org/r/89489
Change subject: Mostly code styling
......................................................................
Mostly code styling
Change-Id: I1c6243e77993f83e4106f23634e20b3f4a656d7f
---
M Chameleon.skin.php
D Hooks.php
M chameleon.php
M components/Component.php
M components/FooterIcons.php
M components/FooterInfo.php
M components/FooterPlaces.php
M components/Logo.php
M components/MainContent.php
M components/NavbarHorizontal.php
M components/NewtalkNotifier.php
M components/PersonalTools.php
M components/SearchForm.php
M components/SiteNotice.php
M components/TabList.php
M components/ToolbarHorizontal.php
16 files changed, 124 insertions(+), 163 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/chameleon
refs/changes/89/89489/1
diff --git a/Chameleon.skin.php b/Chameleon.skin.php
index 8274067..54c9a65 100644
--- a/Chameleon.skin.php
+++ b/Chameleon.skin.php
@@ -41,10 +41,11 @@
* @param $out OutputPage object
*/
function setupSkinUserCss( OutputPage $out ) {
+
parent::setupSkinUserCss( $out );
// load Bootstrap styles
- $out->addModuleStyles( 'ext.bootstrap.styles' );
+ $out->addModuleStyles( 'ext.bootstrap' );
$out->addModuleStyles( 'skins.chameleon' );
}
@@ -56,7 +57,7 @@
parent::initPage( $out );
// load Bootstrap scripts
- $out->addModules( array( 'ext.bootstrap.scripts' ) );
+ $out->addModules( array( 'ext.bootstrap' ) );
}
}
@@ -65,7 +66,6 @@
namespace skins\chameleon {
use BaseTemplate;
- use Html, Linker, Sanitizer;
/**
* BaseTemplate class for Chameleon skin
@@ -78,6 +78,7 @@
* Outputs the entire contents of the page
*/
public function execute() {
+
// Suppress warnings to prevent notices about missing
indexes in $this->data
wfSuppressWarnings();
@@ -86,6 +87,7 @@
// To add attributes or classes to the body tag
override addToBodyAttributes() in SkinChameleon
$this->html( 'headelement' );
?>
+
<div class="container">
<div class="row">
@@ -96,14 +98,12 @@
<div class="col-lg-9 col-md-9 col-sm-9">
<div class="row">
- <div class="col-lg-12">
- <?php
$component = new components\PersonalTools( $this, 8 ); echo
$component->getHtml(); ?>
+ <div
class="col-lg-12"><?php $component = new components\PersonalTools( $this, 8 );
echo $component->getHtml(); ?>
</div>
</div>
<div class="row">
- <div class="col-lg-12">
- <?php
$component = new components\SearchForm( $this, 8 ); echo $component->getHtml();
?>
+ <div
class="col-lg-12"><?php $component = new components\SearchForm( $this, 8 );
echo $component->getHtml(); ?>
</div>
</div>
@@ -149,9 +149,10 @@
</div>
</div>
- <?php $this->printTrail(); ?>
- </body>
- </html><?php
+<?php $this->printTrail(); ?>
+
+</body>
+</html><?php
wfRestoreWarnings();
}
diff --git a/Hooks.php b/Hooks.php
deleted file mode 100644
index d301a11..0000000
--- a/Hooks.php
+++ /dev/null
@@ -1,57 +0,0 @@
-<?php
-/**
- * File holding the Hooks class
- *
- * @copyright (C) 2013, Stephan Gambke
- * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
- *
- * This file is part of the MediaWiki extension Chameleon.
- * The Chameleon extension is free software: you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * The Chameleon extension is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- * @file
- * @ingroup Chameleon
- */
-
-namespace skins\chameleon;
-use \RequestContext;
-
-/**
- * The Hooks class.
- *
- * @ingroup Chameleon
- */
-class Hooks {
-
- /**
- * Hook handler to enable the Bootstrap extension
- *
- * @global boolean $wgEnableBootstrap
- *
- * @param \Title $title
- * @param \Article $article
- * @param \OutputPage $output
- * @param \User $user
- * @param \WebRequest $request
- * @param \MediaWiki $mediaWiki
- *
- * @return boolean
- */
- static public function onBeforeInitialize( &$title, &$article,
&$output, &$user, $request, $mediaWiki ) {
-
- // do some Bootstrap initialization here
-
- return true;
- }
-
-}
diff --git a/chameleon.php b/chameleon.php
index 178c1f7..39169cc 100644
--- a/chameleon.php
+++ b/chameleon.php
@@ -57,9 +57,6 @@
// register skin
$wgValidSkinNames['chameleon'] = 'Chameleon';
-// register hook handlers
-$wgHooks['BeforeInitialize'][] =
'\\skins\\chameleon\\Hooks::onBeforeInitialize';
-
// register skin class (must be 'Skin' . SkinName)
$wgAutoloadClasses['SkinChameleon'] = dirname( __FILE__ ) .
'/Chameleon.skin.php';
@@ -79,9 +76,6 @@
'MainContent',
);
-// register other classes
-$wgAutoloadClasses['skins\\chameleon\\Hooks'] = dirname( __FILE__ ) .
'/Hooks.php';
-
foreach ( $chameleonComponents as $component ) {
$wgAutoloadClasses['skins\\chameleon\\components\\' . $component] =
dirname( __FILE__ ) . '/components/' . $component. '.php';
}
@@ -97,3 +91,6 @@
'remoteBasePath' => &$GLOBALS['wgStylePath'],
'localBasePath' => &$GLOBALS['wgStyleDirectory'],
);
+
+// register Bootstrap modules (for now, just register everything)
+Bootstrap::getBootstrap()->addAllBootstrapModules();
diff --git a/components/Component.php b/components/Component.php
index f1b78e5..e05ce82 100644
--- a/components/Component.php
+++ b/components/Component.php
@@ -3,7 +3,7 @@
* File containing the Component class
*
* @copyright (C) 2013, Stephan Gambke
- * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
*
* This file is part of the MediaWiki skin Chameleon.
* The Chameleon skin is free software: you can redistribute it and/or
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @file
- * @ingroup Skins
+ * @ingroup Skins
*/
namespace skins\chameleon\components;
@@ -38,34 +38,26 @@
private $mIndent = 0;
public function __construct( ChameleonTemplate $template, $indent = 0 )
{
+
$this->mSkinTemplate = $template;
- $this->mIndent = $indent;
+ $this->mIndent = $indent;
}
/**
* @return ChameleonTemplate
*/
public function getSkinTemplate() {
+
return $this->mSkinTemplate;
}
-
- /**
- * Adds $indent to (or subtracts from if negative) the current
indentation level.
- * Inserts a new line and a number of tabs according to the new
indentation level.
- *
- * @param int $indent
- *
- * @return string
- */protected function indent ( $indent = 0 ) {
- $this->mIndent += $indent;
- return "\n" . str_repeat("\t", $this->mIndent );
-}
/**
* Returns the current indentation level
*
* @return int
- */public function getIndent() {
+ */
+ public function getIndent() {
+
return $this->mIndent;
}
@@ -76,4 +68,19 @@
*/
abstract public function getHtml();
+ /**
+ * Adds $indent to (or subtracts from if negative) the current
indentation level.
+ * Inserts a new line and a number of tabs according to the new
indentation level.
+ *
+ * @param int $indent
+ *
+ * @return string
+ */
+ protected function indent( $indent = 0 ) {
+
+ $this->mIndent += $indent;
+
+ return "\n" . str_repeat( "\t", $this->mIndent );
+ }
+
}
diff --git a/components/FooterIcons.php b/components/FooterIcons.php
index 491f350..bc1c663 100644
--- a/components/FooterIcons.php
+++ b/components/FooterIcons.php
@@ -3,7 +3,7 @@
* File holding the FooterIcons class
*
* @copyright (C) 2013, Stephan Gambke
- * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
*
* This file is part of the MediaWiki extension Chameleon.
* The Chameleon extension is free software: you can redistribute it and/or
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @file
- * @ingroup Chameleon
+ * @ingroup Chameleon
*/
/**
@@ -56,7 +56,8 @@
$ret .= $this->indent() . '<!-- ' .
htmlspecialchars( $blockName ) . ' -->';
foreach ( $footerIcons as $icon ) {
- $ret .= $this->indent() . '<li>' .
$this->getSkinTemplate()->getSkin()->makeFooterIcon( $icon ) . '</li>';
+ $ret .= $this->indent() . '<li>' .
+
$this->getSkinTemplate()->getSkin()->makeFooterIcon( $icon ) . '</li>';
}
}
diff --git a/components/FooterInfo.php b/components/FooterInfo.php
index a99b4c8..442690c 100644
--- a/components/FooterInfo.php
+++ b/components/FooterInfo.php
@@ -3,7 +3,7 @@
* File holding the FooterInfo class
*
* @copyright (C) 2013, Stephan Gambke
- * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
*
* This file is part of the MediaWiki extension Chameleon.
* The Chameleon extension is free software: you can redistribute it and/or
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @file
- * @ingroup Chameleon
+ * @ingroup Chameleon
*/
namespace skins\chameleon\components;
diff --git a/components/FooterPlaces.php b/components/FooterPlaces.php
index f6ee261..81f89f7 100644
--- a/components/FooterPlaces.php
+++ b/components/FooterPlaces.php
@@ -3,7 +3,7 @@
* File holding the FooterPlaces class
*
* @copyright (C) 2013, Stephan Gambke
- * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
*
* This file is part of the MediaWiki extension Chameleon.
* The Chameleon extension is free software: you can redistribute it and/or
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @file
- * @ingroup Chameleon
+ * @ingroup Chameleon
*/
namespace skins\chameleon\components;
@@ -42,7 +42,7 @@
*/
public function getHtml() {
- $ret = null;
+ $ret = null;
$footerlinks = $this->getSkinTemplate()->getFooterLinks();
if ( array_key_exists( 'places', $footerlinks ) ) {
@@ -50,11 +50,11 @@
$ret = $this->indent() . '<!-- places -->' .
$this->indent() . '<ul class="list-inline
footer-places" id="footer-places">';
- $this->indent(1);
- foreach ( $footerlinks['places'] as $key ) {
+ $this->indent( 1 );
+ foreach ( $footerlinks[ 'places' ] as $key ) {
$ret .= $this->indent() . '<li><small>' .
$this->getSkinTemplate()->get( $key ) . '</small></li>';
}
- $ret .= $this->indent(-1) . '</ul>' . "\n";
+ $ret .= $this->indent( -1 ) . '</ul>' . "\n";
}
return $ret;
diff --git a/components/Logo.php b/components/Logo.php
index 6e6f54b..81f604b 100644
--- a/components/Logo.php
+++ b/components/Logo.php
@@ -45,7 +45,7 @@
public function getHtml() {
$attribs = array( 'href' => $this->getSkinTemplate()->data[
'nav_urls' ][ 'mainpage' ][ 'href' ] ) + Linker::tooltipAndAccesskeyAttribs(
'p-logo' );
- $contents = Html::element( 'img', array( 'src' =>
$this->getSkinTemplate()->data[ 'logopath' ] ) );
+ $contents = Html::element( 'img', array( 'src' =>
$this->getSkinTemplate()->data[ 'logopath' ], 'alt' => $GLOBALS[ 'wgSitename' ]
) );
return $this->indent() . '<!-- logo and main page link -->' .
$this->indent() . '<div id="p-logo" class="p-logo"
role="banner">' .
diff --git a/components/MainContent.php b/components/MainContent.php
index 52d3b14..7200dc0 100644
--- a/components/MainContent.php
+++ b/components/MainContent.php
@@ -3,7 +3,7 @@
* File holding the MainContent class
*
* @copyright (C) 2013, Stephan Gambke
- * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
*
* This file is part of the MediaWiki extension Chameleon.
* The Chameleon extension is free software: you can redistribute it and/or
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @file
- * @ingroup Chameleon
+ * @ingroup Chameleon
*/
namespace skins\chameleon\components;
@@ -45,12 +45,12 @@
public function getHtml() {
$skintemplate = $this->getSkinTemplate();
-
+
$ret = $this->indent() . '<div id="mw-js-message"
style="display:none;" ' . $skintemplate->get( 'userlangattributes' ) .
'></div>' .
$this->indent() . '<!-- start the content area -->' .
$this->indent() . '<div id="content"
class="mw-body">' .
- $this->indent(1) . '<div class ="contentHeader">' .
- $this->indent(1) . '<!-- title of the page -->' .
+ $this->indent( 1 ) . '<div class ="contentHeader">' .
+ $this->indent( 1 ) . '<!-- title of the page -->' .
$this->indent() . '<h1 id="firstHeading"
class="firstHeading">' . $skintemplate->get( 'title' ) . '</h1>' .
$this->indent() . '<!-- tagline; usually goes
something like "From WikiName" primary purpose of this seems to be for printing
to identify the source of the content -->' .
$this->indent() . '<div id="siteSub" >' .
$skintemplate->getMsg( 'tagline' ) . '</div>';
@@ -61,11 +61,10 @@
}
if ( $skintemplate->data[ 'undelete' ] ) {
- $ret .= $this->indent() . '<!-- undelete message -->' .
- '<div id="contentSub2">' . $skintemplate->get(
'undelete' ) . '</div>';
+ $ret .= $this->indent() . '<!-- undelete message -->' .
'<div id="contentSub2">' . $skintemplate->get( 'undelete' ) . '</div>';
}
- $ret .= $this->indent(-1) . '</div>' .
+ $ret .= $this->indent( -1 ) . '</div>' .
$this->indent() . '<!-- body text -->' . "\n" .
$this->indent() . $skintemplate->get(
'bodytext' ) .
$this->indent() . '<!-- category links -->' .
@@ -73,10 +72,10 @@
if ( $skintemplate->data[ 'dataAfterContent' ] ) {
$ret .= $this->indent() . '<!-- data blocks which
should go somewhere after the body text, but not before the catlinks block-->' .
- $this->indent() . $skintemplate->get(
'dataAfterContent' );
+ $this->indent() . $skintemplate->get(
'dataAfterContent' );
}
- $ret .= $this->indent(-1) . '</div>' . "\n";
+ $ret .= $this->indent( -1 ) . '</div>' . "\n";
return $ret;
}
diff --git a/components/NavbarHorizontal.php b/components/NavbarHorizontal.php
index 3f25717..11a8193 100644
--- a/components/NavbarHorizontal.php
+++ b/components/NavbarHorizontal.php
@@ -3,7 +3,7 @@
* File holding the NavbarHorizontal class
*
* @copyright (C) 2013, Stephan Gambke
- * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
*
* This file is part of the MediaWiki extension Chameleon.
* The Chameleon extension is free software: you can redistribute it and/or
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @file
- * @ingroup Chameleon
+ * @ingroup Chameleon
*/
namespace skins\chameleon\components;
use Html,
- Linker,
- Sanitizer;
+ Linker,
+ Sanitizer;
/**
* The NavbarHorizontal class.
@@ -63,7 +63,7 @@
$ret .= $this->indent( -1 ) . '</ul>' .
$this->indent( -1 ) . '</nav>' . "\n";
-
+
return $ret;
}
@@ -74,28 +74,31 @@
* @param $box
*
* @return string
- */private function getDropdown( $boxName, $box ) {
+ */
+ private function getDropdown( $boxName, $box ) {
// open list item containing the dropdown
$ret = $this->indent() . '<!-- ' . $boxName . ' -->' .
- $this->indent() . Html::openElement( 'li', array(
- 'class' => 'dropdown',
- 'id' => Sanitizer::escapeId( $box['id']
),
- 'title' => Linker::titleAttrib(
$box['id'] )
- ) );
+ $this->indent() . Html::openElement( 'li',
+ array(
+ 'class' => 'dropdown',
+ 'id' =>
Sanitizer::escapeId( $box[ 'id' ] ),
+ 'title' =>
Linker::titleAttrib( $box[ 'id' ] )
+ ) );
$this->indent( 1 );
- if ( is_array( $box['content'] ) ) {
+ if ( is_array( $box[ 'content' ] ) ) {
// the dropdown toggle
- $ret .= $this->indent() . '<a href="#"
class="dropdown-toggle" data-toggle="dropdown">' . htmlspecialchars(
$box['header'] ) . ' <b class="caret"></b></a>';
+ $ret .= $this->indent() . '<a href="#"
class="dropdown-toggle" data-toggle="dropdown">' .
+ htmlspecialchars( $box[ 'header' ] ) .
' <b class="caret"></b></a>';
// open list of dropdown menu items
$ret .= $this->indent() . '<ul class="dropdown-menu">';
// output dropdown menu items
$this->indent( 1 );
- foreach ( $box['content'] as $key => $item ) {
+ foreach ( $box[ 'content' ] as $key => $item ) {
$ret .= $this->indent() .
$this->getSkinTemplate()->makeListItem( $key, $item );
}
@@ -103,7 +106,7 @@
$ret .= $this->indent( -1 ) . '</ul>';
} else {
- $ret = $this->indent() . $box['content'];
+ $ret = $this->indent() . $box[ 'content' ];
}
$this->indent( -1 );
diff --git a/components/NewtalkNotifier.php b/components/NewtalkNotifier.php
index d72ab1f..262027b 100644
--- a/components/NewtalkNotifier.php
+++ b/components/NewtalkNotifier.php
@@ -3,7 +3,7 @@
* File holding the NewtalkNotifier class
*
* @copyright (C) 2013, Stephan Gambke
- * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
*
* This file is part of the MediaWiki extension Chameleon.
* The Chameleon extension is free software: you can redistribute it and/or
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @file
- * @ingroup Chameleon
+ * @ingroup Chameleon
*/
namespace skins\chameleon\components;
@@ -41,9 +41,9 @@
*/
public function getHtml() {
- if ( $this->getSkinTemplate()->data['newtalk'] ) {
- return $this->indent() . '<!-- message to a user about
new messages on their talkpage -->'
- . $this->indent() . '<span
class="usermessage">' . $this->getSkinTemplate()->data['newtalk'] . '</span>';
+ if ( $this->getSkinTemplate()->data[ 'newtalk' ] ) {
+ return $this->indent() . '<!-- message to a user about
new messages on their talkpage -->' .
+ $this->indent() . '<span
class="usermessage">' . $this->getSkinTemplate()->data[ 'newtalk' ] . '</span>';
} else {
return '';
}
diff --git a/components/PersonalTools.php b/components/PersonalTools.php
index 68fd212..b720db1 100644
--- a/components/PersonalTools.php
+++ b/components/PersonalTools.php
@@ -3,7 +3,7 @@
* File holding the PersonalTools class
*
* @copyright (C) 2013, Stephan Gambke
- * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
*
* This file is part of the MediaWiki extension Chameleon.
* The Chameleon extension is free software: you can redistribute it and/or
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @file
- * @ingroup Chameleon
+ * @ingroup Chameleon
*/
namespace skins\chameleon\components;
@@ -42,26 +42,26 @@
public function getHtml() {
$ret = $this->indent() . '<!-- personal tools -->' .
- $this->indent() . '<div class="p-personal"
id="p-personal" >';
+ $this->indent() . '<div class="p-personal"
id="p-personal" >';
// include message to a user about new messages on their
talkpage
// TODO: make including the NewTalkNotifier dependent on an
option (PREPEND, APPEND, OFF)
$newtalkNotifier = new NewtalkNotifier(
$this->getSkinTemplate(), $this->getIndent() + 2 );
- $ret .= '<ul class="p-personal-tools list-inline pull-right" >';
+ $ret .= $this->indent( 1 ) . '<ul class="p-personal-tools
list-inline pull-right" >';
+
+ $this->indent( 1 );
// add personal tools (links to user page, user talk, prefs,
...)
foreach ( $this->getSkinTemplate()->getPersonalTools() as $key
=> $item ) {
$ret .= $this->indent() .
$this->getSkinTemplate()->makeListItem( $key, $item );
}
- $ret .= $this->indent( -1 ) . '</ul>';
+ $ret .= $this->indent( -1 ) . '</ul>' .
+ $this->indent() . '<div class="newtalk-notifier
pull-right">' . $newtalkNotifier->getHtml() .
+ $this->indent() . '</div>' .
+ $this->indent( -1 ) . '</div>' . "\n";
- $ret .= $this->indent( 1 ) . '<div class="newtalk-notifier
pull-right">' .
- $newtalkNotifier->getHtml() .
- $this->indent() .'</div>';
-
- $ret .= $this->indent( -1 ) . '</div>' . "\n";
return $ret;
}
diff --git a/components/SearchForm.php b/components/SearchForm.php
index 68b28b4..abfb908 100644
--- a/components/SearchForm.php
+++ b/components/SearchForm.php
@@ -3,7 +3,7 @@
* File holding the SearchForm class
*
* @copyright (C) 2013, Stephan Gambke
- * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
*
* This file is part of the MediaWiki extension Chameleon.
* The Chameleon extension is free software: you can redistribute it and/or
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @file
- * @ingroup Chameleon
+ * @ingroup Chameleon
*/
namespace skins\chameleon\components;
@@ -62,15 +62,17 @@
}
private function getGoButton() {
+
// For an image button use something like
// $this->makeSearchButton( 'image', array( 'id' =>
'searchButton', 'src' => $this->getSkin()->getSkinStylePath(
'images/searchbutton.png') );
return $this->indent() . '<!-- The "Go" button -->' .
- $this->indent() .
$this->getSkinTemplate()->makeSearchButton( 'go', array( 'id' =>
'searchGoButton', 'class' => 'searchButton btn btn-default' ) );
+ $this->indent() .
$this->getSkinTemplate()->makeSearchButton( 'go', array( 'id' =>
'searchGoButton', 'class' => 'searchButton btn btn-default' ) );
}
private function getSearchButton() {
+
return $this->indent() . '<!-- The "Search" button -->' .
- $this->indent() .
$this->getSkinTemplate()->makeSearchButton( 'fulltext', array( 'id' =>
'mw-searchButton', 'class' => 'searchButton btn btn-default' ) );
+ $this->indent() .
$this->getSkinTemplate()->makeSearchButton( 'fulltext', array( 'id' =>
'mw-searchButton', 'class' => 'searchButton btn btn-default' ) );
}
}
diff --git a/components/SiteNotice.php b/components/SiteNotice.php
index 2f11b35..ad3b709 100644
--- a/components/SiteNotice.php
+++ b/components/SiteNotice.php
@@ -3,7 +3,7 @@
* File holding the SiteNotice class
*
* @copyright (C) 2013, Stephan Gambke
- * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
*
* This file is part of the MediaWiki extension Chameleon.
* The Chameleon extension is free software: you can redistribute it and/or
@@ -20,7 +20,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @file
- * @ingroup Chameleon
+ * @ingroup Chameleon
*/
namespace skins\chameleon\components;
@@ -41,14 +41,14 @@
*/
public function getHtml() {
- $siteNotice = $this->getSkinTemplate()->data['sitenotice'];
-
+ $siteNotice = $this->getSkinTemplate()->data[ 'sitenotice' ];
+
if ( $siteNotice ) {
return $this->indent() . '<!-- sitenotice -->' .
- $this->indent() . '<div id="siteNotice"
class="siteNotice" >' . $siteNotice . '</div>'
- . "\n";
+ $this->indent() . '<div id="siteNotice"
class="siteNotice" >' . $siteNotice . '</div>'
+ . "\n";
} else {
- return '';
+ return "\n";
}
}
diff --git a/components/TabList.php b/components/TabList.php
index 053f2b2..ab962f6 100644
--- a/components/TabList.php
+++ b/components/TabList.php
@@ -3,7 +3,7 @@
* File holding the TabList class
*
* @copyright (C) 2013, Stephan Gambke
- * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
+ * @license http://www.gnu.org/licenses/gpl-3.0.html GNU General Public
License, version 3 (or later)
*
* This file is part of the MediaWiki extension Chameleon.
* The Chameleon extension is free software: you can redistribute it and/or
@@ -20,14 +20,14 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* @file
- * @ingroup Chameleon
+ * @ingroup Chameleon
*/
namespace skins\chameleon\components;
use Html,
- Linker,
- Sanitizer;
+ Linker,
+ Sanitizer;
/**
* The TabList class.
@@ -50,35 +50,43 @@
$ret = $this->indent() . '<!-- Content navigation -->' .
$this->indent() . '<ul class="list-inline
p-contentnavigation text-center" id="p-contentnavigation">';
- $navigation =
$this->getSkinTemplate()->data['content_navigation'];
+ $navigation = $this->getSkinTemplate()->data[
'content_navigation' ];
$this->indent( 1 );
foreach ( $navigation as $category => $tabs ) {
// TODO: visually group all links of one category (e.g.
some space between categories)
+ if ( empty( $tabs ) ) {
+ continue;
+ }
+
// output the name of the current category (e.g.
'namespaces', 'views', ...)
$ret .= $this->indent() . '<!-- ' . $category . ' -->' .
- $this->indent() . '<li id="p-' .
$category . '" ><ul class="list-inline" >';
+ $this->indent() . '<li id="p-' .
$category . '" >' .
+ $this->indent( 1 ) . '<ul
class="list-inline" >';
+ $this->indent( 1 );
foreach ( $tabs as $key => $tab ) {
// skip redundant links (i.e. the 'view' link)
// TODO: make this dependent on an option
- if ( array_key_exists( 'redundant', $tab ) &&
$tab['redundant'] === true ) {
+ if ( array_key_exists( 'redundant', $tab ) &&
$tab[ 'redundant' ] === true ) {
continue;
}
// apply a link class if specified, e.g. for
the currently active namespace
$options = array();
if ( array_key_exists( 'class', $tab ) ) {
- $options['link-class'] = $tab['class'];
+ $options[ 'link-class' ] = $tab[
'class' ];
}
$ret .= $this->indent() .
$this->getSkinTemplate()->makeListItem( $key, $tab, $options );
}
- $ret .= $this->indent() . "</ul></li>";
+
+ $ret .= $this->indent( -1 ) . '</ul>' .
+ $this->indent( -1 ) . '</li>';
}
$ret .= $this->indent( -1 ) . '</ul>' . "\n";
diff --git a/components/ToolbarHorizontal.php b/components/ToolbarHorizontal.php
index 1f0d57a..f23234c 100644
--- a/components/ToolbarHorizontal.php
+++ b/components/ToolbarHorizontal.php
@@ -75,10 +75,10 @@
$this->indent( 1 );
foreach ( $skinTemplate->data[ 'language_urls' ] as
$key => $langlink ) {
- $ret .= $this->indent() .
$skinTemplate->makeListItem( $key, $langlink, array( 'link-class' => 'small') );
+ $ret .= $this->indent() .
$skinTemplate->makeListItem( $key, $langlink, array( 'link-class' => 'small' )
);
}
- $ret .= $this->indent(-1) . '</ul>' .
+ $ret .= $this->indent( -1 ) . '</ul>' .
$this->indent( -1 ) . '</li>';
}
--
To view, visit https://gerrit.wikimedia.org/r/89489
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c6243e77993f83e4106f23634e20b3f4a656d7f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/chameleon
Gerrit-Branch: master
Gerrit-Owner: Foxtrott <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits