diff options
author | Anika Henke <anika@selfthinker.org> | 2009-05-16 19:38:58 +0200 |
---|---|---|
committer | Anika Henke <anika@selfthinker.org> | 2009-05-16 19:38:58 +0200 |
commit | 01f178253668e9c67267cf9eee2e2811f398624f (patch) | |
tree | c20b7bb22dcc8c021eeb4b3874daea259d43383c | |
parent | 1af98a771b7b7c4fffb91956e37fb05e77f2a3bc (diff) | |
download | rpg-01f178253668e9c67267cf9eee2e2811f398624f.tar.gz rpg-01f178253668e9c67267cf9eee2e2811f398624f.tar.bz2 |
added tpl_action() (wrapper around tpl_button and tpl_actionlink)
darcs-hash:20090516173858-f7d6d-60a553963e6d0428acfeed693797b9abcea87b91.gz
-rw-r--r-- | inc/template.php | 19 |
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 |