Permalink
Browse files

Fix {link} rendering to allow passing a target.

  • Loading branch information...
1 parent 93ff71e commit 73bfae47d5f51f9e5f78ef44ae7db67b5d64c20a @kaecyra kaecyra committed Oct 4, 2012
Showing with 3 additions and 0 deletions.
  1. +2 −0 library/core/class.theme.php
  2. +1 −0 library/vendors/SmartyPlugins/function.link.php
@@ -95,6 +95,8 @@ public static function Link($Path, $Text = FALSE, $Format = NULL, $Options = arr
$Class = GetValue('class', $Options, '');
$WithDomain = GetValue('WithDomain', $Options);
$Target = GetValue('Target', $Options, '');
+ if ($Target == 'current')
+ $Target = trim(Url('', TRUE), '/ ');
if (is_null($Format))
$Format = '<a href="%url" class="%class">%text</a>';
@@ -42,6 +42,7 @@ function smarty_function_link($Params, &$Smarty) {
if (isset($Params['withdomain'])) $Options['WithDomain'] = $Params['withdomain'];
if (isset($Params['class'])) $Options['class'] = $Params['class'];
if (isset($Params['tk'])) $Options['TK'] = $Params['tk'];
+ if (isset($Params['target'])) $Options['Target'] = $Params['target'];
$Result = Gdn_Theme::Link($Path, $Text, $Format, $Options);

0 comments on commit 73bfae4

Please sign in to comment.