From b3054ee9d05c37a7801f3ea1f82dd54d6ce0361e Mon Sep 17 00:00:00 2001 From: rabuzarus <> Date: Sun, 24 May 2015 20:01:08 +0200 Subject: [PATCH] template for searchbox --- include/text.php | 19 +++++++++---------- view/templates/searchbox.tpl | 11 +++++++++++ 2 files changed, 20 insertions(+), 10 deletions(-) create mode 100644 view/templates/searchbox.tpl diff --git a/include/text.php b/include/text.php index dcc7308723..0f6c83234b 100644 --- a/include/text.php +++ b/include/text.php @@ -960,19 +960,18 @@ if(! function_exists('search')) { * @param string $s search query * @param string $id html id * @param string $url search url - * @param boolean $save show save search button - * @return string html for search box #FIXME: remove html + * @param boolean $savedsearch show save search button */ function search($s,$id='search-box',$url='/search',$save = false) { $a = get_app(); - $o = '
'; - $o .= '
'; - $o .= ''; - $o .= ''; - if($save) - $o .= ''; - $o .= '
'; - return $o; + return replace_macros(get_markup_template('searchbox.tpl'), array( + '$s' => $s, + '$id' => $id, + '$action_url' => $a->get_baseurl((stristr($url,'network')) ? true : false) . $url, + '$search_label' => t('Search'), + '$save_label' => t('Save'), + '$savedsearch' => feature_enabled(local_user(),'savedsearch'), + )); }} if(! function_exists('valid_email')) { diff --git a/view/templates/searchbox.tpl b/view/templates/searchbox.tpl new file mode 100644 index 0000000000..ce656433bf --- /dev/null +++ b/view/templates/searchbox.tpl @@ -0,0 +1,11 @@ +
+
+ {{strip}} + + + {{if $savedsearch}} + + {{/if}} + {{/strip}} +
+
-- 2.39.5