Moving template util file
[squirrelmail.git] / functions / strings.php
index 757ebdb2ff67d2285e27d7abfd975465488cb389..68c607819bd9d230c41590d0e189109b252c9b49 100644 (file)
@@ -792,7 +792,7 @@ function quoteimap($str) {
  * @since 1.4.2
  */
 function makeComposeLink($url, $text = null, $target='') {
-    global $compose_new_win, $javascript_on, $compose_width, 
+    global $compose_new_win, $compose_width, 
            $compose_height, $oTemplate;
 
     if(!$text) {
@@ -809,15 +809,11 @@ function makeComposeLink($url, $text = null, $target='') {
 
 
     // if javascript is on, use onclick event to handle it
-    if($javascript_on) {
+    if(checkForJavascript()) {
         sqgetGlobalVar('base_uri', $base_uri, SQ_SESSION);
         $compuri = SM_BASE_URI.$url;
-        $oTemplate->assign('uri', 'javascript:void(0)');
-        $oTemplate->assign('text', $text);
-        $oTemplate->assign('onclick', "comp_in_new('$compuri','$compose_width','$compose_height')");
-        $oTemplate->assign('class', '');
-        $oTemplate->assign('id', '');
-        return $oTemplate->fetch('hyperlink.tpl');
+
+        return create_hyperlink('javascript:void(0)', $text, '', "comp_in_new('$compuri','$compose_width','$compose_height')");
     }
 
     // otherwise, just open new window using regular HTML