Jack Phoenix has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/149781

Change subject: Support for a custom logo ([[File:BlueSky-logo.png]]).
......................................................................

Support for a custom logo ([[File:BlueSky-logo.png]]).

The sitename, rendered as an <h2> element, is used as a fallback in the
absence of a custom logo.

Change-Id: Icb860c5e91414d884040799b67be8836b0409ce2
---
M BlueSky.skin.php
M resources/css/main.css
2 files changed, 26 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/skins/BlueSky 
refs/changes/81/149781/1

diff --git a/BlueSky.skin.php b/BlueSky.skin.php
index 2aa74c6..cb931ec 100644
--- a/BlueSky.skin.php
+++ b/BlueSky.skin.php
@@ -1466,7 +1466,7 @@
         * outputs a formatted page.
         */
        public function execute() {
-               global $wgStylePath, $wgLanguageCode, $wgForumLink;
+               global $wgStylePath, $wgSitename, $wgForumLink;
 
                if ( class_exists( 'MobileWikihow' ) ) {
                        $mobileWikihow = new MobileWikihow();
@@ -1687,12 +1687,30 @@
                        <?php endif; ?>
                        <?php
                                $holidayLogo = SkinBlueSky::getHolidayLogo();
-                               $logoPath = $holidayLogo ? $holidayLogo : 
$wgStylePath . '/BlueSky/resources/images/wikihow_logo.png';
-                               if ( $wgLanguageCode != 'en' ) {
-                                       $logoPath = $wgStylePath . 
'/BlueSky/resources/images/wikihow_logo_intl.png';
+                               $customLogo = wfFindFile( 'BlueSky-logo.png' );
+                               /**
+                                * Pick a logo if we can find one. Otherwise 
just show the
+                                * sitename in its place in the fixed header.
+                                */
+                               if ( is_object( $customLogo ) ) {
+                                       $logoElement = Html::element( 'img', 
array(
+                                               'src' => $customLogo->getUrl(),
+                                               'class' => 'logo',
+                                               'alt' => ''
+                                       ) );
+                               } elseif ( $holidayLogo ) {
+                                       $logoElement = Html::element( 'img', 
array(
+                                               'src' => $holidayLogo,
+                                               'class' => 'logo',
+                                               'alt' => ''
+                                       ) );
+                               } else {
+                                       $logoElement = Html::element( 'h2', 
array(
+                                               'class' => 'logo-text'
+                                       ), $wgSitename );
                                }
                        ?>
-                       <a href="<?php echo $mainPageObj->getLocalURL(); ?>" 
id="logo_link"><img src="<?php echo $logoPath ?>" class="logo" alt="" /></a>
+                       <a href="<?php echo $mainPageObj->getLocalURL(); ?>" 
id="logo_link"><?php echo $logoElement ?></a>
                        <?php echo $top_search ?>
                        <?php wfRunHooks( 'EndOfHeader', array( &$out ) ); ?>
                </div></div><!--end #header-->
diff --git a/resources/css/main.css b/resources/css/main.css
index 1105f85..af50d7c 100644
--- a/resources/css/main.css
+++ b/resources/css/main.css
@@ -481,6 +481,9 @@
 #header.shrunk .logo {
        margin: 0 20px 0 0;
 }
+#header a#logo_link h2.logo-text {
+       margin-top: 15px;
+}
 
 #cse-search-box, #header #bubble_search {
        padding: 15px 15px 15px 0;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icb860c5e91414d884040799b67be8836b0409ce2
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/skins/BlueSky
Gerrit-Branch: master
Gerrit-Owner: Jack Phoenix <j...@countervandalism.net>

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

Reply via email to