aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mod/search/start.php2
-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
4 files changed, 18 insertions, 8 deletions
diff --git a/mod/search/start.php b/mod/search/start.php
index 18a0d59e3..9ab14f42f 100644
--- a/mod/search/start.php
+++ b/mod/search/start.php
@@ -49,7 +49,7 @@ function search_init() {
elgg_extend_view('css/elgg', 'search/css');
// extend view for elgg topbar search box
- elgg_extend_view('page/elements/header', 'search/search_box');
+ elgg_extend_view('page/elements/header', 'search/header');
}
/**
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