From: Brion Vibber Date: Fri, 7 Jan 2005 03:25:49 +0000 (+0000) Subject: * Fix missing search box contents in MonoBook skin X-Git-Tag: 1.5.0alpha1~985 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/membres/fiche.php?a=commitdiff_plain;h=cbf9973aaf8173f381770a004a00cbb198596d84;p=lhc%2Fweb%2Fwiklou.git * Fix missing search box contents in MonoBook skin * Add option to forward search directly to an external URL (eg google) * Add parser test for bug 1219 URL next to image --- diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index 231a875339..1457612e98 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -994,6 +994,19 @@ $wgLivePreview = false; */ $wgDisableInternalSearch = false; +/** + * Set this to a URL to forward search requests to some external location. + * If the URL includes '$1', this will be replaced with the URL-encoded + * search term. + * + * For example, to forward to Google you'd have something like: + * $wgSearchForwardUrl = 'http://www.google.com/search?q=$1' . + * '&domains=http://example.com' . + * '&sitesearch=http://example.com' . + * '&ie=utf-8&oe=utf-8'; + */ +$wgSearchForwardUrl = null; + } else { die(); } diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 6eedc08ca2..0c2f812b56 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -229,6 +229,7 @@ class SkinTemplate extends Skin { $tpl->set( "helppage", wfMsg('helppage')); */ $tpl->set( 'searchaction', $this->escapeSearchLink() ); + $tpl->set( 'search', trim( $wgRequest->getVal( 'search' ) ) ); $tpl->setRef( 'stylepath', $wgStylePath ); $tpl->setRef( 'logopath', $wgLogo ); $tpl->setRef( "lang", $wgContLanguageCode ); diff --git a/includes/SpecialSearch.php b/includes/SpecialSearch.php index bebbfd2b35..948b789bad 100644 --- a/includes/SpecialSearch.php +++ b/includes/SpecialSearch.php @@ -133,6 +133,12 @@ class SpecialSearch { global $wgDisableTextSearch; if ( $wgDisableTextSearch ) { + global $wgForwardSearchUrl; + if( $wgForwardSearchUrl ) { + $url = str_replace( '$1', urlencode( $term ), $wgForwardSearchUrl ); + $wgOut->redirect( $url ); + return; + } global $wgInputEncoding; $wgOut->addHTML( wfMsg( 'searchdisabled' ) ); $wgOut->addHTML( wfMsg( 'googlesearch', diff --git a/maintenance/parserTests.txt b/maintenance/parserTests.txt index 23bf77b44f..47abe9be32 100644 --- a/maintenance/parserTests.txt +++ b/maintenance/parserTests.txt @@ -1767,6 +1767,25 @@ title=[[Parser test script]] !! end + +!! test +Bug 1219 URL next to image (good) +!! input +http://example.com [[Image:foobar.jpg]] +!! result +

http://example.com Image:foobar.jpg +

+!!end + +!! test +Bug 1219 URL next to image (broken) +!! input +http://example.com[[Image:foobar.jpg]] +!! result +

http://example.comImage:foobar.jpg +

+!!end + TODO: more images more tables diff --git a/skins/MonoBook.php b/skins/MonoBook.php index ba1d50f4b6..88c29aa1ec 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -128,7 +128,9 @@ class MonoBookTemplate extends QuickTemplate {
haveMsg('accesskey-search')) { - ?>accesskey="msg('accesskey-search') ?>" /> + ?>accesskey="msg('accesskey-search') ?>"data['search'] ) ) { + ?>value="text('search') ?>" />