r99053 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99052‎ | r99053 | r99054 >
Date:21:13, 5 October 2011
Author:preilly
Status:deferred
Tags:
Comment:
fix for bug 31339 - search field missing on new version of wikipedia mobile
Modified paths:
  • /trunk/extensions/MobileFrontend/MobileFrontend.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MobileFrontend/MobileFrontend.php
@@ -164,6 +164,7 @@
165165 'mobile-frontend-leave-feedback',
166166 'mobile-frontend-feedback-page',
167167 'mobile-frontend-leave-feedback-thanks',
 168+ 'mobile-frontend-search-submit',
168169 );
169170
170171 public $itemsToRemove = array(
@@ -907,7 +908,7 @@
908909 }
909910
910911 public function DOMParse( $html ) {
911 - global $wgSitename;
 912+ global $wgSitename, $wgScript;
912913 wfProfileIn( __METHOD__ );
913914 $html = mb_convert_encoding( $html, 'HTML-ENTITIES', "UTF-8" );
914915 libxml_use_internal_errors( true );
@@ -1017,7 +1018,7 @@
10181019 } elseif ( $this->contentFormat == 'WML' ) {
10191020 $homeButton = self::$messages['mobile-frontend-home-button'];
10201021 $randomButton = self::$messages['mobile-frontend-random-button'];
1021 - // header( 'Content-Type: text/vnd.wap.wml' );
 1022+ header( 'Content-Type: text/vnd.wap.wml' );
10221023
10231024 // TODO: Content transformations required
10241025 // WML Validator:
@@ -1036,7 +1037,12 @@
10371038 foreach ( $elements as $element ) {
10381039 $contentHtml = preg_replace( '#</?' . $element . '[^>]*>#is', '', $contentHtml );
10391040 }
1040 -
 1041+
 1042+ //Wml for searching
 1043+ $searchWml = '<p><input emptyok="true" format="*M" type="text" name="search" value="" size="16" />' .
 1044+ '<do type="accept" label="' . self::$messages['mobile-frontend-search-submit'] . '">' .
 1045+ '<go href="' . $wgScript . '?title=Special%3ASearch&amp;search=$(search)"></go></do></p>';
 1046+ $contentHtml = $searchWml . $contentHtml;
10411047 // Content wrapping
10421048 $contentHtml = $this->createWMLCard( $contentHtml );
10431049 require( 'views/layout/application.wml.php' );

Follow-up revisions

RevisionCommit summaryAuthorDate
r99140mft r99053preilly20:53, 6 October 2011
r99141mft r99053preilly20:53, 6 October 2011

Status & tagging log