diff options
author | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-08 20:17:41 +0000 |
---|---|---|
committer | brettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544> | 2010-03-08 20:17:41 +0000 |
commit | 617ebb97d840cf77f3b483273f029732e8dc0db7 (patch) | |
tree | 813abbbe3845d737f5e41766d677b9dcac134fa5 /mod/search | |
parent | f2b5b81e01444f90f00baef738d02422cbaf6e20 (diff) | |
download | elgg-617ebb97d840cf77f3b483273f029732e8dc0db7.tar.gz elgg-617ebb97d840cf77f3b483273f029732e8dc0db7.tar.bz2 |
Removed hard-coded search box and replaced with extended header/extend view from search page.
git-svn-id: http://code.elgg.org/elgg/trunk@5309 36083f99-b078-4883-b0ff-0f9b5a30f544
Diffstat (limited to 'mod/search')
-rw-r--r-- | mod/search/start.php | 17 | ||||
-rw-r--r-- | mod/search/views/default/page_elements/searchbox.php | 18 | ||||
-rw-r--r-- | mod/search/views/default/search/search_box.php | 20 |
3 files changed, 30 insertions, 25 deletions
diff --git a/mod/search/start.php b/mod/search/start.php index a6a0bead2..3467420b7 100644 --- a/mod/search/start.php +++ b/mod/search/start.php @@ -1,12 +1,12 @@ <?php /** - * Elgg core search. - * - * @package Elgg - * @subpackage Core - * @author Curverider Ltd <info@elgg.com>, The MITRE Corporation <http://www.mitre.org> - * @link http://elgg.org/ - */ + * Elgg core search. + * + * @package Elgg + * @subpackage Core + * @author Curverider Ltd <info@elgg.com>, The MITRE Corporation <http://www.mitre.org> + * @link http://elgg.org/ + */ /** * Initialise search helper functions. @@ -51,6 +51,9 @@ function search_init() { // add in CSS for search elements elgg_extend_view('css', 'search/css'); + + // extend view for elgg topbar search box + elgg_extend_view('header/extend', 'search/search_box'); } /** diff --git a/mod/search/views/default/page_elements/searchbox.php b/mod/search/views/default/page_elements/searchbox.php deleted file mode 100644 index f70a6ad97..000000000 --- a/mod/search/views/default/page_elements/searchbox.php +++ /dev/null @@ -1,18 +0,0 @@ -<?php - -if (array_key_exists('value', $vars)) { - $value = $vars['value']; -} elseif ($value = get_input('q', get_input('tag', NULL))) { - $value = $value; -} else { - $value = elgg_echo('search'); -} - -$value = stripslashes($value); - -?> - -<form id="searchform" action="<?php echo $vars['url']; ?>pg/search/" method="get"> - <input type="text" size="21" name="q" value="<?php echo $value; ?>" onclick="if (this.value=='<?php echo elgg_echo('search'); ?>') { this.value='' }" class="search_input" /> - <input type="submit" value="<?php echo elgg_echo('search:go'); ?>" class="search_submit_button" /> -</form> diff --git a/mod/search/views/default/search/search_box.php b/mod/search/views/default/search/search_box.php new file mode 100644 index 000000000..d53efca21 --- /dev/null +++ b/mod/search/views/default/search/search_box.php @@ -0,0 +1,20 @@ +<?php + +if (array_key_exists('value', $vars)) { + $value = $vars['value']; +} elseif ($value = get_input('q', get_input('tag', NULL))) { + $value = $value; +} else { + $value = elgg_echo('search'); +} + +$value = stripslashes($value); + +?> + +<div id="elgg_search"> + <form id="searchform" action="<?php echo $vars['url']; ?>pg/search/" method="get"> + <input type="text" size="21" name="q" value="<?php echo elgg_echo('search'); ?>" onblur="if (this.value=='') { this.value='<?php echo elgg_echo('search'); ?>' }" onfocus="if (this.value=='<?php echo elgg_echo('search'); ?>') { this.value='' };" class="search_input" /> + <input type="submit" value="<?php echo elgg_echo('search:go'); ?>" class="search_submit_button" /> + </form> +</div>
\ No newline at end of file |