aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authormarijus <mario@mariovavti.com>2014-10-08 12:36:26 +0200
committermarijus <mario@mariovavti.com>2014-10-08 12:36:26 +0200
commit289f57f79e27ffabcee404ee82758582d0d13985 (patch)
tree4ce32138cee349105481e53f4f2c6f9e34acba35 /include
parent634c2ef8ce3038bba504040096b3de023077bddc (diff)
downloadvolse-hubzilla-289f57f79e27ffabcee404ee82758582d0d13985.tar.gz
volse-hubzilla-289f57f79e27ffabcee404ee82758582d0d13985.tar.bz2
volse-hubzilla-289f57f79e27ffabcee404ee82758582d0d13985.zip
template for searchbox and some more work on saved searches
Diffstat (limited to 'include')
-rw-r--r--include/text.php36
1 files changed, 17 insertions, 19 deletions
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 = '<div id="' . $id . '">';
- $o .= '<form action="' . $a->get_baseurl((stristr($url,'network')) ? true : false) . $url . '" method="get" >';
- $o .= '<input type="text" class="icon-search" name="search" id="search-text" placeholder="&#xf002;" value="' . $s .'" onclick="this.submit();" />';
- $o .= '<input class="search-submit btn btn-default" type="submit" name="submit" id="search-submit" value="' . t('Search') . '" />';
- if(feature_enabled(local_user(),'savedsearch'))
- $o .= '<input class="search-save btn btn-default" type="submit" name="save" id="search-save" value="' . t('Save') . '" />';
- $o .= '</form></div>';
- 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 = '<div id="' . $id . '">';
- $o .= '<form action="' . z_root() . '/' . $url . '" method="get" >';
- $o .= '<input type="hidden" name="f" value="" />';
- $o .= '<input type="text" class="icon-search" name="search" id="search-text" placeholder="&#xf002;" value="' . $s .'" onclick="this.submit();" />';
- $o .= '<input type="submit" name="submit" class="btn btn-default" id="search-submit" value="' . t('Search') . '" />';
- if(feature_enabled(local_user(),'savedsearch'))
- $o .= '<input type="submit" name="searchsave" class="btn btn-default" id="search-save" value="' . t('Save') . '" />';
- $o .= '</form></div>';
- 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
+}