Skip to content
This repository has been archived by the owner on Jan 20, 2024. It is now read-only.

Commit

Permalink
Enable global search input field
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelchisari authored and The Appleseed Project committed Dec 28, 2010
1 parent f11b3cd commit 0b32b9a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
8 changes: 8 additions & 0 deletions components/search/controllers/search.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ public function Ask ( $pView = null, $pData = null ) {

$this->Ask = $this->GetView ( $pView );

$this->_Current = $this->Talk ( 'User', 'Current' );

if ( !$this->_Current->Domain ) {
$this->Ask->Find ( '[name=search]', 0 )->disabled = true;
} else {
$this->Ask->Find ( '#search-global', 0 )->action = 'http://' . $this->_Current->Domain . '/search/';
}

$this->Ask->Display();

return ( true );
Expand Down
4 changes: 3 additions & 1 deletion components/search/views/global.php
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
<input type="text" disabled="disabled" name="search" placeholder="Search Placeholder Text" class="search"><input type="submit" name="search" value="" class="search-submit">
<form id="search-global">
<input type="text" name="keywords" placeholder="Search Placeholder Text" class="keywords"><input type="submit" value="" class="search-submit">
</form>
6 changes: 3 additions & 3 deletions themes/default/style/theme.css
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@
tr:hover { background-color:#fafafa; }

/* Search */
input.search { width:232px; height:18px; margin:0; float:none; padding:2px 4px; border:none; background-color:#fafafa; }
input.keywords { width:232px; height:18px; margin:0; float:none; padding:2px 4px; border:none; background-color:#fafafa; }
input.search-submit { padding:0; margin:0; width:22px; float:none; height:22px; border:none; color:#fafafa; background-color:#fafafa; background-image:url('/themes/default/images/appleseed-icons.png'); background-position:2px -46px; }

input.search.local { font-size:80%; width:129px; height:16px; padding:2px 4px; border:1px solid #80af1f; border-right:none; background-color:#fafafa; }
input.keywords.local { font-size:80%; width:129px; height:16px; padding:2px 4px; border:1px solid #80af1f; border-right:none; background-color:#fafafa; }
input.search-submit.local { width:22px; height:22px; border:1px solid #80af1f; border-left:none; color:#fafafa; background-color:#fafafa; background-image:url('/themes/default/images/appleseed-icons.png'); background-position:2px -46px; }

input.search { -webkit-border-bottom-left-radius:4px; -webkit-border-top-left-radius:4px; -moz-border-radius-bottomleft:4px; -moz-border-radius-topleft:4px; -border-bottom-left-radius:4px; -border-top-left-radius:4px; }
input.keywords { -webkit-border-bottom-left-radius:4px; -webkit-border-top-left-radius:4px; -moz-border-radius-bottomleft:4px; -moz-border-radius-topleft:4px; -border-bottom-left-radius:4px; -border-top-left-radius:4px; }
input.search-submit { -webkit-border-bottom-right-radius:4px; -webkit-border-top-right-radius:4px; -moz-border-radius-bottomright:4px; -moz-border-radius-topright:4px; -border-bottom-right-radius:4px; -border-top-right-radius:4px; }

/* Comments */
Expand Down

0 comments on commit 0b32b9a

Please sign in to comment.