Index: trunk/extensions/MobileFrontend/MobileFrontend.php |
— | — | @@ -164,6 +164,7 @@ |
165 | 165 | 'mobile-frontend-leave-feedback', |
166 | 166 | 'mobile-frontend-feedback-page', |
167 | 167 | 'mobile-frontend-leave-feedback-thanks', |
| 168 | + 'mobile-frontend-search-submit', |
168 | 169 | ); |
169 | 170 | |
170 | 171 | public $itemsToRemove = array( |
— | — | @@ -907,7 +908,7 @@ |
908 | 909 | } |
909 | 910 | |
910 | 911 | public function DOMParse( $html ) { |
911 | | - global $wgSitename; |
| 912 | + global $wgSitename, $wgScript; |
912 | 913 | wfProfileIn( __METHOD__ ); |
913 | 914 | $html = mb_convert_encoding( $html, 'HTML-ENTITIES', "UTF-8" ); |
914 | 915 | libxml_use_internal_errors( true ); |
— | — | @@ -1017,7 +1018,7 @@ |
1018 | 1019 | } elseif ( $this->contentFormat == 'WML' ) { |
1019 | 1020 | $homeButton = self::$messages['mobile-frontend-home-button']; |
1020 | 1021 | $randomButton = self::$messages['mobile-frontend-random-button']; |
1021 | | - // header( 'Content-Type: text/vnd.wap.wml' ); |
| 1022 | + header( 'Content-Type: text/vnd.wap.wml' ); |
1022 | 1023 | |
1023 | 1024 | // TODO: Content transformations required |
1024 | 1025 | // WML Validator: |
— | — | @@ -1036,7 +1037,12 @@ |
1037 | 1038 | foreach ( $elements as $element ) { |
1038 | 1039 | $contentHtml = preg_replace( '#</?' . $element . '[^>]*>#is', '', $contentHtml ); |
1039 | 1040 | } |
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&search=$(search)"></go></do></p>'; |
| 1046 | + $contentHtml = $searchWml . $contentHtml; |
1041 | 1047 | // Content wrapping |
1042 | 1048 | $contentHtml = $this->createWMLCard( $contentHtml ); |
1043 | 1049 | require( 'views/layout/application.wml.php' ); |