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

Change subject: WIP: Avoid SkinMobile-specific functions and properties
......................................................................


WIP: Avoid SkinMobile-specific functions and properties

Instead, use OutputPage properties from 
https://gerrit.wikimedia.org/r/#/c/48208/
Helps avoid fatals/confusion

Change-Id: I6eabb5fb41b9f280a44c4ef8a1f2150ff092d741
---
M includes/skins/SkinMobile.php
M includes/skins/SkinMobileBase.php
M includes/specials/SpecialMobileWatchlist.php
3 files changed, 5 insertions(+), 24 deletions(-)

Approvals:
  awjrichards: Verified; Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/skins/SkinMobile.php b/includes/skins/SkinMobile.php
index 3bca8ac..a783330 100644
--- a/includes/skins/SkinMobile.php
+++ b/includes/skins/SkinMobile.php
@@ -16,7 +16,7 @@
                $user = $this->getUser();
                $tpl->set( 'title', $title );
                $tpl->set( 'user', $user );
-               $tpl->set( 'menuButton', $this->getMenuButton() );
+               $tpl->set( 'menuButton', self::getMenuButton() );
                $specialPage = $title->isSpecialPage();
                $context = MobileContext::singleton();
 
@@ -216,7 +216,7 @@
                        $postBodyText .= "<p id=\"mw-mf-last-modified\" 
data-timestamp=\"$timestamp\">$lastModified</p>";
                }
 
-               $htmlHeader = $this->getHtmlHeader();
+               $htmlHeader = $this->getOutput()->getProperty( 
'mobile.htmlHeader' );
                if ( !$htmlHeader && $isSpecialPage ) {
                        $htmlHeader = Html::element( 'h1', array( 'class' => 
'header' ), $pageHeading );
                }
@@ -589,7 +589,7 @@
                return $link;
        }
 
-       public function getMenuButton() {
+       public static function getMenuButton() {
                $url = SpecialPage::getTitleFor( 'MobileMenu' )->getLocalUrl() 
. '#mw-mf-page-left';
                return Html::element( 'a', array(
                                'title' => wfMessage( 
'mobile-frontend-main-menu-button-tooltip' )->text(),
diff --git a/includes/skins/SkinMobileBase.php 
b/includes/skins/SkinMobileBase.php
index e59219b..0f3d084 100644
--- a/includes/skins/SkinMobileBase.php
+++ b/includes/skins/SkinMobileBase.php
@@ -7,27 +7,8 @@
        protected $extMobileFrontend;
        protected $hookOptions;
 
-       /** @var string html representing the header of the skin */
-       private $mobileHtmlHeader = null;
-
        /** @var array of classes that should be present on the body tag */
        private $pageClassNames = array();
-
-       /**
-        * Provides alternative html for the header
-        * @return string html
-        */
-       public function getHtmlHeader() {
-               return $this->mobileHtmlHeader;
-       }
-
-       /**
-        * Provides alternative html for the header
-        * @param string html
-        */
-       public function setHtmlHeader( $html ) {
-               $this->mobileHtmlHeader = $html;
-       }
 
        /**
         * This will be called by OutputPage::headElement when it is creating 
the
diff --git a/includes/specials/SpecialMobileWatchlist.php 
b/includes/specials/SpecialMobileWatchlist.php
index dd9b7ec..5f6ff74 100644
--- a/includes/specials/SpecialMobileWatchlist.php
+++ b/includes/specials/SpecialMobileWatchlist.php
@@ -18,8 +18,7 @@
 
                $ctx = MobileContext::singleton();
                $this->usePageImages = !$ctx->imagesDisabled() && defined( 
'PAGE_IMAGES_INSTALLED' );
-               $skin = $ctx->getSkin();
-               $skin->setHtmlHeader( $this->getWatchlistHeader() ); // FIXME: 
assumes mobile skin = bad
+               $this->getOutput()->setProperty( 'mobile.htmlHeader', 
$this->getWatchlistHeader() );
 
                $user = $this->getUser();
                $output = $this->getOutput();
@@ -106,6 +105,7 @@
                                array(
                                        'class' => 'mw-mf-watchlist-views 
header' )
                                ) .
+                       SkinMobile::getMenuButton() .
                        Html::openElement( 'div',
                                array(
                                        'class' => 'mw-mf-view-filters' )

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I6eabb5fb41b9f280a44c4ef8a1f2150ff092d741
Gerrit-PatchSet: 5
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: MaxSem <[email protected]>
Gerrit-Reviewer: JGonera <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: MaxSem <[email protected]>
Gerrit-Reviewer: awjrichards <[email protected]>
Gerrit-Reviewer: jenkins-bot

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

Reply via email to