diff --git a/include/text.php b/include/text.php index dcc730872..0f6c83234 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 000000000..ce656433b --- /dev/null +++ b/view/templates/searchbox.tpl @@ -0,0 +1,11 @@ +
+
+ {{strip}} + + + {{if $savedsearch}} + + {{/if}} + {{/strip}} +
+