Fix comp_in_new getting tagged onto ALL the menu links
[squirrelmail.git] / functions / page_header.php
index b00acdca8cbe2b5ac72ab62783b85002f9582766..f2a954323116040c0c33380643a0c701aba4f29a 100644 (file)
@@ -147,11 +147,8 @@ EOS;
  * @param string target the target frame for this link
  */
 function makeInternalLink($path, $text, $target='') {
-    global $base_uri;
+    global $base_uri, $oTemplate;
 //    sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION);
-    if ($target != '') {
-        $target = " target=\"$target\"";
-    }
 
     // This is an inefficient hook and is only used by
     // one plugin that still needs to patch this code,
@@ -162,7 +159,17 @@ function makeInternalLink($path, $text, $target='') {
     //
     //do_hook('internal_link', $text);
 
-    return '<a href="'.$base_uri.$path.'"'.$target.'>'.$text.'</a>';
+    $oTemplate->assign('uri', $base_uri . $path);
+    $oTemplate->assign('text', $text);
+    $oTemplate->assign('target', $target);
+
+    // blank the onclick because the template object might
+    // already contain an onclick value due to having been
+    // used to show a compose link (when comp_in_new is turned on)
+    //
+    $oTemplate->assign('onclick', '');
+
+    return $oTemplate->fetch('hyperlink.tpl');
 }
 
 /**