From: MatmaRex Date: Wed, 26 Sep 2012 13:47:16 +0000 (+0200) Subject: CologneBlue rewrite: fix search form(s) generation X-Git-Tag: 1.31.0-rc.0~22165^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/operations/?a=commitdiff_plain;h=a62e41b92f8bd9aa26ab15e4e7413f968153e72d;p=lhc%2Fweb%2Fwiklou.git CologneBlue rewrite: fix search form(s) generation Change-Id: Ia1c088f9aef5ea5411e8759a8071ed1c47f79533 --- diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 8cec484804..45674f173d 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -689,7 +689,7 @@ class CologneBlueTemplate extends BaseTemplate { Title::newMainPage() ), $this->getSkin()->aboutLink(), - $this->searchForm( wfMessage( 'qbfind' )->text() ) + $this->searchForm( 'afterContent' ) ) ); $s .= "\n
" . $this->pageStats(); @@ -758,6 +758,9 @@ class CologneBlueTemplate extends BaseTemplate { return $this->getSkin()->getLanguage()->pipeList( $s ); } + + + /** * Compute the sidebar * @access private @@ -769,12 +772,12 @@ class CologneBlueTemplate extends BaseTemplate { $sep = '
'; $s .= $this->menuHead( 'qbfind' ); - $s .= $this->searchForm(); + $s .= $this->searchForm( 'sidebar' ); $s .= $this->menuHead( 'qbbrowse' ); # Use the first heading from the Monobook sidebar as the "browse" section - $bar = $this->getSkin()->buildSidebar(); + $bar = $this->data['sidebar']; unset( $bar['SEARCH'] ); unset( $bar['LANGUAGES'] ); unset( $bar['TOOLBOX'] ); @@ -905,7 +908,7 @@ class CologneBlueTemplate extends BaseTemplate { $s .= $sep . "\n\n"; return $s; } - + /** * @param $key string * @return string @@ -918,32 +921,32 @@ class CologneBlueTemplate extends BaseTemplate { /** * @param $label string * @return string + * + * @fixed */ - function searchForm( $label = '' ) { + function searchForm( $which ) { global $wgUseTwoButtonsSearchForm; $search = $this->getSkin()->getRequest()->getText( 'search' ); $action = $this->data['searchaction']; - $s = "
searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">"; - if( $label != '' ) { - $s .= "{$label}: "; + $s = ""; + if( $which == 'afterContent' ) { + $s .= wfMessage( 'qbfind' )->text() . ": "; } - $s .= "searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\"" - . htmlspecialchars( substr( $search, 0, 256 ) ) . "\" />
" - . "searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . wfMessage( 'searcharticle' )->escaped() . "\" />"; + $s .= "" + . ($which == 'afterContent' ? " " : "
") + . "escaped() . "\" />"; if( $wgUseTwoButtonsSearchForm ) { - $s .= "searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . wfMessage( 'search' )->escaped() . "\" />\n"; + $s .= " escaped() . "\" />\n"; } else { $s .= '
\n"; } $s .= '
'; - // Ensure unique id's for search boxes made after the first - $this->searchboxes = $this->searchboxes == '' ? 2 : $this->searchboxes + 1; - return $s; } }