- fixed bug when deleting last message, sends you to previous list
[squirrelmail.git] / src / help.php
index 60f9235857156f4c2517cd44165a8ef1e4ffa714..3b1e62329ced529d5ae6519294eaabcc369d782f 100644 (file)
    if (!isset($auth_php))
       include ("../functions/auth.php"); 
 
-   if ($language) {
-      setcookie("squirrelmail_language", $language, time()+2592000);
-      $squirrelmail_language = $language;
-   }   
-
    include("../src/load_prefs.php");
    displayPageHeader($color, "None");
    is_logged_in(); 
        $helpdir[7] = "FAQ.hlp";
 
    /****************[ HELP FUNCTIONS ]********************/
+   // parses through and gets the information from the different documents.  
+   // this returns one section at a time.  You must keep track of the position
+   // so that it knows where to start to look for the next section.
+
    function get_info($doc, $pos) {
       for ($n=$pos; $n < count($doc); $n++) {
          if (trim(strtolower($doc[$n])) == "<chapter>" || trim(strtolower($doc[$n])) == "<section>") {
@@ -88,8 +87,8 @@
 
 <br>
 <table width=95% align=center cellpadding=2 cellspacing=2 border=0>
-<tr><td bgcolor="<? echo $color[0] ?>">
-   <center><b><? echo _("Help") ?></b></center>
+<tr><td bgcolor="<?php echo $color[0] ?>">
+   <center><b><?php echo _("Help") ?></b></center>
 </td></tr></table>
 
 
          $context = "read"; 
    }
    
-   if (file_exists("../help/$user_language")) {
+   if (file_exists("../help/$squirrelmail_language")) {
       $help_exists = true;
-      $user_language = $user_language;
    } else if (file_exists("../help/en")) {
       $help_exists = true;
       echo "<center><font color=\"$color[2]\">";
-      echo _("The help has not been translated to your preferred language.  It will be displayed in English instead.");
+      printf (_("The help has not been translated to %s.  It will be displayed in English instead."), $languages[$squirrelmail_language]["NAME"]);
       echo "</font></center><br>";
       $user_language = "en";
    } else {
       }
    }
 ?>
-<tr><td bgcolor="<? echo $color[0] ?>">&nbsp;</td></tr></table>
+<tr><td bgcolor="<?php echo $color[0] ?>">&nbsp;</td></tr></table>
 <td></tr></table>
 </body></html>