jenkins-bot has submitted this change and it was merged.

Change subject: Update skin
......................................................................


Update skin

Remove pre mw 1.22 and below compat.

Remove i18n shim

Replace wfSuppressWarnings and wfRestoreWarnings with
MediaWiki\suppressWarnings and MediaWiki\restoreWarnings only if they use
mediawiki 1.26 or above.

Also some minor php code changes such as adding missing braces to if and
also spaces in (

Also move class BlueSpiceSkinTemplate to it's own file.

Change-Id: Ifd3b951f3351c2181104dada9f0536fdf6ea11ba
---
D BlueSpiceSkin.i18n.php
M BlueSpiceSkin.php
M BlueSpiceSkin.skin.php
A BlueSpiceSkinTemplate.php
M includes/BlueSpiceSkinHooks.php
M skin.json
M views/view.StateBarTopElementWatch.php
7 files changed, 135 insertions(+), 140 deletions(-)

Approvals:
  Robert Vogel: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/BlueSpiceSkin.i18n.php b/BlueSpiceSkin.i18n.php
deleted file mode 100644
index a534e15..0000000
--- a/BlueSpiceSkin.i18n.php
+++ /dev/null
@@ -1,35 +0,0 @@
-<?php
-/**
- * This is a backwards-compatibility shim, generated by:
- * 
https://git.wikimedia.org/blob/mediawiki%2Fcore.git/HEAD/maintenance%2FgenerateJsonI18n.php
- *
- * Beginning with MediaWiki 1.23, translation strings are stored in json files,
- * and the EXTENSION.i18n.php file only exists to provide compatibility with
- * older releases of MediaWiki. For more information about this migration, see:
- * https://www.mediawiki.org/wiki/Requests_for_comment/Localisation_format
- *
- * This shim maintains compatibility back to MediaWiki 1.17.
- */
-$messages = array();
-if ( !function_exists( 'wfJsonI18nShime82f6ce41a6a4c2e' ) ) {
-       function wfJsonI18nShime82f6ce41a6a4c2e( $cache, $code, &$cachedData ) {
-               $codeSequence = array_merge( array( $code ), 
$cachedData['fallbackSequence'] );
-               foreach ( $codeSequence as $csCode ) {
-                       $fileName = dirname( __FILE__ ) . "/i18n/$csCode.json";
-                       if ( is_readable( $fileName ) ) {
-                               $data = FormatJson::decode( file_get_contents( 
$fileName ), true );
-                               foreach ( array_keys( $data ) as $key ) {
-                                       if ( $key === '' || $key[0] === '@' ) {
-                                               unset( $data[$key] );
-                                       }
-                               }
-                               $cachedData['messages'] = array_merge( $data, 
$cachedData['messages'] );
-                       }
-
-                       $cachedData['deps'][] = new FileDependency( $fileName );
-               }
-               return true;
-       }
-
-       $GLOBALS['wgHooks']['LocalisationCacheRecache'][] = 
'wfJsonI18nShime82f6ce41a6a4c2e';
-}
diff --git a/BlueSpiceSkin.php b/BlueSpiceSkin.php
index 0714c86..adabc1b 100644
--- a/BlueSpiceSkin.php
+++ b/BlueSpiceSkin.php
@@ -8,8 +8,8 @@
  * @author Radovan Kubani, Robert Vogel, Patric Wirth, Tobias Weichart et. al.
  * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License 
2.0 or later
  */
-if (!defined('MEDIAWIKI')) {
-       die("This is an extension to the MediaWiki package and cannot be run 
standalone.");
+if ( !defined( 'MEDIAWIKI' ) ) {
+       die( "This is an extension to the MediaWiki package and cannot be run 
standalone." );
 }
 
-wfLoadSkin( 'BlueSpiceSkin' );
\ No newline at end of file
+wfLoadSkin( 'BlueSpiceSkin' );
diff --git a/BlueSpiceSkin.skin.php b/BlueSpiceSkin.skin.php
index 9f66124..d4fdbd5 100644
--- a/BlueSpiceSkin.skin.php
+++ b/BlueSpiceSkin.skin.php
@@ -33,23 +33,19 @@
        /**
         * @param $out OutputPage object
         */
-       function initPage( \OutputPage $out ) {
-               parent::initPage($out);
+       public function initPage( OutputPage $out ) {
+               parent::initPage( $out );
 
-               $out->addModules('skins.bluespiceskin.scripts');
+               $out->addModules( 'skins.bluespiceskin.scripts' );
        }
 
        /**
         * Loads the styles
         * @param OutputPage $out
         */
-       function setupSkinUserCss( OutputPage $out ) {
-               parent::setupSkinUserCss($out);
-               $out->addModuleStyles( 'skins.bluespiceskin' );
-
-               if ( version_compare( $GLOBALS['wgVersion'], '1.23', '>=' ) ) {
-                       $out->addModuleStyles( 'mediawiki.skinning.interface' );
-               }
+       public function setupSkinUserCss( OutputPage $out ) {
+               parent::setupSkinUserCss( $out );
+               $out->addModuleStyles( array( 'skins.bluespiceskin', 
'mediawiki.skinning.interface' ) );
        }
 
        public function addToSidebarPlain(&$bar, $text) {
@@ -59,78 +55,4 @@
                return $item;
        }
 
-}
-
-class BlueSpiceSkinTemplate extends BsBaseTemplate {
-
-       public function execute() {
-               parent::execute();
-
-               wfSuppressWarnings();
-               ?>
-               <div id="bs-wrapper">
-                       <div id="bs-menu-top" class="clearfix">
-                               <?php $this->printLogo(); ?>
-                               <div id="bs-menu-top-left">
-                                       <?php $this->printNavigationSites(); ?>
-                               </div>
-                               <div id="bs-menu-top-right">
-                                       <?php $this->printPersonalTools(); ?>
-                                       <?php $this->printSearchBox(); ?>
-                               </div>
-                       </div>
-                       <div id="bs-application">
-                               <!-- #bs-content-column START -->
-                               <div id="bs-content-column">
-                                       <?php $this->printContentActions(); ?>
-                                       <?php $this->printDataBeforeContent(); 
?>
-                                       <div id="content" class="mw-body" 
role="main">
-                                               <a id="top"></a>
-                                               <div id="mw-js-message" 
style="display:none;"<?php $this->html('userlangattributes') ?>></div>
-                                               <?php $this->printSiteNotice(); 
?>
-                                               <?php 
$this->printFirstHeading(); ?>
-                                               <?php $this->html( 
'prebodyhtml' ) ?>
-                                               <div id="bodyContent" 
class="clearfix">
-                                                       <h3 id="siteSub"> <?php 
$this->msg('tagline') ?> </h3>
-                                                       <div 
id="contentSub"><?php $this->html('subtitle') ?></div>
-                                                       <?php if 
($this->data['undelete']) { ?>
-                                                               <div 
id="contentSub2"><?php $this->html('undelete') ?></div>
-                                                       <?php } ?>
-                                                       <?php if 
($this->data['newtalk']) { ?>
-                                                               <div 
class="usermessage"><?php $this->html('newtalk') ?></div>
-                                                       <?php } ?>
-                                                       <?php if 
($this->data['showjumplinks']) { ?>
-                                                               <div 
id="jump-to-nav"><?php $this->msg('jumpto') ?>
-                                                                       <a 
href="#column-one"><?php $this->msg('jumptonavigation') ?></a>,
-                                                                       <a 
href="#searchInput"><?php $this->msg('jumptosearch') ?></a>
-                                                               </div>
-                                                       <?php } ?>
-                                                       <!-- start content -->
-                                                       <div id="bs-bodytext">
-                                                               <?php 
$this->html('bodytext') ?>
-                                                       </div>
-                                                       <!-- end content -->
-                                                       <div 
class="visualClear"></div>
-                                                       <?php $this->html( 
'debughtml' ); ?>
-                                               </div>
-                                       </div>
-                                       <?php $this->printDataAfterContent(); ?>
-                               </div>
-                               <!-- #bs-content-column END -->
-                               <!-- #bs-left-column START -->
-                               <div id="bs-left-column" class="clearfix">
-                                       <?php $this->printNavigationMain(); ?>
-                               </div>
-                               <!-- #bs-left-column END -->
-                               <!-- #bs-footer START -->
-                               <?php $this->printFooter(); ?>
-                               <!-- #bs-footer END -->
-                       </div>
-                       <?php $this->printSkyScraper(); ?>
-               </div>
-               <?php $this->printTrail(); ?>
-       </body>
-</html><?php
-               wfRestoreWarnings();
-       } // end of execute() method
 }
diff --git a/BlueSpiceSkinTemplate.php b/BlueSpiceSkinTemplate.php
new file mode 100644
index 0000000..ad63ff1
--- /dev/null
+++ b/BlueSpiceSkinTemplate.php
@@ -0,0 +1,105 @@
+<?php
+
+/**
+ * BlueSpice for MediaWiki
+ * Authors: Radovan Kubani, Sebastian Ulbricht, Tobias Weichart, Robert Vogel
+ *
+ * Copyright (C) 2016 Hallo Welt! GmbH, All rights reserved.
+ *
+ * This program 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 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program 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, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * For further information visit http://bluespice.com
+ */
+class BlueSpiceSkinTemplate extends BsBaseTemplate {
+
+       public function execute() {
+               parent::execute();
+               if ( version_compare( $GLOBALS['wgVersion'], '1.26', '>=' ) ) {
+                       MediaWiki\suppressWarnings();
+               } else {
+                       wfSuppressWarnings();
+               }
+               ?>
+               <div id="bs-wrapper">
+                       <div id="bs-menu-top" class="clearfix">
+                               <?php $this->printLogo(); ?>
+                               <div id="bs-menu-top-left">
+                                       <?php $this->printNavigationSites(); ?>
+                               </div>
+                               <div id="bs-menu-top-right">
+                                       <?php $this->printPersonalTools(); ?>
+                                       <?php $this->printSearchBox(); ?>
+                               </div>
+                       </div>
+                       <div id="bs-application">
+                               <!-- #bs-content-column START -->
+                               <div id="bs-content-column">
+                                       <?php $this->printContentActions(); ?>
+                                       <?php $this->printDataBeforeContent(); 
?>
+                                       <div id="content" class="mw-body" 
role="main">
+                                               <a id="top"></a>
+                                               <div id="mw-js-message" 
style="display:none;"<?php $this->html('userlangattributes') ?>></div>
+                                               <?php $this->printSiteNotice(); 
?>
+                                               <?php 
$this->printFirstHeading(); ?>
+                                               <?php $this->html( 
'prebodyhtml' ) ?>
+                                               <div id="bodyContent" 
class="clearfix">
+                                                       <h3 id="siteSub"> <?php 
$this->msg('tagline') ?> </h3>
+                                                       <div 
id="contentSub"><?php $this->html('subtitle') ?></div>
+                                                       <?php if 
($this->data['undelete']) { ?>
+                                                               <div 
id="contentSub2"><?php $this->html('undelete') ?></div>
+                                                       <?php } ?>
+                                                       <?php if 
($this->data['newtalk']) { ?>
+                                                               <div 
class="usermessage"><?php $this->html('newtalk') ?></div>
+                                                       <?php } ?>
+                                                       <?php if 
($this->data['showjumplinks']) { ?>
+                                                               <div 
id="jump-to-nav"><?php $this->msg('jumpto') ?>
+                                                                       <a 
href="#column-one"><?php $this->msg('jumptonavigation') ?></a>,
+                                                                       <a 
href="#searchInput"><?php $this->msg('jumptosearch') ?></a>
+                                                               </div>
+                                                       <?php } ?>
+                                                       <!-- start content -->
+                                                       <div id="bs-bodytext">
+                                                               <?php 
$this->html('bodytext') ?>
+                                                       </div>
+                                                       <!-- end content -->
+                                                       <div 
class="visualClear"></div>
+                                                       <?php $this->html( 
'debughtml' ); ?>
+                                               </div>
+                                       </div>
+                                       <?php $this->printDataAfterContent(); ?>
+                               </div>
+                               <!-- #bs-content-column END -->
+                               <!-- #bs-left-column START -->
+                               <div id="bs-left-column" class="clearfix">
+                                       <?php $this->printNavigationMain(); ?>
+                               </div>
+                               <!-- #bs-left-column END -->
+                               <!-- #bs-footer START -->
+                               <?php $this->printFooter(); ?>
+                               <!-- #bs-footer END -->
+                       </div>
+                       <?php $this->printSkyScraper(); ?>
+               </div>
+               <?php $this->printTrail(); ?>
+       </body>
+</html><?php
+               if ( version_compare( $GLOBALS['wgVersion'], '1.26', '>=' ) ) {
+                       MediaWiki\restoreWarnings();
+               } else {
+                       wfRestoreWarnings();
+               }
+       } // end of execute() method
+}
diff --git a/includes/BlueSpiceSkinHooks.php b/includes/BlueSpiceSkinHooks.php
index 6d4505a..2dd4b87 100644
--- a/includes/BlueSpiceSkinHooks.php
+++ b/includes/BlueSpiceSkinHooks.php
@@ -7,7 +7,7 @@
         */
        public static function setup() {
                global $wgVisualEditorSupportedSkins;
-               if( is_array( $wgVisualEditorSupportedSkins ) ) {
+               if ( is_array( $wgVisualEditorSupportedSkins ) ) {
                        $wgVisualEditorSupportedSkins[] = 'bluespiceskin';
                }
        }
@@ -143,7 +143,7 @@
 
        public static function ajaxGetDiscussionCount() {
                $oResponse = BsCAResponse::newFromPermission('read');
-               if( $oResponse->isSuccess() == false ) {
+               if ( $oResponse->isSuccess() == false ) {
                        return $oResponse;
                }
 
@@ -159,19 +159,20 @@
        }
 
        public static function onSkinTemplateNavigationUniversal( &$sktemplate, 
&$links ) {
-               if (isset($links['views']['view']))
+               if ( isset( $links['views']['view'] ) ) {
                        unset($links['views']['view']);
-               if (isset($links['actions']['watch'])){
+               }
+               if ( isset( $links['actions']['watch'] ) ) {
                        $links['actions']['watch']['class'] = 'icon-star';
                        $aTmp = $links['actions']['watch'];
-                       $links['views'] = array("watch" => $aTmp) + 
$links['views'];
-                       unset($links['actions']['watch']);
+                       $links['views'] = array( "watch" => $aTmp ) + 
$links['views'];
+                       unset( $links['actions']['watch'] );
                }
-               if (isset($links['actions']['unwatch'])){
+               if ( isset( $links['actions']['unwatch'] ) ) {
                        $links['actions']['unwatch']['class'] = 'icon-star3';
                        $aTmp = $links['actions']['unwatch'];
-                       $links['views'] = array("unwatch" => $aTmp) + 
$links['views'];
-                       unset($links['actions']['unwatch']);
+                       $links['views'] = array( "unwatch" => $aTmp ) + 
$links['views'];
+                       unset( $links['actions']['unwatch'] );
                }
                return true;
        }
@@ -187,7 +188,7 @@
                                'class' => 'mw-echo-notification-badge-nojs 
oo-ui-icon-bell oo-ui-widget-enabled mw-echo-notifications-badge',
                        ) + $tpl->data['personal_urls']['notifications-alert'];
 
-               if( isset( 
$tpl->data['personal_urls']['notifications-alert']['text'] )
+               if ( isset( 
$tpl->data['personal_urls']['notifications-alert']['text'] )
                                && 
$tpl->data['personal_urls']['notifications-alert']['text'] > 0 ) {
                        $tpl->data['bs_personal_info'][10]['active'] = true;
                }
@@ -205,7 +206,7 @@
                                'class' => 'mw-echo-notification-badge-nojs 
oo-ui-icon-speechBubbles oo-ui-widget-enabled mw-echo-notifications-badge',
                        ) + 
$tpl->data['personal_urls']['notifications-message'];
 
-               if( isset( 
$tpl->data['personal_urls']['notifications-message']['text'] )
+               if ( isset( 
$tpl->data['personal_urls']['notifications-message']['text'] )
                                && 
$tpl->data['personal_urls']['notifications-message']['text'] > 0 ) {
                        $tpl->data['bs_personal_info'][10]['active'] = true;
                }
diff --git a/skin.json b/skin.json
index 138dff2..73627b8 100644
--- a/skin.json
+++ b/skin.json
@@ -39,7 +39,7 @@
        },
        "AutoloadClasses": {
                "SkinBlueSpiceSkin": "BlueSpiceSkin.skin.php",
-               "BlueSpiceSkinTemplate": "BlueSpiceSkin.skin.php",
+               "BlueSpiceSkinTemplate": "BlueSpiceSkinTemplate.php",
                "BlueSpiceSkinHooks": "includes/BlueSpiceSkinHooks.php",
                "ViewStateBarTopElementTools": 
"views/view.StateBarTopElementTools.php",
                "ViewStateBarTopElementWatch": 
"views/view.StateBarTopElementWatch.php"
diff --git a/views/view.StateBarTopElementWatch.php 
b/views/view.StateBarTopElementWatch.php
index 1c8e570..b930273 100644
--- a/views/view.StateBarTopElementWatch.php
+++ b/views/view.StateBarTopElementWatch.php
@@ -14,16 +14,18 @@
        public function execute( $params = false ) {
                global $wgTitle, $wgUser;
                $sClass = "";
-               if ($wgUser->isWatched($wgTitle))
+               if ( $wgUser->isWatched( $wgTitle ) ) {
                        $sClass = "class='watched'";
+               }
                $aOut[] = '<div id="ca-watch" class="icon">';
-               if ($wgTitle instanceof Title)
-               $sName = $wgUser->isWatched( $wgTitle ) ? 'unwatch' : 'watch';
-               
-               $aOut[] = '  <a href="' . $wgTitle->getFullUrl(array('action' 
=> $sName)) . '" title="' . wfMessage($sName)->plain() . '" 
'.$sClass.'>'.wfMessage($sName)->plain().'</a>';
+               if ( $wgTitle instanceof Title ) {
+                       $sName = $wgUser->isWatched( $wgTitle ) ? 'unwatch' : 
'watch';
+               }
+
+               $aOut[] = '  <a href="' . $wgTitle->getFullUrl( array( 'action' 
=> $sName ) ) . '" title="' . wfMessage( $sName )->plain() . '" 
'.$sClass.'>'.wfMessage( $sName )->plain().'</a>';
                $aOut[] = '</div>';
                $aOut[] = "</div>";
                return implode( "\n", $aOut );
        }
 
-}
\ No newline at end of file
+}

-- 
To view, visit https://gerrit.wikimedia.org/r/316065
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifd3b951f3351c2181104dada9f0536fdf6ea11ba
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/skins/BlueSpiceSkin
Gerrit-Branch: master
Gerrit-Owner: Paladox <thomasmulhall...@yahoo.com>
Gerrit-Reviewer: Dvogel hallowelt <daniel.vo...@hallowelt.com>
Gerrit-Reviewer: Ljonka <l.verhovs...@gmail.com>
Gerrit-Reviewer: Mglaser <gla...@hallowelt.biz>
Gerrit-Reviewer: Paladox <thomasmulhall...@yahoo.com>
Gerrit-Reviewer: Pwirth <wi...@hallowelt.biz>
Gerrit-Reviewer: Robert Vogel <vo...@hallowelt.biz>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to