Index: trunk/extensions/MobileFrontend/DeviceDetection.php |
— | — | @@ -364,6 +364,7 @@ |
365 | 365 | |
366 | 366 | if ( $formatName === '' ) { |
367 | 367 | if ( strpos( $acceptHeader, 'application/vnd.wap.xhtml+xml' ) !== false ) { |
| 368 | + // Should be wap2 or in WURFL xhtmlmp |
368 | 369 | $formatName = 'html'; |
369 | 370 | } elseif ( strpos( $acceptHeader, 'vnd.wap.wml' ) !== false ) { |
370 | 371 | $formatName = 'wml'; |
— | — | @@ -373,4 +374,4 @@ |
374 | 375 | } |
375 | 376 | return $formatName; |
376 | 377 | } |
377 | | -} |
\ No newline at end of file |
| 378 | +} |
Index: trunk/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -218,6 +218,29 @@ |
219 | 219 | // ob_start( array( $this, 'DOMParse' ) ); |
220 | 220 | // } |
221 | 221 | |
| 222 | + // WURFL documentation: http://wurfl.sourceforge.net/help_doc.php |
| 223 | + // Determine the kind of markup |
| 224 | + if( is_array($props) && $props['preferred_markup'] ) { |
| 225 | + wfDebug( __METHOD__ . ": preferred markup for this device: " . $props['preferred_markup'] ); |
| 226 | + // xhtml/html: html_web_3_2, html_web_4_0 |
| 227 | + // xthml basic/xhtmlmp (wap 2.0): html_wi_w3_xhtmlbasic html_wi_oma_xhtmlmp_1_0 |
| 228 | + // chtml (imode): html_wi_imode_* |
| 229 | + // wml (wap 1): wml_1_1, wml_1_2, wml_1_3 |
| 230 | + } |
| 231 | + // WML options that might influence our 'style' of output |
| 232 | + // $props['access_key_support'] (for creating easy keypad navigation) |
| 233 | + // $props['softkey_support'] ( for creating your own menu) |
| 234 | + |
| 235 | + // WAP2/XHTML MP |
| 236 | + // xhtmlmp_preferred_mime_type ( the mime type with which you should serve your xhtml to this device |
| 237 | + |
| 238 | + // HTML |
| 239 | + // $props['pointing_method'] == touchscreen |
| 240 | + // ajax_support_javascript |
| 241 | + // html_preferred_dtd |
| 242 | + |
| 243 | + // Determine |
| 244 | + |
222 | 245 | if (self::$useFormat === 'mobile' || |
223 | 246 | self::$useFormat === 'mobile-wap' ) { |
224 | 247 | $this->disableCaching(); |
— | — | @@ -340,7 +363,7 @@ |
341 | 364 | $card .= "<card id='{$idx}' title='{$title}'><p>{$segments[$requestedSegment]}</p>"; |
342 | 365 | $idx = $requestedSegment + 1; |
343 | 366 | $segmentsCount = count($segments); |
344 | | - $card .= $idx . "/" . $segmentsCount; |
| 367 | + $card .= "<p>" . $idx . "/" . $segmentsCount . "</p>"; |
345 | 368 | |
346 | 369 | $useFormatParam = ( isset( self::$useFormat ) ) ? '&' . 'useFormat=' . self::$useFormat : ''; |
347 | 370 | |
— | — | @@ -489,7 +512,18 @@ |
490 | 513 | && empty( self::$search ) ) { |
491 | 514 | $contentHtml = $this->javascriptize( $contentHtml ); |
492 | 515 | } elseif ( $this->contentFormat == 'WML' ) { |
493 | | - $contentHtml = $this->javascriptize( $contentHtml ); |
| 516 | + header( 'Content-Type: text/vnd.wap.wml' ); |
| 517 | + |
| 518 | + // TODO: Content transformations required |
| 519 | + // WML Validator: |
| 520 | + // http://validator.w3.org |
| 521 | + // |
| 522 | + // div -> p |
| 523 | + // no style, no class, no h1-h6, sup, sub, ol, ul, li etc. |
| 524 | + // table requires "columns" property |
| 525 | + // lang and dir officially unsupported (but often work on rtl phones) |
| 526 | + |
| 527 | + // Content wrapping |
494 | 528 | $contentHtml = $this->createWMLCard( $contentHtml, $title ); |
495 | 529 | require( 'views/layout/application.wml.php' ); |
496 | 530 | } |
Index: trunk/extensions/MobileFrontend/views/layout/application.wml.php |
— | — | @@ -7,7 +7,6 @@ |
8 | 8 | <title>{$title}</title> |
9 | 9 | <meta name="ROBOTS" content="NOINDEX, NOFOLLOW" /> |
10 | 10 | <meta name="character-set=utf-8" content="charset"/> |
11 | | - <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
12 | 11 | <meta forua="true" http-equiv="Cache-Control" content="max-age=0"/> |
13 | 12 | </head> |
14 | 13 | {$contentHtml} |