From 289f57f79e27ffabcee404ee82758582d0d13985 Mon Sep 17 00:00:00 2001 From: marijus Date: Wed, 8 Oct 2014 12:36:26 +0200 Subject: template for searchbox and some more work on saved searches --- include/text.php | 36 +++++++++++++++++------------------- 1 file changed, 17 insertions(+), 19 deletions(-) (limited to 'include') diff --git a/include/text.php b/include/text.php index 22cf17866..0e38de2d2 100644 --- a/include/text.php +++ b/include/text.php @@ -815,28 +815,26 @@ function micropro($contact, $redirect = false, $class = '', $textmode = false) { function search($s,$id='search-box',$url='/search',$save = false) { $a = get_app(); - $o = '
'; - $o .= '
'; - $o .= ''; - $o .= ''; - if(feature_enabled(local_user(),'savedsearch')) - $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') + )); } function searchbox($s,$id='search-box',$url='/search',$save = false) { - $a = get_app(); - $o = '
'; - $o .= '
'; - $o .= ''; - $o .= ''; - $o .= ''; - if(feature_enabled(local_user(),'savedsearch')) - $o .= ''; - $o .= '
'; - return $o; + return replace_macros(get_markup_template('searchbox.tpl'),array( + '$s' => $s, + '$id' => $id, + '$action_url' => z_root() . '/' . $url, + '$search_label' => t('Search'), + '$save_label' => t('Save'), + '$savedsearch' => feature_enabled(local_user(),'savedsearch') + )); } @@ -2061,4 +2059,4 @@ function extra_query_args() { } } return $s; -} \ No newline at end of file +} -- cgit v1.2.3