Просмотр исходного кода

fixed a few more links to make them search-aware
fixed a few typos in translating_help.txt

Luke Ehresman 25 лет назад
Родитель
Сommit
ddddbbe8d6
4 измененных файлов с 52 добавлено и 11 удалено
  1. 2 3
      doc/translating_help.txt
  2. 7 1
      functions/mime.php
  3. 7 1
      src/download.php
  4. 36 6
      src/read_body.php

+ 2 - 3
doc/translating_help.txt

@@ -9,8 +9,7 @@ The help files, at this point, are devided into functional areas.
 Each .hlp file represents a different functional block of how the program looks 
 Each .hlp file represents a different functional block of how the program looks 
 to the user.
 to the user.
 
 
-I put each sentance on a line of its own because I thought it might make 
-it easier to translate. Hopefully as SquirrelMail is more widely used, 
+Hopefully as SquirrelMail is more widely used, 
 non-english translations will be used to make other non-english translations.
 non-english translations will be used to make other non-english translations.
 You might want to keep this in mind when writing yours. Remember that these will
 You might want to keep this in mind when writing yours. Remember that these will
 be used all over the world and in many different environments so local language 
 be used all over the world and in many different environments so local language 
@@ -58,7 +57,7 @@ To translate, just copy all the .hlp files from help/en into your new directory
 that you created for this language (i.e.  help/pl).  You only need to translate
 that you created for this language (i.e.  help/pl).  You only need to translate
 what is inbetween the tags.  Do not translate the actual tags such as <chapter> 
 what is inbetween the tags.  Do not translate the actual tags such as <chapter> 
 or <summary>.  The tag names need to remain in English.  You should only translate
 or <summary>.  The tag names need to remain in English.  You should only translate
-the test between tags.
+the text between tags.
 
 
 Often there may be other HTML tags such as <b> for bold or <a href...> to make
 Often there may be other HTML tags such as <b> for bold or <a href...> to make
 a link.  If you see any of these tags, just leave them and don't translate
 a link.  If you see any of these tags, just leave them and don't translate

+ 7 - 1
functions/mime.php

