http://www.mediawiki.org/wiki/Special:Code/MediaWiki/99819

Revision: 99819
Author:   preilly
Date:     2011-10-14 22:01:43 +0000 (Fri, 14 Oct 2011)
Log Message:
-----------
fix for bug 31710 - ios app show both native and mobile web search input fields

Modified Paths:
--------------
    trunk/extensions/MobileFrontend/MobileFrontend.php
    trunk/extensions/MobileFrontend/views/layout/_search_webkit.html.php

Modified: trunk/extensions/MobileFrontend/MobileFrontend.php
===================================================================
--- trunk/extensions/MobileFrontend/MobileFrontend.php  2011-10-14 21:33:46 UTC 
(rev 99818)
+++ trunk/extensions/MobileFrontend/MobileFrontend.php  2011-10-14 22:01:43 UTC 
(rev 99819)
@@ -128,6 +128,7 @@
        public static $leaveFeedbackURL;
        public static $mobileRedirectFormAction;
        public static $isBetaGroupMember = false;
+       public static $hideSearchBox = false;
 
        public static $messageKeys = array(
                'mobile-frontend-show-button',
@@ -556,6 +557,12 @@
        
        private function checkUserStatus() {
                wfProfileIn( __METHOD__ );
+               
+               if ( !empty( $_SERVER['HTTP_APPLICATION_VERSION'] ) && 
+                       strpos( $_SERVER['HTTP_APPLICATION_VERSION'], 
'Wikipedia Mobile' ) !== false ) {
+                       self::$hideSearchBox = true;
+               }
+               
                $optInCookie = $this->getOptInOutCookie();
                if ( !empty( $optInCookie ) && 
                        $optInCookie == 1 ) {

Modified: trunk/extensions/MobileFrontend/views/layout/_search_webkit.html.php
===================================================================
--- trunk/extensions/MobileFrontend/views/layout/_search_webkit.html.php        
2011-10-14 21:33:46 UTC (rev 99818)
+++ trunk/extensions/MobileFrontend/views/layout/_search_webkit.html.php        
2011-10-14 22:01:43 UTC (rev 99819)
@@ -9,11 +9,14 @@
 
 $scriptUrl = wfScript();
 
+if (self::$hideSearchBox)
+$searchBoxDisplayNone = ' style="display: none;" ';
+
 $searchWebkitHtml = <<<EOD
 <div id='header'>
        <div id='searchbox'>
        <img width="35" height="22" alt='Logo' id='logo' 
src='{$wgMobileFrontendLogo}' />
-       <form action='{$scriptUrl}' class='search_bar' method='get'>
+       <form action='{$scriptUrl}' class='search_bar' method='get' 
{$searchBoxDisplayNone}>
          <input type="hidden" value="Special:Search" name="title" />
                <div id="sq" class="divclearable">
                        <input type="text" name="search" id="search" size="22" 
value="{$searchField}" />


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

Reply via email to