Pastakhov has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/381159 )

Change subject: Initial commit
......................................................................

Initial commit

Change-Id: I44454bc0a2a1f85feec83566ed9469e4c9d19e30
---
A .eslintrc.json
A .gitignore
A .stylelintrc.json
A Empty.php
A EmptyHooks.php
A EmptyTemplate.php
A Gruntfile.js
A SkinEmpty.php
A composer.json
A i18n/en.json
A i18n/qqq.json
A includes/Empty.json
A includes/Skin.php
A package.json
A phpcs.xml
A skin.json
16 files changed, 857 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/Empty 
refs/changes/59/381159/1

diff --git a/.eslintrc.json b/.eslintrc.json
new file mode 100644
index 0000000..4843240
--- /dev/null
+++ b/.eslintrc.json
@@ -0,0 +1,10 @@
+{
+       "extends": "wikimedia",
+       "env": {
+               "browser": true,
+               "jquery": true
+       },
+       "globals": {
+               "mediaWiki": false
+       }
+}
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..6cf4eed
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,16 @@
+# Building & testing
+node_modules/
+package-lock.json
+
+# Composer
+/vendor
+/composer.lock
+
+# Operating systems
+## Mac OS X
+.DS_Store
+## Windows
+Thumbs.db
+## Linux
+.directory
+
diff --git a/.stylelintrc.json b/.stylelintrc.json
new file mode 100644
index 0000000..2c90730
--- /dev/null
+++ b/.stylelintrc.json
@@ -0,0 +1,3 @@
+{
+       "extends": "stylelint-config-wikimedia"
+}
diff --git a/Empty.php b/Empty.php
new file mode 100644
index 0000000..5d741f5
--- /dev/null
+++ b/Empty.php
@@ -0,0 +1,13 @@
+<?php
+if ( function_exists( 'wfLoadSkin' ) ) {
+       wfLoadSkin( 'Empty' );
+       // Keep i18n globals so mergeMessageFileList.php doesn't break
+       $wgMessagesDirs['Empty'] = __DIR__ . '/i18n';
+       wfWarn(
+               'Deprecated PHP entry point used for the Empty skin. Please use 
wfLoadSkin instead, ' .
+               'see https://www.mediawiki.org/wiki/Extension_registration for 
more details.'
+       );
+       return;
+} else {
+       die( 'This version of the Empty skin requires MediaWiki 1.25+' );
+}
diff --git a/EmptyHooks.php b/EmptyHooks.php
new file mode 100644
index 0000000..024b615
--- /dev/null
+++ b/EmptyHooks.php
@@ -0,0 +1,33 @@
+<?php
+
+
+/**
+ * PhpTags Empty Skin Hooks.
+ *
+ * @file EmptyHooks.php
+ * @ingroup Skins
+ * @author Pavel Astakhov <[email protected]>
+ * @licence GNU General Public Licence 2.0 or later
+ */
+class EmptyHooks {
+
+       public static function onParserFirstCallInit() {
+               if ( !defined( 'PHPTAGS_VERSION' ) ) {
+                       throw new MWException( "\n\nYou need to have the 
PhpTags extension installed in order to use the Empty skin." );
+               }
+               $needVersion = '5.3.0';
+               if ( version_compare( PHPTAGS_VERSION, $needVersion, '<' ) ) {
+                       throw new MWException( "\n\nThis version of the Empty 
skin requires the PhpTags extension $needVersion or above.\n You have " . 
PHPTAGS_VERSION . ". Please update it." );
+               }
+               if ( PHPTAGS_HOOK_RELEASE != 8 ) {
+                       throw new MWException( "\n\nThis version of the Empty 
skin is outdated and not compatible with current version of the PhpTags 
extension.\n Please update it." );
+               }
+               return true;
+       }
+
+       public static function onPhpTagsRuntimeFirstInit() {
+               \PhpTags\Hooks::addJsonFile( __DIR__ . '/includes/Empty.json', 
EMPTY_SKIN_VERSION );
+               return true;
+       }
+
+}
diff --git a/EmptyTemplate.php b/EmptyTemplate.php
new file mode 100644
index 0000000..07cc17c
--- /dev/null
+++ b/EmptyTemplate.php
@@ -0,0 +1,169 @@
+<?php
+/**
+ *
+ * @ingroup Skins
+ */
+class EmptyTemplate extends BaseTemplate {
+       /**
+        * Outputs the entire contents of the page
+        */
+       public function execute() {
+               // Output HTML Page
+               $this->html( 'headelement' );
+               ?>
+
+<h1 id="firstHeading" class="firstHeading" lang="<?php
+                       $this->data['pageLanguage'] =
+                               
$this->getSkin()->getTitle()->getPageViewLanguage()->getHtmlCode();
+                       $this->text( 'pageLanguage' );
+                       ?>"><?php $this->html( 'title' ) ?></h1>
+                       <?php $this->html( 'prebodyhtml' ) ?>
+
+                       <div id="bodyContent" class="mw-body-content">
+                               <?php
+                               if ( $this->data['isarticle'] ) {
+                                       ?>
+                                       <div id="siteSub"><?php $this->msg( 
'tagline' ) ?></div>
+                               <?php
+                               }
+                               ?>
+                               <div id="contentSub"<?php
+                               $this->html( 'userlangattributes' )
+                               ?>><?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
+                               }
+                               ?>
+                               <div id="jump-to-nav" class="mw-jump">
+                                       <?php $this->msg( 'jumpto' ) ?>
+                                       <a href="#mw-head"><?php
+                                               $this->msg( 'jumptonavigation' )
+                                               ?></a><?php
+                                       $this->msg( 'comma-separator' )
+                                       ?>
+                                       <a href="#p-search"><?php $this->msg( 
'jumptosearch' ) ?></a>
+                               </div>
+                               <?php $this->html( 'bodycontent' ) ?>
+                               <?php
+                               if ( $this->data['printfooter'] ) {
+                                       ?>
+                                       <div class="printfooter">
+                                               <?php $this->html( 
'printfooter' ); ?>
+                                       </div>
+                               <?php
+                               }
+                               ?>
+                               <?php
+                               if ( $this->data['catlinks'] ) {
+                                       ?>
+                                       <?php
+                                       $this->html( 'catlinks' );
+                                       ?>
+                               <?php
+                               }
+                               ?>
+                               <?php
+                               if ( $this->data['dataAfterContent'] ) {
+                                       ?>
+                                       <?php
+                                       $this->html( 'dataAfterContent' );
+                                       ?>
+                               <?php
+                               }
+                               ?>
+                               <div class="visualClear"></div>
+                               <?php $this->html( 'debughtml' ); ?>
+                       </div>
+               </div>
+               <div id="mw-navigation">
+                       <h2><?php $this->msg( 'navigation-heading' ) ?></h2>
+
+                       <div id="mw-head">
+                               <?php // $this->renderNavigation( 'PERSONAL' ); 
?>
+                               <div id="left-navigation">
+                                       <?php // $this->renderNavigation( 
array( 'NAMESPACES', 'VARIANTS' ) ); ?>
+                               </div>
+                               <div id="right-navigation">
+                                       <?php // $this->renderNavigation( 
array( 'VIEWS', 'ACTIONS', 'SEARCH' ) ); ?>
+                               </div>
+                       </div>
+                       <div id="mw-panel">
+                               <div id="p-logo" role="banner"><a 
class="mw-wiki-logo" href="<?php
+                                       echo htmlspecialchars( 
$this->data['nav_urls']['mainpage']['href'] )
+                                       ?>" <?php
+                                       echo Xml::expandAttributes( 
Linker::tooltipAndAccesskeyAttribs( 'p-logo' ) )
+                                       ?>></a></div>
+                               <?php // $this->renderPortals( 
$this->data['sidebar'] ); ?>
+                       </div>
+               </div>
+               <div id="footer" role="contentinfo"<?php $this->html( 
'userlangattributes' ) ?>>
+                       <?php
+                       foreach ( $this->getFooterLinks() as $category => 
$links ) {
+                               ?>
+                               <ul id="footer-<?php
+                               echo $category
+                               ?>">
+                                       <?php
+                                       foreach ( $links as $link ) {
+                                               ?>
+                                               <li id="footer-<?php
+                                               echo $category
+                                               ?>-<?php
+                                               echo $link
+                                               ?>"><?php
+                                                       $this->html( $link )
+                                                       ?></li>
+                                       <?php
+                                       }
+                                       ?>
+                               </ul>
+                       <?php
+                       }
+                       ?>
+                       <?php $footericons = $this->getFooterIcons( "icononly" 
);
+                       if ( count( $footericons ) > 0 ) {
+                               ?>
+                               <ul id="footer-icons" class="noprint">
+                                       <?php
+                                       foreach ( $footericons as $blockName => 
$footerIcons ) {
+                                               ?>
+                                               <li id="footer-<?php
+                                               echo htmlspecialchars( 
$blockName ); ?>ico">
+                                                       <?php
+                                                       foreach ( $footerIcons 
as $icon ) {
+                                                               ?>
+                                                               <?php
+                                                               echo 
$this->getSkin()->makeFooterIcon( $icon );
+                                                               ?>
+
+                                                       <?php
+                                                       }
+                                                       ?>
+                                               </li>
+                                       <?php
+                                       }
+                                       ?>
+                               </ul>
+                       <?php
+                       }
+                       ?>
+                       <div style="clear:both"></div>
+               </div>
+               <?php $this->printTrail(); ?>
+
+       </body>
+</html>
+<?php
+       }
+
+}
diff --git a/Gruntfile.js b/Gruntfile.js
new file mode 100644
index 0000000..cd6f2fe
--- /dev/null
+++ b/Gruntfile.js
@@ -0,0 +1,21 @@
+/* eslint-env node */
+module.exports = function ( grunt ) {
+       var conf = grunt.file.readJSON( 'skin.json' );
+
+       grunt.loadNpmTasks( 'grunt-banana-checker' );
+       grunt.loadNpmTasks( 'grunt-jsonlint' );
+
+       grunt.initConfig( {
+               banana: conf.MessagesDirs,
+               jsonlint: {
+                       all: [
+                               '**/*.json',
+                               '!node_modules/**',
+                               '!vendor/**'
+                       ]
+               }
+       } );
+
+       grunt.registerTask( 'test', [ 'jsonlint', 'banana' ] );
+       grunt.registerTask( 'default', 'test' );
+};
diff --git a/SkinEmpty.php b/SkinEmpty.php
new file mode 100644
index 0000000..5d248c2
--- /dev/null
+++ b/SkinEmpty.php
@@ -0,0 +1,100 @@
+<?php
+
+/**
+ * SkinTemplate class for Empty skin
+ * @ingroup Skins
+ */
+class SkinEmpty extends Skin {
+       protected $skinname = 'empty';
+
+       /**
+        *
+        * @global \Parser $wgParser
+        * @param \OutputPage $out the OutputPage class
+        */
+       public function outputPage( \OutputPage $out = null ) {
+               global $wgParser;
+               // copy from SkinTemplate::outputPage()
+               Profiler::instance()->setTemplated( true );
+
+               $oldContext = null;
+               if ( $out !== null ) {
+                       // Deprecated since 1.20, note added in 1.25
+                       wfDeprecated( __METHOD__, '1.25' );
+                       $oldContext = $this->getContext();
+                       $this->setContext( $out->getContext() );
+               }
+
+               $out = $this->getOutput();
+
+               $this->initPage( $out );
+               // break copy SkinTemplate::outputPage()
+
+               \PhpTagsObjects\Skin::setSkin( $this );
+               $text = wfMessage( 'SkinEmpty' )->plain();
+
+               $popts = $out->parserOptions();
+               $popts->setInterfaceMessage( true );
+               // $parserOutput = $wgParser->parse( $text, $out->getTitle(), 
$popts );
+               $parserOutput = $wgParser->parse( $text, $out->getTitle(), 
$popts );
+               $parserOutput->resetParseStartTime();
+               $outputHtml = $parserOutput->getText();
+
+               // $outputHtml = $out->parse( $text, true, true );
+               // $outputHtml = wfMessage( 'EmptySkin' )->parse(); // Parse 
page MediaWiki:EmptySkin as a Skin
+               echo $out->headElement( $this ); // Add head element
+               echo $outputHtml; // output text
+
+               // copy from BaseTemplate::printTrail()
+               echo MWDebug::getDebugHTML( $this->getContext() );
+               echo $this->bottomScripts();
+               echo wfReportTime();
+               // end copy
+
+               $time = round( $parserOutput->getTimeSinceStart( 'cpu' ), 3 );
+               echo "\n<!-- Skin time: $time -->\n</body>\n</html>";
+
+               // continue copy SkinTemplate::outputPage()
+               if ( $oldContext ) {
+                       $this->setContext( $oldContext );
+               }
+       }
+
+       /**
+        * It's copy from SkinTemplate class
+        * Add specific styles for this skin
+        *
+        * @param OutputPage $out the OutputPage class
+        */
+       function setupSkinUserCss( OutputPage $out ) {
+               $moduleStyles = [
+                       'mediawiki.legacy.shared',
+                       'mediawiki.legacy.commonPrint',
+                       'mediawiki.sectionAnchor'
+               ];
+               if ( $out->isSyndicated() ) {
+                       $moduleStyles[] = 'mediawiki.feedlink';
+               }
+
+               // Deprecated since 1.26: Unconditional loading of 
mediawiki.ui.button
+               // on every page is deprecated. Express a dependency instead.
+               if ( strpos( $out->getHTML(), 'mw-ui-button' ) !== false ) {
+                       $moduleStyles[] = 'mediawiki.ui.button';
+               }
+
+               $out->addModuleStyles( $moduleStyles );
+       }
+
+       public function afterContentHook() {
+               return parent::afterContentHook();
+       }
+
+       public function generateDebugHTML() {
+               return parent::generateDebugHTML();
+       }
+
+       public function lastModified() {
+               return parent::lastModified();
+       }
+
+}
diff --git a/composer.json b/composer.json
new file mode 100644
index 0000000..6394fcf
--- /dev/null
+++ b/composer.json
@@ -0,0 +1,14 @@
+{
+       "require-dev": {
+               "jakub-onderka/php-parallel-lint": "0.9.2",
+               "mediawiki/mediawiki-codesniffer": "13.0.0",
+               "jakub-onderka/php-console-highlighter": "0.3.2"
+       },
+       "scripts": {
+               "fix": "phpcbf",
+               "test": [
+                       "parallel-lint . --exclude vendor",
+                       "phpcs -p -s"
+               ]
+       }
+}
diff --git a/i18n/en.json b/i18n/en.json
new file mode 100644
index 0000000..6834403
--- /dev/null
+++ b/i18n/en.json
@@ -0,0 +1,9 @@
+{
+    "@metadata": {
+        "authors": [
+            "pastakhov"
+        ]
+    },
+    "skinname-empty": "Empty",
+    "empty-skin-desc": "the Empty skin for your imagination"
+}
diff --git a/i18n/qqq.json b/i18n/qqq.json
new file mode 100644
index 0000000..da67630
--- /dev/null
+++ b/i18n/qqq.json
@@ -0,0 +1,9 @@
+{
+       "@metadata": {
+               "authors": [
+                       "pastakhov"
+               ]
+       },
+       "skinname-empty": "{{optional}}",
+    "empty-skin-desc": 
"{{desc|what=skin|name=Empty|url=https://www.mediawiki.org/wiki/Skin:Empty}}";
+}
diff --git a/includes/Empty.json b/includes/Empty.json
new file mode 100644
index 0000000..f9151ea
--- /dev/null
+++ b/includes/Empty.json
@@ -0,0 +1,100 @@
+{
+       "objects": {
+               "Skin": {
+                       "class": "Skin",
+                       "STATIC METHODS": {
+                               "insertRawHTMLElement": {
+                                       "parameters": [
+                                               { "type": "string", "name": 
"element" },
+                                               { "type": "array", "name": 
"attribs", "default": "null" },
+                                               { "type": "string", "name": 
"$content", "default": "null" }
+                                       ],
+                                       "return": "bool",
+                                       "desc": "Insert raw HTML element"
+                               },
+                               "insertFirstHeading": {
+                                       "parameters": [
+                                               { "type": "string", "name": 
"title", "default": "null" }
+                                       ],
+                                       "return": "bool",
+                                       "desc": "Insert first heading"
+                               },
+                               "insertIndicators": {
+                                       "parameters": [],
+                                       "return": "bool",
+                                       "desc": "Insert Indicators"
+                               },
+                               "insertBodyText": {
+                                       "parameters": [],
+                                       "return": "bool",
+                                       "desc": "Insert body text"
+                               },
+                               "insertBodyContent": {
+                                       "parameters": [],
+                                       "return": "bool",
+                                       "desc": "Insert body content"
+                               },
+                               "insertCatlinks": {
+                                       "parameters": [],
+                                       "return": "bool",
+                                       "desc": "Insert category links"
+                               },
+                               "insertDataAfterContent": {
+                                       "parameters": [],
+                                       "return": "bool",
+                                       "desc": "Insert SkinAfterContent hook 
result"
+                               },
+                               "insertSiteNotice": {
+                                       "parameters": [],
+                                       "return": "bool",
+                                       "desc": "Insert site notice"
+                               },
+                               "insertTagLine": {
+                                       "parameters": [],
+                                       "return": "bool",
+                                       "desc": "Insert tag line"
+                               },
+                               "insertSubtitle": {
+                                       "parameters": [],
+                                       "return": "bool",
+                                       "desc": "Insert subtitle"
+                               },
+                               "insertUndelete": {
+                                       "parameters": [],
+                                       "return": "bool",
+                                       "desc": "Insert undelete"
+                               },
+                               "insertNewTalk": {
+                                       "parameters": [],
+                                       "return": "bool",
+                                       "desc": "Insert new talk"
+                               },
+                               "insertLogoBanner": {
+                                       "parameters": [],
+                                       "return": "bool",
+                                       "desc": "Insert wiki logo"
+                               },
+                               "getLastModified": {
+                                       "parameters": [],
+                                       "return": "bool",
+                                       "desc": "Returns last modified string"
+                               }
+                       }
+               }
+       },
+       "functions": {
+               "foundation5": {
+                       "class": "Foundation",
+                       "parameters": [],
+                       "return": "bool",
+                       "desc": "initializes the Foundation 5"
+               }
+       },
+       "constants": {
+               "EMPTY_SKIN_VERSION" : {
+                       "desc": "The current version of the Empty skin as a 
string",
+                       "type": "string",
+                       "link": "https://www.mediawiki.org/wiki/Skin:Empty";
+               }
+       }
+}
diff --git a/includes/Skin.php b/includes/Skin.php
new file mode 100644
index 0000000..f4b5c6b
--- /dev/null
+++ b/includes/Skin.php
@@ -0,0 +1,296 @@
+<?php
+namespace PhpTagsObjects;
+
+/**
+ * Description of Skin
+ *
+ * @author pastakhov
+ */
+class Skin extends \PhpTags\GenericObject {
+
+       private static $cache = [];
+
+       /**
+        *
+        * @var \SkinEmpty
+        */
+       private static $skin;
+
+       /**
+        *
+        * @var \OutputPage
+        */
+       private static $out;
+
+       public static function setSkin( \Skin $skin ) {
+               self::$skin = $skin;
+               self::$out = $skin->getOutput();
+       }
+
+       private static function getData( $str ) {
+               if ( isset( self::$cache[$str] ) ) {
+                       return self::$cache[$str][1];
+               }
+               return self::loadData( $str );
+       }
+
+       /**
+        *
+        * @param string $str
+        * @return mixed
+        */
+       private static function loadData( $str ) {
+               $ret = null;
+
+               switch ( $str ) {
+                       case 'title':
+                               $ret = self::$out->getPageTitle();
+                               break;
+                       case 'pageLanguage':
+                               $ret = 
self::$out->getContext()->getTitle()->getPageViewLanguage()->getHtmlCode();
+                               break;
+                       case 'indicators':
+                               $ret = self::$out->getIndicators();
+                               break;
+                       case 'printfooter':
+                               $ret = self::$skin->printSource();
+                               break;
+                       case 'debughtml':
+                               $ret = self::$skin->generateDebugHTML();
+                               break;
+                       case 'catlinks':
+                               $ret = self::$skin->getCategories();
+                               break;
+                       case 'dataAfterContent':
+                               $ret = self::$skin->afterContentHook();
+                               break;
+                       case 'sitenotice':
+                               $ret = self::$skin->getSiteNotice();
+                               break;
+                       case 'tagline':
+                               $ret = self::$skin->msg( 'tagline' );
+                               break;
+                       case 'undelete':
+                               $ret = self::$skin->getUndeleteLink();
+                               if ( $ret !== '' ) {
+                                       $ret = '<span class="subpages">' . $ret 
. '</span>';
+                               }
+                               break;
+                       case 'newtalk':
+                               $ret = self::$skin->getNewtalks();
+                               break;
+                       case 'mainpageurl':
+                               $ret = \Skin::makeMainPageUrl();
+                               break;
+                       case 'lastmod':
+                               if ( self::$out->isArticle() && 
self::$skin->getTitle()->exists() && self::$skin->isRevisionCurrent() ) {
+                                       $ret = self::$skin->lastModified();
+                               }
+                               break;
+               }
+               self::$cache[$str][0] = true;
+               self::$cache[$str][1] =& $ret;
+               return $ret;
+       }
+
+       /**
+        * copied from SkinTemplate::prepareQuickTemplate()
+        */
+       private static function getUserLangAttributes() {
+               static $atributes = false;
+
+               if ( $atributes === false ) {
+                       global $wgUserLangCode, $wgContLang, $wgUserLangDir;
+                       if ( $wgUserLangCode !== $wgContLang->getHtmlCode() || 
$wgUserLangDir !== $wgContLang->getDir() ) {
+                               $atributes = [ 'lang' => $wgUserLangCode, 'dir' 
=> $wgUserLangDir ];
+                       } else {
+                               $atributes = [];
+                       }
+               }
+
+               return $atributes;
+       }
+
+       // @codingStandardsIgnoreLine
+       public static function s_insertFirstHeading( $title = null ) {
+               if ( self::$skin === null ) {
+                       return false;
+               }
+
+               $attribs = [
+                       'id' => 'firstHeading',
+                       'class' => 'firstHeading',
+                       'lang' => self::getData( 'pageLanguage' ),
+               ];
+
+               return new \PhpTags\outPrint( true, $title ?: self::getData( 
'title' ), false, 'h1', $attribs );
+       }
+
+       // @codingStandardsIgnoreLine
+       public static function s_insertIndicators() {
+               if ( self::$skin === null ) {
+                       return false;
+               }
+
+               $out = '';
+               $indicators = self::getData( 'indicators' );
+               foreach ( $indicators as $id => $content ) {
+                       $out .= \Html::rawElement(
+                               'div',
+                               [
+                                       'id' => \Sanitizer::escapeId( 
"mw-indicator-$id" ),
+                                       'class' => 'mw-indicator',
+                               ],
+                               $content
+                       ) . "\n";
+               }
+               return new \PhpTags\outPrint( true, $out, true, 'div', [ 
'class' => 'mw-indicators' ] );
+       }
+
+       // @codingStandardsIgnoreLine
+       public static function s_insertBodyContent() {
+               $output = self::$out;
+               if ( $output === null ) {
+                       return false;
+               }
+
+               return new \PhpTags\outPrint( true, $output->mBodytext, true, 
'div', [ 'class' => 'bodycontent' ] );
+       }
+
+       // @codingStandardsIgnoreLine
+       public static function s_insertBodyText() {
+               $output = self::$out;
+               if ( $output === null ) {
+                       return false;
+               }
+
+               $bodyText = $output->mBodytext .
+                               \Html::rawElement(
+                                               'div',
+                                               [ 'class' => 'printfooter' ],
+                                               "\n" . self::getData( 
'printfooter' )
+                                       ) . "\n" .
+                                       self::getData( 'debughtml' );
+
+               return new \PhpTags\outPrint( true, $bodyText, true, 'div', [ 
'class' => 'bodytext' ] );
+       }
+
+       // @codingStandardsIgnoreLine
+       public static function s_insertCatlinks() {
+               if ( self::$skin === null ) {
+                       return false;
+               }
+
+               $catlinks = self::getData( 'catlinks' );
+               if ( $catlinks ) {
+                       return new \PhpTags\outPrint( true, $catlinks, true, 
'div' );
+               }
+       }
+
+       // @codingStandardsIgnoreLine
+       public static function s_insertDataAfterContent() {
+               if ( self::$skin === null ) {
+                       return false;
+               }
+
+               $data = self::getData( 'dataAfterContent' );
+               if ( $data ) {
+                       return new \PhpTags\outPrint( true, $data, true, 'div', 
[ 'class' => 'dataAfterContent' ] );
+               }
+       }
+
+       // @codingStandardsIgnoreLine
+       public static function s_insertSiteNotice() {
+               if ( self::$skin === null ) {
+                       return false;
+               }
+
+               $sitenotice = self::getData( 'sitenotice' );
+               if ( $sitenotice ) {
+                       return new \PhpTags\outPrint( true, $sitenotice, true, 
'div', [ 'class' => 'sitenotice' ] );
+               }
+       }
+
+       // @codingStandardsIgnoreLine
+       public static function s_insertTagLine() {
+               if ( self::$skin === null ) {
+                       return false;
+               }
+
+               $tagline = self::getData( 'tagline' );
+               if ( $tagline ) {
+                       return new \PhpTags\outPrint( true, $tagline, true, 
'div', [ 'id' => 'siteSub' ] );
+               }
+       }
+
+       // @codingStandardsIgnoreLine
+       public static function s_insertSubtitle() {
+               if ( self::$skin === null ) {
+                       return false;
+               }
+
+               $subtitle = self::getData( 'subtitle' );
+               if ( $subtitle ) {
+                       return new \PhpTags\outPrint( true, $subtitle, true, 
'div', [ 'id' => 'contentSub' ] + self::getUserLangAttributes() );
+               }
+       }
+
+       // @codingStandardsIgnoreLine
+       public static function s_insertUndelete() {
+               if ( self::$skin === null ) {
+                       return false;
+               }
+
+               $undelete = self::getData( 'undelete' );
+               if ( $undelete ) {
+                       return new \PhpTags\outPrint( true, $undelete, true, 
'div', [ 'id' => 'contentSub2' ] );
+               }
+       }
+
+       // @codingStandardsIgnoreLine
+       public static function s_insertNewTalk() {
+               if ( self::$skin === null ) {
+                       return false;
+               }
+
+               $newtalk = self::getData( 'newtalk' );
+               if ( $newtalk ) {
+                       return new \PhpTags\outPrint( true, $newtalk, true, 
'div', [ 'class' => 'usermessage' ] );
+               }
+       }
+
+       // @codingStandardsIgnoreLine
+       public static function s_insertLogoBanner() {
+               if ( self::$skin === null ) {
+                       return false;
+               }
+
+               // copy from MonoBookTemplate.php
+               $logo = \Html::element( 'a', [
+                       'href' => self::getData( 'mainpageurl' ),
+                       'class' => 'mw-wiki-logo',
+                       ]
+                       + \Linker::tooltipAndAccesskeyAttribs( 'p-logo' )
+               );
+               return new \PhpTags\outPrint( true, $logo, true, 'div', [ 
'class' => 'portlet', 'id' => 'p-logo', 'role' => 'banner' ] );
+       }
+
+       // @codingStandardsIgnoreLine
+       public static function s_getLastModified() {
+               if ( self::$skin === null ) {
+                       return false;
+               }
+
+               return self::getData( 'lastmod' );
+       }
+
+       // @codingStandardsIgnoreLine
+       public static function s_insertRawHTMLElement( $element, $attribs = [], 
$content = '' ) {
+               if ( self::$skin === null ) {
+                       return false;
+               }
+
+               return new \PhpTags\outPrint( true, $content, true, $element, 
$attribs );
+       }
+
+}
diff --git a/package.json b/package.json
new file mode 100644
index 0000000..bb6971e
--- /dev/null
+++ b/package.json
@@ -0,0 +1,16 @@
+{
+  "private": true,
+  "scripts": {
+    "test": "grunt test"
+  },
+  "devDependencies": {
+    "eslint-config-wikimedia": "0.4.0",
+    "grunt": "1.0.1",
+    "grunt-banana-checker": "0.6.0",
+    "grunt-eslint": "20.0.0",
+    "grunt-jsonlint": "1.1.0",
+    "grunt-stylelint": "0.8.0",
+    "stylelint": "7.8.0",
+    "stylelint-config-wikimedia": "0.4.1"
+  }
+}
diff --git a/phpcs.xml b/phpcs.xml
new file mode 100644
index 0000000..e688c40
--- /dev/null
+++ b/phpcs.xml
@@ -0,0 +1,13 @@
+<?xml version="1.0"?>
+<ruleset>
+       <rule ref="./vendor/mediawiki/mediawiki-codesniffer/MediaWiki">
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationProtected" />
+               <exclude 
name="MediaWiki.Commenting.FunctionComment.MissingDocumentationPublic" />
+               <exclude name="MediaWiki.Files.ClassMatchesFilename.NotMatch" />
+               <exclude 
name="MediaWiki.WhiteSpace.SpaceBeforeSingleLineComment.NewLineComment" />
+       </rule>
+       <file>.</file>
+       <arg name="extensions" value="php,php5,inc" />
+       <arg name="encoding" value="utf8" />
+       <exclude-pattern>vendor</exclude-pattern>
+</ruleset>
diff --git a/skin.json b/skin.json
new file mode 100644
index 0000000..46f75f8
--- /dev/null
+++ b/skin.json
@@ -0,0 +1,35 @@
+{
+       "name": "Empty",
+       "version": "1.0",
+       "author": "[https://www.mediawiki.org/wiki/User:Pastakhov Pavel 
Astakhov]",
+       "url": "https://www.mediawiki.org/wiki/Skin:Empty";,
+       "descriptionmsg": "empty-skin-desc",
+       "namemsg": "skinname-empty",
+       "license-name": "GPL-2.0+",
+       "type": "skin",
+       "requires": {
+               "MediaWiki": ">= 1.25.0"
+       },
+       "ConfigRegistry": {
+               "vector": "GlobalVarConfig::newInstance"
+       },
+       "ValidSkinNames": {
+               "empty": "Empty"
+       },
+       "MessagesDirs": {
+               "Empty": [
+                       "i18n"
+               ]
+       },
+       "Hooks": {
+               "ParserFirstCallInit": "EmptyHooks::onParserFirstCallInit",
+               "PhpTagsRuntimeFirstInit": 
"EmptyHooks::onPhpTagsRuntimeFirstInit"
+       },
+       "AutoloadClasses": {
+               "EmptyTemplate": "EmptyTemplate.php",
+               "SkinEmpty": "SkinEmpty.php",
+               "EmptyHooks": "EmptyHooks.php",
+               "PhpTagsObjects\\Skin": "includes/Skin.php"
+       },
+       "manifest_version": 1
+}

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I44454bc0a2a1f85feec83566ed9469e4c9d19e30
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/Empty
Gerrit-Branch: master
Gerrit-Owner: Pastakhov <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to