Generate links using templates
authorpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 6 Feb 2007 08:32:24 +0000 (08:32 +0000)
committerpdontthink <pdontthink@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Tue, 6 Feb 2007 08:32:24 +0000 (08:32 +0000)
git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@12229 7612ce4b-ef26-0410-bec9-ea0150e637f0

functions/mime.php

index 48dccdaee2649e5260232c1d49e1fba95575d7a7..5ff5e79bcb1f92e0eadc462eae851aa6ba5dded6 100644 (file)
@@ -351,7 +351,10 @@ function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $ma
     global $startMessage, $languages, $squirrelmail_language,
            $show_html_default, $sort, $has_unsafe_images, $passed_ent_id,
            $use_iframe, $iframe_height, $download_and_unsafe_link,
-           $download_href, $unsafe_image_toggle_href, $unsafe_image_toggle_text;
+           $download_href, $unsafe_image_toggle_href, $unsafe_image_toggle_text,
+           $oTemplate;
+
+    $nbsp = $oTemplate->fetch('non_breaking_space.tpl');
 
     // workaround for not updated config.php
     if (! isset($use_iframe)) $use_iframe = false;
@@ -450,7 +453,8 @@ function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $ma
             $link .= '&amp;passed_ent_id='.$passed_ent_id;
         }
         $download_href = SM_PATH . 'src/download.php?absolute_dl=true&amp;' . $link;
-        $download_and_unsafe_link .= '&nbsp;|&nbsp;<a href="'. $download_href .'">' . _("Download this as a file") .  '</a>';
+        $download_and_unsafe_link .= "$nbsp|$nbsp" 
+            . create_hyperlink($download_href, _("Download this as a file"));
         if ($view_unsafe_images) {
             $text = _("Hide Unsafe Images");
         } else {
@@ -464,7 +468,8 @@ function formatBody($imap_stream, $message, $color, $wrap_at, $ent_num, $id, $ma
         if($text != '') {
             $unsafe_image_toggle_href = SM_PATH . 'src/read_body.php?'.$link;
             $unsafe_image_toggle_text = $text;
-            $download_and_unsafe_link .= '&nbsp;|&nbsp;<a href="'. $unsafe_image_toggle_href .'">' . $text . '</a>';
+            $download_and_unsafe_link .= "$nbsp|$nbsp"
+                . create_hyperlink($unsafe_image_toggle_href, $text);
         }
     }
     return $body;