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

Revision: 90022
Author:   preilly
Date:     2011-06-14 00:06:09 +0000 (Tue, 14 Jun 2011)
Log Message:
-----------
"home" link on the RTL wiki leads to the English mobile main page

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

Added Paths:
-----------
    trunk/extensions/MobileFrontend/images/w.gif

Modified: trunk/extensions/MobileFrontend/MobileFrontend.php
===================================================================
--- trunk/extensions/MobileFrontend/MobileFrontend.php  2011-06-13 23:43:01 UTC 
(rev 90021)
+++ trunk/extensions/MobileFrontend/MobileFrontend.php  2011-06-14 00:06:09 UTC 
(rev 90022)
@@ -48,7 +48,7 @@
                                                                                
        'onOutputPageBeforeHTML' );
 
 class ExtMobileFrontend {
-       const VERSION = '0.4.7';
+       const VERSION = '0.4.8';
 
        private $doc;
        
@@ -60,6 +60,8 @@
        public static $code;
        public static $device;
        public static $headings;
+       public static $mainPageUrl;
+       public static $randomPageUrl;
 
        public $itemsToRemove = array(
                '#contentSub',            # redirection notice
@@ -116,6 +118,9 @@
                self::$dir = $wgContLang->getDir();
                self::$code = $wgContLang->getCode();
                
+               self::$mainPageUrl = Title::newMainPage()->getFullUrl();
+               self::$randomPageUrl = SpecialPage::getTitleFor( 'Random' 
)->getFullUrl();
+               
                try {
                        $wurflConfigFile = RESOURCES_DIR . 'wurfl-config.xml';
                        $wurflConfig = new WURFL_Configuration_XmlConfig( 
$wurflConfigFile );

Added: trunk/extensions/MobileFrontend/images/w.gif
===================================================================
(Binary files differ)


Property changes on: trunk/extensions/MobileFrontend/images/w.gif
___________________________________________________________________
Added: svn:mime-type
   + image/gif

Modified: trunk/extensions/MobileFrontend/views/layout/_search_webkit.html.php
===================================================================
--- trunk/extensions/MobileFrontend/views/layout/_search_webkit.html.php        
2011-06-13 23:43:01 UTC (rev 90021)
+++ trunk/extensions/MobileFrontend/views/layout/_search_webkit.html.php        
2011-06-14 00:06:09 UTC (rev 90022)
@@ -1,10 +1,13 @@
 <?php
 $searchField = (!empty($_GET['search'])) ? $_GET['search'] : '';
 
+$mainPageUrl = self::$mainPageUrl;
+$randomPageUrl = self::$randomPageUrl;
+
 $searchWebkitHtml = <<<EOD
 <div id='header'> 
   <div id='searchbox'> 
-    <img alt='W logo' id='logo' src='http://en.m.wikipedia.org/images/w.gif' 
/> 
+    <img alt='W logo' id='logo' src='/extensions/MobileFrontend/images/w.gif' 
/> 
     <form action='/index.php' class='search_bar' method='get'> 
          <input type="hidden" value="Special:Search" name="title" /> 
          <input type="hidden" value="Search" name="fulltext" /> 
@@ -14,8 +17,8 @@
     </form>
   </div> 
   <div class='nav' id='nav'> 
-    <form method="get" action="/"><button type="submit" 
id="homeButton">{$homeButton}</button></form> 
-    <form method="get" action="/index.php/Special:Random"><button 
type="submit" id="randomButton">{$randomButton}</button></form> 
+    <form method="get" action="{$mainPageUrl}"><button type="submit" 
id="homeButton">{$homeButton}</button></form> 
+    <form method="get" action="{$randomPageUrl}"><button type="submit" 
id="randomButton">{$randomButton}</button></form> 
   </div>
 </div>
 EOD;


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

Reply via email to