diff options
author | Alex Legler <alex@a3li.li> | 2015-08-14 21:20:23 +0200 |
---|---|---|
committer | Alex Legler <alex@a3li.li> | 2015-08-14 21:20:23 +0200 |
commit | c9ae68fab928225cf80ebdcef32b78cb4f0cf873 (patch) | |
tree | 0926f9e9799352024d4e6c5ec048cff1bcfeb3da | |
parent | Add GPLv2 (diff) | |
download | skin-tyrian-c9ae68fab928225cf80ebdcef32b78cb4f0cf873.tar.gz skin-tyrian-c9ae68fab928225cf80ebdcef32b78cb4f0cf873.tar.bz2 skin-tyrian-c9ae68fab928225cf80ebdcef32b78cb4f0cf873.zip |
Clean up indenting, licenses, various other bits
-rw-r--r-- | SkinTyrian.php | 52 | ||||
-rw-r--r-- | Tyrian.php | 36 | ||||
-rw-r--r-- | TyrianTemplate.php | 110 |
3 files changed, 78 insertions, 120 deletions
diff --git a/SkinTyrian.php b/SkinTyrian.php index 5c3cb2c..ab5e934 100644 --- a/SkinTyrian.php +++ b/SkinTyrian.php @@ -1,27 +1,9 @@ <?php /** - * MonoBook nouveau. + * Tyrian -- the new look of gentoo.org + * MediaWiki implementation based on MonoBook nouveau. * - * Translated from gwicke's previous TAL template version to remove - * dependency on PHPTAL. - * - * 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 - * - * @file - * @ingroup Skins + * Copyright (C) 2014-2015 Alex Legler <a3li@gentoo.org> */ /** @@ -29,28 +11,22 @@ * @ingroup Skins */ class SkinTyrian extends SkinTemplate { - public $skinname = 'tyrian'; + public $skinname = 'tyrian'; public $stylename = 'Tyrian'; - public $template = 'TyrianTemplate'; + public $template = 'TyrianTemplate'; + + const CDN_URL = 'https://1b9a50f4f9de4348cd9f-e703bc50ba0aa66772a874f8c7698be7.ssl.cf5.rackcdn.com/'; - /** - * @param OutputPage $out - */ - function setupSkinUserCss( OutputPage $out ) { - parent::setupSkinUserCss( $out ); + function setupSkinUserCss(OutputPage $out) { + parent::setupSkinUserCss($out); - $out->addStyle( 'https://1b9a50f4f9de4348cd9f-e703bc50ba0aa66772a874f8c7698be7.ssl.cf5.rackcdn.com/bootstrap.min.css' ); - $out->addStyle( 'https://1b9a50f4f9de4348cd9f-e703bc50ba0aa66772a874f8c7698be7.ssl.cf5.rackcdn.com/tyrian.min.css' ); - //$out->addStyle( 'https://1b9a50f4f9de4348cd9f-e703bc50ba0aa66772a874f8c7698be7.ssl.cf5.rackcdn.com/chameleon.min.css' ); + $out->addStyle(SkinTyrian::CDN_URL . 'bootstrap.min.css'); + $out->addStyle(SkinTyrian::CDN_URL . 'tyrian.min.css'); - $out->addModuleStyles( array( + $out->addModuleStyles(array( 'mediawiki.skinning.interface', 'mediawiki.skinning.content.externallinks', 'skins.tyrian.styles' - ) ); - - // // TODO: Migrate all of these - // $out->addStyle( $this->stylename . '/IE60Fixes.css', 'screen', 'IE 6' ); - // $out->addStyle( $this->stylename . '/IE70Fixes.css', 'screen', 'IE 7' ); + )); } -} +}
\ No newline at end of file @@ -1,27 +1,9 @@ <?php /** - * MonoBook nouveau. + * Tyrian -- the new look of gentoo.org + * MediaWiki implementation based on MonoBook nouveau. * - * Translated from gwicke's previous TAL template version to remove - * dependency on PHPTAL. - * - * 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 - * - * @file - * @ingroup Skins + * Copyright (C) 2014-2015 Alex Legler <a3li@gentoo.org> */ $wgExtensionCredits['skin'][] = array( @@ -30,8 +12,8 @@ $wgExtensionCredits['skin'][] = array( 'namemsg' => 'skinname-tyrian', 'descriptionmsg' => 'tyrian-desc', 'url' => 'http://www.gentoo.org/', - 'author' => array( 'Alex Legler' ), - 'license-name' => 'GPLv3+', + 'author' => array('Alex Legler'), + 'license-name' => 'GPLv2', ); // Register files @@ -45,7 +27,7 @@ $wgValidSkinNames['tyrian'] = 'Tyrian'; // Register modules $wgResourceModules['skins.tyrian.styles'] = array( 'styles' => array( - 'main.css' => array( 'media' => 'screen' ), + 'main.css' => array('media' => 'screen'), ), 'remoteSkinPath' => 'Tyrian', 'localBasePath' => __DIR__, @@ -53,8 +35,8 @@ $wgResourceModules['skins.tyrian.styles'] = array( $wgHooks['OutputPageBeforeHTML'][] = 'injectMetaTags'; -function injectMetaTags( $out ) { - $out->addMeta( 'viewport', 'width=device-width, initial-scale=1.0' ); - $out->addMeta( 'theme-color', '#54487a' ); +function injectMetaTags($out) { + $out->addMeta('viewport', 'width=device-width, initial-scale=1.0'); + $out->addMeta('theme-color', '#54487a'); return true; } diff --git a/TyrianTemplate.php b/TyrianTemplate.php index f198fcc..a068f1c 100644 --- a/TyrianTemplate.php +++ b/TyrianTemplate.php @@ -1,6 +1,9 @@ <?php /** - * @ingroup Skins + * Tyrian -- the new look of gentoo.org + * MediaWiki implementation based on MonoBook nouveau. + * + * Copyright (C) 2014-2015 Alex Legler <a3li@gentoo.org> */ class TyrianTemplate extends BaseTemplate { function execute() { @@ -11,9 +14,9 @@ class TyrianTemplate extends BaseTemplate { $this->header(); ?> - <div class="container"> - <div class="row"> - <div class="col-md-12"> + <div class="container"> + <div class="row"> + <div class="col-md-12"> <div id="content" class="mw-body" role="main"> <a id="top"></a> <?php if ( $this->data['sitenotice'] ) { ?> @@ -212,10 +215,10 @@ class TyrianTemplate extends BaseTemplate { <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform" class="navbar-form navbar-right" role="search"> <input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/> - <div class="input-group"> - <?php echo $this->makeSearchInput( array( "id" => "searchInput", "class" => "form-control", "placeholder" => $this->getMsg( 'search' )->escaped() ) ); ?> - <div class="input-group-btn"><?php - echo $this->makeSearchButton( + <div class="input-group"> + <?php echo $this->makeSearchInput( array( "id" => "searchInput", "class" => "form-control", "placeholder" => $this->getMsg( 'search' )->escaped() ) ); ?> + <div class="input-group-btn"><?php + echo $this->makeSearchButton( "go", array( "id" => "searchGoButton", "class" => "searchButton btn btn-default" ) ); @@ -225,7 +228,7 @@ class TyrianTemplate extends BaseTemplate { array( "id" => "mw-searchButton", "class" => "searchButton btn btn-default" ) ); ?></div> - </div> + </div> </form> <?php } @@ -262,47 +265,44 @@ class TyrianTemplate extends BaseTemplate { ?> <nav class="navbar navbar-grey navbar-stick" id="wiki-actions" role="navigation"> - <div class="container"><div class="row"> - <!-- Brand and toggle get grouped for better mobile display --> - <div class="navbar-header"> - <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#gw-toolbar"> - <span class="sr-only">Toggle navigation</span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - <span class="icon-bar"></span> - </button> - </div> - - <!-- Collect the nav links, forms, and other content for toggling --> - <div class="collapse navbar-collapse" id="gw-toolbar"> - <ul class="nav navbar-nav"> - <?php - foreach ( $context_actions as $key => $tab ) { - echo $this->makeListItem( $key, $tab ); - } - ?> - </ul> - <?php - $this->searchBox(); - ?> - <ul class="nav navbar-nav navbar-right hidden-xs"> - <?php - foreach ( $primary_actions as $key => $tab ) { - echo $this->makeListItem( $key, $tab ); - } - ?> <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">more <span class="caret"></span></a> - <ul class="dropdown-menu" role="menu"> - <?php - foreach ( $secondary_actions as $key => $tab ) { - echo $this->makeListItem( $key, $tab ); - } - ?> - </ul> - </li> - </ul> - </div><!-- /.navbar-collapse --> - </div></div><!-- /.container-fluid --> + <div class="container"><div class="row"> + <div class="navbar-header"> + <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#gw-toolbar"> + <span class="sr-only">Toggle navigation</span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + <span class="icon-bar"></span> + </button> + </div> + <div class="collapse navbar-collapse" id="gw-toolbar"> + <ul class="nav navbar-nav"> + <?php + foreach ( $context_actions as $key => $tab ) { + echo $this->makeListItem( $key, $tab ); + } + ?> + </ul> + <?php + $this->searchBox(); + ?> + <ul class="nav navbar-nav navbar-right hidden-xs"> + <?php + foreach ( $primary_actions as $key => $tab ) { + echo $this->makeListItem( $key, $tab ); + } + ?><li class="dropdown"> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false">more <span class="caret"></span></a> + <ul class="dropdown-menu" role="menu"> + <?php + foreach ( $secondary_actions as $key => $tab ) { + echo $this->makeListItem( $key, $tab ); + } + ?> + </ul> + </li> + </ul> + </div> + </div></div> </nav> <?php } @@ -330,9 +330,9 @@ class TyrianTemplate extends BaseTemplate { function personaltools() { ?> <li class="dropdown"> - <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> - <span class="glyphicon glyphicon-user" aria-label="<?php $this->msg( 'personaltools' ) ?>"></span> - <?php $this->msg( 'listfiles_user' ) ?> + <a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-expanded="false"> + <span class="glyphicon glyphicon-user" aria-label="<?php $this->msg( 'personaltools' ) ?>"></span> + <?php $this->msg( 'listfiles_user' ) ?> <span class="caret"></span> </a> <ul class="dropdown-menu" role="menu"> @@ -394,7 +394,7 @@ class TyrianTemplate extends BaseTemplate { } } } else { - echo "<!-- This would have been a box, but it contains custom html which is not supported. -->"; + echo "<!-- This would have been a box, but it contains custom HTML which is not supported. -->"; } if ( $bar !== 'navigation' ) { ?> @@ -402,4 +402,4 @@ class TyrianTemplate extends BaseTemplate { </li> <?php } } -} // end of class +}
\ No newline at end of file |