https://www.mediawiki.org/wiki/Special:Code/MediaWiki/112286

Revision: 112286
Author:   awjrichards
Date:     2012-02-24 01:22:46 +0000 (Fri, 24 Feb 2012)
Log Message:
-----------
Updating comments to reflect addition of URL path templating support

Modified Paths:
--------------
    trunk/extensions/MobileFrontend/MobileFrontend.body.php
    trunk/extensions/MobileFrontend/MobileFrontend.php

Modified: trunk/extensions/MobileFrontend/MobileFrontend.body.php
===================================================================
--- trunk/extensions/MobileFrontend/MobileFrontend.body.php     2012-02-24 
01:17:26 UTC (rev 112285)
+++ trunk/extensions/MobileFrontend/MobileFrontend.body.php     2012-02-24 
01:22:46 UTC (rev 112286)
@@ -1366,9 +1366,6 @@
 
        /**
         * Update path of given URL to conform to mobile URL template.
-        *
-        * This is just a stub at the moment; does nothing. Once this does
-        * something, be sure to update documentation for $wgMobileUrlTemplate.
         * @param $parsedUrl array
         *              Result of parseUrl() or wfParseUrl()
         */
@@ -1376,6 +1373,8 @@
                global $wgScriptPath;
 
                $mobileUrlPathTemplate = $this->parseMobileUrlTemplate( 'path' 
);
+               
+               // if there's no path template, no reason to continue.
                if ( !strlen( $mobileUrlPathTemplate ) ) {
                        return;
                }

Modified: trunk/extensions/MobileFrontend/MobileFrontend.php
===================================================================
--- trunk/extensions/MobileFrontend/MobileFrontend.php  2012-02-24 01:17:26 UTC 
(rev 112285)
+++ trunk/extensions/MobileFrontend/MobileFrontend.php  2012-02-24 01:22:46 UTC 
(rev 112286)
@@ -83,6 +83,9 @@
  * This will be used to transcode regular URLs into mobile URLs for the 
  * mobile view.
  * 
+ * It's possible to specify the 'mobileness' of the URL either in the 
+ * host portion, or in the path portion.
+ *
  * You can either statically or dynamically create the host-portion of your
  * mobile URL. To statically create it, just set $wgMobileUrlTemplate to 
  * the static hostname. For example:
@@ -96,6 +99,14 @@
  * So, if you wanted a mobile URL scheme that turned "en.wikipedia.org" into
  * "en.m.wikipedia.org", your URL template would look like:
  *             %h0.m.%h1.%h2
+ *
+ * If you prefer to use template the path, be sure to exclude $wgScriptPath.
+ * You can specify where the non-mobile path portion appears with the token %p.
+ * For instance:
+ *             $wgMobileUrlTemplate = "/mobile/%p";
+ *
+ * At the moment, this might behave strangely if you want to template both the
+ * host and path portions of the URL.
  */
 $wgMobileUrlTemplate = '%h0.m.%h1.%h2';
 


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

Reply via email to