aboutsummaryrefslogtreecommitdiff
path: root/views/default/search/search_box.php
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2014-03-15 14:46:48 -0300
committerSilvio Rhatto <rhatto@riseup.net>2014-03-15 14:46:48 -0300
commit5041c6c48153453ed597206d08eeff37cf20e676 (patch)
treeb25f495baf01202485f05b5245625f28558c6135 /views/default/search/search_box.php
downloadelgg-5041c6c48153453ed597206d08eeff37cf20e676.tar.gz
elgg-5041c6c48153453ed597206d08eeff37cf20e676.tar.bz2
Squashed 'mod/cool_theme/' content from commit a26f7df
git-subtree-dir: mod/cool_theme git-subtree-split: a26f7df43a266f7d1ff04847da330d15f6041e9b
Diffstat (limited to 'views/default/search/search_box.php')
-rw-r--r--views/default/search/search_box.php27
1 files changed, 27 insertions, 0 deletions
diff --git a/views/default/search/search_box.php b/views/default/search/search_box.php
new file mode 100644
index 000000000..36cceef4a
--- /dev/null
+++ b/views/default/search/search_box.php
@@ -0,0 +1,27 @@
+<?php
+/**
+ * Search box
+ *
+ * @uses $vars['value'] Current search query
+ *
+ * @todo Move javascript into something that extends elgg.js
+ */
+
+$value = '';
+if (array_key_exists('value', $vars)) {
+ $value = $vars['value'];
+} elseif ($value = get_input('q', get_input('tag', NULL))) {
+ $value = $value;
+}
+
+// @todo - why the strip slashes?
+$value = stripslashes($value);
+
+// @todo - create function for sanitization of strings for display in 1.8
+// encode <,>,&, quotes and characters above 127
+$display_query = mb_convert_encoding($value, 'HTML-ENTITIES', 'UTF-8');
+$display_query = htmlspecialchars($display_query, ENT_QUOTES, 'UTF-8', false);
+
+
+?>
+<form class="elgg-search" action="<?php echo elgg_get_site_url(); ?>search" method="get"><fieldset><input type="text" size="21" name="q" placeholder="<?php echo elgg_echo('search'); ?>" class="search-input" value="<?php echo $value; ?>"/><input type="submit" value="<?php echo elgg_echo('search:go'); ?>" class="search-submit-button" /></fieldset></form> \ No newline at end of file