Added optional simplified search in header configured using$wgVectorUseSimpleSearch.
authorTrevor Parscal <tparscal@users.mediawiki.org>
Tue, 14 Jul 2009 21:53:57 +0000 (21:53 +0000)
committerTrevor Parscal <tparscal@users.mediawiki.org>
Tue, 14 Jul 2009 21:53:57 +0000 (21:53 +0000)
skins/Vector.php
skins/vector/images/search.png [new file with mode: 0644]
skins/vector/main-ltr.css
skins/vector/main-rtl.css

index 6bd2cbf..f9f1c09 100644 (file)
@@ -682,7 +682,7 @@ class VectorTemplate extends QuickTemplate {
         * when UI is in RTL mode
         */
        private function renderNavigation( $elements ) {
-               global $wgContLang, $wgUseTwoButtonsSearchForm;
+               global $wgContLang, $wgVectorUseSimpleSearch, $wgStylePath;
                
                // If only one element was given, wrap it in an array, allowing more
                // flexible arguments
@@ -776,12 +776,15 @@ class VectorTemplate extends QuickTemplate {
        <h5 <?php $this->html('userlangattributes') ?>><label for="searchInput"><?php $this->msg( 'search' ) ?></label></h5>
        <form action="<?php $this->text( 'wgScript' ) ?>" id="searchform">
                <input type='hidden' name="title" value="<?php $this->text( 'searchtitle' ) ?>"/>
+               <?php if ( $wgVectorUseSimpleSearch ): ?>
+               <div id="simpleSearch">
+                       <input id="searchInput" name="search" type="text" <?php echo $this->skin->tooltipAndAccesskey( 'search' ); ?> <?php if( isset( $this->data['search'] ) ): ?> value="<?php $this->text( 'search' ) ?>"<?php endif; ?> />
+                       <input  id="searchButton" type='image' name='fulltext' src="<?php echo $wgStylePath ?>/vector/images/search.png" <?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> align="top" />
+               </div>
+               <?php else: ?>
                <input id="searchInput" name="search" type="text" <?php echo $this->skin->tooltipAndAccesskey( 'search' ); ?> <?php if( isset( $this->data['search'] ) ): ?> value="<?php $this->text( 'search' ) ?>"<?php endif; ?> />
                <input type='submit' name="go" class="searchButton" id="searchGoButton" value="<?php $this->msg( 'searcharticle' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-go' ); ?> />
-               <?php if ( $wgUseTwoButtonsSearchForm ): ?>
                <input type="submit" name="fulltext" class="searchButton" id="mw-searchButton" value="<?php $this->msg( 'searchbutton' ) ?>"<?php echo $this->skin->tooltipAndAccesskey( 'search-fulltext' ); ?> />
-               <?php else: ?>
-               <div><a href="<?php $this->text( 'searchaction' ) ?>" rel="search"><?php $this->msg( 'powersearch-legend' ) ?></a></div>
                <?php endif; ?>
        </form>
 </div>
diff --git a/skins/vector/images/search.png b/skins/vector/images/search.png
new file mode 100644 (file)
index 0000000..bb1a13f
Binary files /dev/null and b/skins/vector/images/search.png differ
index 3c2e37c..7af633a 100644 (file)
@@ -292,6 +292,17 @@ div#head h5 {
                margin: 0;
                margin-top: 0.4em;
        }
+       div#p-search div#simpleSearch input#searchInput {
+               margin-top: 0.125em;
+               border: solid 1px #AAAAAA;
+               height: 1.25em;
+               width: 10em;
+               padding: 0.5em;
+       }
+       div#p-search div#simpleSearch input#searchButton {
+               border: none;
+               margin-left: 0.25em;
+       }
 /* Panel */
 div#panel {
        position: absolute;
index 504a264..6c1e4b9 100644 (file)
@@ -292,6 +292,10 @@ div#head h5 {
                margin: 0;
                margin-top: 0.4em;
        }
+       div#p-search input#searchButton {
+               border: none;
+               margin-right: 0.25em;
+       }
 /* Panel */
 div#panel {
        position: absolute;