@@ -464,6 +464,7 @@
    // A recursive function that returns a list of attachments with links
    // A recursive function that returns a list of attachments with links
    // to where to download these attachments
    // to where to download these attachments
    function formatAttachments ($message, $ent_id, $mailbox, $id) {
    function formatAttachments ($message, $ent_id, $mailbox, $id) {
+      global $where, $what;
       if ($message) {
       if ($message) {
          if (!$message->entities) {
          if (!$message->entities) {
             $type0 = strtolower($message->header->type0);
             $type0 = strtolower($message->header->type0);
@@ -479,7 +480,12 @@
    
    
                $urlMailbox = urlencode($mailbox);
                $urlMailbox = urlencode($mailbox);
                $ent = urlencode($message->header->entity_id);
                $ent = urlencode($message->header->entity_id);
-               $body .= "<TT>&nbsp;&nbsp;&nbsp;<A HREF=\"../src/download.php?passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent\">" . $display_filename . "</A>&nbsp;&nbsp;(TYPE: $type0/$type1)";
+               if ($where && $what) {   
+                  // from a search
+                  $body .= "<TT>&nbsp;&nbsp;&nbsp;<A HREF=\"../src/download.php?where=".urlencode($where)."&what=".urlencode($what)."&passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent\">" . $display_filename . "</A>&nbsp;&nbsp;(TYPE: $type0/$type1)";
+               } else {   
+                  $body .= "<TT>&nbsp;&nbsp;&nbsp;<A HREF=\"../src/download.php?passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent\">" . $display_filename . "</A>&nbsp;&nbsp;(TYPE: $type0/$type1)";
+               }
                if ($message->header->description)
                if ($message->header->description)
                   $body .= "&nbsp;&nbsp;<b>" . htmlspecialchars($message->header->description)."</b>";
                   $body .= "&nbsp;&nbsp;<b>" . htmlspecialchars($message->header->description)."</b>";
                $body .= "&nbsp;(<a href=\"../src/download.php?absolute_dl=true&passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent\">"._("download")."</a>)\n";     
                $body .= "&nbsp;(<a href=\"../src/download.php?absolute_dl=true&passed_id=$id&mailbox=$urlMailbox&passed_ent_id=$ent\">"._("download")."</a>)\n";     

+ 7 - 1
src/download.php

@@ -27,12 +27,18 @@
    include("../src/load_prefs.php");
    include("../src/load_prefs.php");
 
 
    function viewText($color, $body, $id, $entid, $mailbox, $type1, $wrap_at) {
    function viewText($color, $body, $id, $entid, $mailbox, $type1, $wrap_at) {
+      global $where, $what;
       displayPageHeader($color, "None");
       displayPageHeader($color, "None");
 
 
       echo "<BR><TABLE WIDTH=90% BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">";
       echo "<BR><TABLE WIDTH=90% BORDER=0 CELLSPACING=0 CELLPADDING=2 ALIGN=CENTER><TR><TD BGCOLOR=\"$color[0]\">";
       echo "<B><CENTER>";
       echo "<B><CENTER>";
       echo _("Viewing a text attachment") . " - ";
       echo _("Viewing a text attachment") . " - ";
-      echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$id&startMessage=$startMessage&show_more=0\">". _("View message") . "</a>";
+      if ($where && $what) {
+         // from a search
+         echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$id&where=".urlencode($where)."&what=".urlencode($what)."\">". _("View message") . "</a>";
+      } else {   
+         echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$id&startMessage=$startMessage&show_more=0\">". _("View message") . "</a>";
+      }   
       echo "</CENTER></B>";
       echo "</CENTER></B>";
       echo "</TD></TR><TR><TD BGCOLOR=\"$color[4]\">";
       echo "</TD></TR><TR><TD BGCOLOR=\"$color[4]\">";
       $urlmailbox = urlencode($mailbox);
       $urlmailbox = urlencode($mailbox);

+ 36 - 6
src/read_body.php

@@ -36,7 +36,12 @@
       echo "<br>";
       echo "<br>";
       echo "<table width=100% cellpadding=2 cellspacing=0 border=0 align=center>\n";
       echo "<table width=100% cellpadding=2 cellspacing=0 border=0 align=center>\n";
       echo "   <TR><TD BGCOLOR=\"$color[9]\" WIDTH=100%><center><b>" . _("Viewing full header") . "</b> - ";
       echo "   <TR><TD BGCOLOR=\"$color[9]\" WIDTH=100%><center><b>" . _("Viewing full header") . "</b> - ";
-      echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more\">";
+      if ($where && $what) {
+         // Got here from a search
+         echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$passed_id&where=".urlencode($where)."&what=".urlencode($what)."\">";
+      } else {  
+         echo "<a href=\"read_body.php?mailbox=".urlencode($mailbox)."&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more\">";
+      }
       echo ""._("View message") . "</a></b></center></td></tr></table>\n";
       echo ""._("View message") . "</a></b></center></td></tr></table>\n";
       echo "<table width=99% cellpadding=2 cellspacing=0 border=0 align=center>\n";
       echo "<table width=99% cellpadding=2 cellspacing=0 border=0 align=center>\n";
       echo "<tr><td><pre>";
       echo "<tr><td><pre>";
@@ -141,11 +146,21 @@
       if (count($to_ary) > 1) {
       if (count($to_ary) > 1) {
          if ($show_more == false) {
          if ($show_more == false) {
             if ($i == 1) {
             if ($i == 1) {
-               $to_string = "$to_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more=1&show_more_cc=$show_more_cc\">$echo_more</A>)";
+               if ($where && $what) {
+                  // from a search
+                  $to_string = "$to_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&where=".urlencode($where)."&what=".urlencode($what)."&show_more=1&show_more_cc=$show_more_cc\">$echo_more</A>)";
+               } else {
+                  $to_string = "$to_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more=1&show_more_cc=$show_more_cc\">$echo_more</A>)";
+               }   
                $i = count($to_ary);
                $i = count($to_ary);
             }
             }
          } else if ($i == 1) {
          } else if ($i == 1) {
-            $to_string = "$to_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more=0&show_more_cc=$show_more_cc\">$echo_less</A>)";
+            if ($where && $what) {
+               // from a search
+               $to_string = "$to_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&where=".urlencode($where)."&what=".urlencode($what)."&show_more=0&show_more_cc=$show_more_cc\">$echo_less</A>)";
+            } else {
+               $to_string = "$to_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more=0&show_more_cc=$show_more_cc\">$echo_less</A>)";
+            }
          }
          }
       }
       }
    }
    }
@@ -165,11 +180,21 @@
       if (count($cc_ary) > 1) {
       if (count($cc_ary) > 1) {
          if ($show_more_cc == false) {
          if ($show_more_cc == false) {
             if ($i == 1) {
             if ($i == 1) {
-               $cc_string = "$cc_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more_cc=1&show_more=$show_more\">$echo_more</A>)";
+               if ($where && $what) {
+                  // from a search
+                  $cc_string = "$cc_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&what=".urlencode($what)."&where=".urlencode($where)."&show_more_cc=1&show_more=$show_more\">$echo_more</A>)";
+               } else {
+                  $cc_string = "$cc_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more_cc=1&show_more=$show_more\">$echo_more</A>)";
+               }   
                $i = count($cc_ary);
                $i = count($cc_ary);
             }
             }
          } else if ($i == 1) {
          } else if ($i == 1) {
-            $cc_string = "$cc_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more_cc=0&show_more=$show_more\">$echo_less</A>)";
+            if ($where && $what) {
+               // from a search
+               $cc_string = "$cc_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&what=".urlencode($what)."&where=".urlencode($where)."&show_more_cc=0&show_more=$show_more\">$echo_less</A>)";
+            } else {
+               $cc_string = "$cc_string&nbsp;(<A HREF=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&sort=$sort&startMessage=$startMessage&show_more_cc=0&show_more=$show_more\">$echo_less</A>)";
+            }   
          }
          }
       }
       }
    }
    }
@@ -245,7 +270,12 @@
    echo "         </TD><TD BGCOLOR=\"$color[0]\" WIDTH=84%>\n";
    echo "         </TD><TD BGCOLOR=\"$color[0]\" WIDTH=84%>\n";
    echo "            <B>$subject</B>\n";
    echo "            <B>$subject</B>\n";
    echo "         </TD>\n";
    echo "         </TD>\n";
-   echo "         <TD WIDTH=1% bgcolor=\"$color[0]\" nowrap align=right><small><a href=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more&view_hdr=1\">" . _("View full header") . "</a></small>&nbsp;&nbsp;</td>";
+   if ($where && $what) {
+      // Got here from a search
+      echo "         <TD WIDTH=1% bgcolor=\"$color[0]\" nowrap align=right><small><a href=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&where=".urlencode($where)."&what=".urlencode($what)."&view_hdr=1\">" . _("View full header") . "</a></small>&nbsp;&nbsp;</td>";
+   } else {   
+      echo "         <TD WIDTH=1% bgcolor=\"$color[0]\" nowrap align=right><small><a href=\"read_body.php?mailbox=$urlMailbox&passed_id=$passed_id&startMessage=$startMessage&show_more=$show_more&view_hdr=1\">" . _("View full header") . "</a></small>&nbsp;&nbsp;</td>";
+   }
    echo "      </TR>\n";
    echo "      </TR>\n";
    /** from **/
    /** from **/
    echo "      <TR>\n";
    echo "      <TR>\n";