aboutsummaryrefslogtreecommitdiff
path: root/mod/search/views
diff options
context:
space:
mode:
authorcash <cash.costello@gmail.com>2011-10-27 18:41:37 -0400
committercash <cash.costello@gmail.com>2011-10-27 18:41:37 -0400
commit30711508fd139e737df0fffb645e071219b2bde7 (patch)
tree5ad76b5be40302d9b49a8a6f55937e8a221846ee /mod/search/views
parent1bd24e93d69fb940f7491d1d7a12b1b13bebcfd5 (diff)
downloadelgg-30711508fd139e737df0fffb645e071219b2bde7.tar.gz
elgg-30711508fd139e737df0fffb645e071219b2bde7.tar.bz2
Fixes #3687 added .elgg-search-header for css specific to header search box
Diffstat (limited to 'mod/search/views')
-rw-r--r--mod/search/views/default/search/css.php6
-rw-r--r--mod/search/views/default/search/header.php6
-rw-r--r--mod/search/views/default/search/search_box.php12
3 files changed, 17 insertions, 7 deletions
diff --git a/mod/search/views/default/search/css.php b/mod/search/views/default/search/css.php
index 0b8f34b60..30ff45172 100644
--- a/mod/search/views/default/search/css.php
+++ b/mod/search/views/default/search/css.php
@@ -8,16 +8,16 @@
/**********************************
Search plugin
***********************************/
-.elgg-page-header .elgg-search {
+.elgg-search-header {
bottom: 5px;
height: 23px;
position: absolute;
right: 0;
}
-.elgg-page-header .elgg-search input[type=text] {
+.elgg-search input[type=text] {
width: 230px;
}
-.elgg-page-header .elgg-search input[type=submit] {
+.elgg-search input[type=submit] {
display: none;
}
.elgg-search input[type=text] {
diff --git a/mod/search/views/default/search/header.php b/mod/search/views/default/search/header.php
new file mode 100644
index 000000000..6f8654c13
--- /dev/null
+++ b/mod/search/views/default/search/header.php
@@ -0,0 +1,6 @@
+<?php
+/**
+ * Search box in page header
+ */
+
+echo elgg_view('search/search_box', array('class' => 'elgg-search-header')); \ No newline at end of file
diff --git a/mod/search/views/default/search/search_box.php b/mod/search/views/default/search/search_box.php
index ff5910937..9440dd1de 100644
--- a/mod/search/views/default/search/search_box.php
+++ b/mod/search/views/default/search/search_box.php
@@ -3,8 +3,7 @@
* Search box
*
* @uses $vars['value'] Current search query
- *
- * @todo Move javascript into something that extends elgg.js
+ * @uses $vars['class'] Additional class
*/
if (array_key_exists('value', $vars)) {
@@ -15,6 +14,11 @@ if (array_key_exists('value', $vars)) {
$value = elgg_echo('search');
}
+$class = "elgg-search";
+if (isset($vars['class'])) {
+ $class = "$class {$vars['class']}";
+}
+
// @todo - why the strip slashes?
$value = stripslashes($value);
@@ -26,9 +30,9 @@ $display_query = htmlspecialchars($display_query, ENT_QUOTES, 'UTF-8', false);
?>
-<form class="elgg-search" action="<?php echo elgg_get_site_url(); ?>search" method="get">
+<form class="<?php echo $class; ?>" action="<?php echo elgg_get_site_url(); ?>search" method="get">
<fieldset>
- <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="text" class="search-input" 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='' };" />
<input type="submit" value="<?php echo elgg_echo('search:go'); ?>" class="search-submit-button" />
</fieldset>
</form> \ No newline at end of file