summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--inc/template.php19
1 files changed, 17 insertions, 2 deletions
diff --git a/inc/template.php b/inc/template.php
index 985dd946f..e582e67b5 100644
--- a/inc/template.php
+++ b/inc/template.php
@@ -395,8 +395,7 @@ function _tpl_metaheaders_action($data){
* @author Andreas Gohr <andi@splitbrain.org>
*/
function tpl_link($url,$name,$more='',$return=false){
- $out = '';
- $out .= '<a href="'.$url.'" ';
+ $out = '<a href="'.$url.'" ';
if ($more) $out .= ' '.$more;
$out .= ">$name</a>";
if ($return) return $out;
@@ -751,6 +750,22 @@ function tpl_actionlink($type,$pre='',$suf='',$inner='',$return=false){
}
/**
+ * Wrapper around tpl_button() and tpl_actionlink()
+ *
+ * @author Anika Henke <anika@selfthinker.org>
+ */
+function tpl_action($type,$link=0,$wrapper=false,$return=false,$pre='',$suf='',$inner='') {
+ $out = '';
+ if ($link) $out .= tpl_actionlink($type,$pre,$suf,$inner,1);
+ else $out .= tpl_button($type,1);
+ if ($out && $wrapper) $out = "<$wrapper>$out</$wrapper>";
+
+ if ($return) return $out;
+ print $out;
+ return $out ? true : false;
+}
+
+/**
* Print the search form
*
* If the first parameter is given a div with the ID 'qsearch_out' will