r88476 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r88475‎ | r88476 | r88477 >
Date:18:28, 20 May 2011
Author:preilly
Status:deferred
Tags:
Comment:
add view_format support
Modified paths:
  • /trunk/extensions/PatchOutputMobile/PatchOutputMobile.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PatchOutputMobile/PatchOutputMobile.php
@@ -27,13 +27,13 @@
2828 'onOutputPageBeforeHTML' );
2929
3030 class ExtPatchOutputMobile {
31 - const VERSION = '0.2.8';
 31+ const VERSION = '0.2.9';
3232
3333 private $doc;
3434
3535 public static $messages = array();
3636
37 - public $contentFormat = 'XHTML'; //'WML'
 37+ public $contentFormat = '';
3838 public $WMLSectionSeperator = '***************************************************************************';
3939 public static $dir;
4040 public static $code;
@@ -86,6 +86,12 @@
8787 $formatName = $device->formatName( $userAgent, $acceptHeader );
8888 ExtPatchOutputMobile::$device = $device->format( $formatName );
8989
 90+ if ( ExtPatchOutputMobile::$device['view_format'] === 'wml' ) {
 91+ $this->contentFormat = 'WML';
 92+ } elseif ( ExtPatchOutputMobile::$device['view_format'] === 'html' ) {
 93+ $this->contentFormat = 'XHTML';
 94+ }
 95+
9096 ob_start( array( $this, 'parse' ) );
9197 return true;
9298 }
@@ -716,4 +722,4 @@
717723 }
718724 return $formatName;
719725 }
720 -}
\ No newline at end of file
 726+}

Status & tagging log