- fixed renaming folders, now renames subfolders as well
authorlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 26 Jul 2000 11:07:07 +0000 (11:07 +0000)
committerlkehresman <lkehresman@7612ce4b-ef26-0410-bec9-ea0150e637f0>
Wed, 26 Jul 2000 11:07:07 +0000 (11:07 +0000)
- added some new documentation
   themes/README.themes
   plugins/README.plugins
   doc/themes.txt
- moved themes to themes/ directory, added checking in load_prefs
- revaped help system:
   - .hlp files are in xml format
   - doesn't pop up new window (netscape/ie specific)
   - a bit more navigationable
   - context-sensative
   - updated help documentation

git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@638 7612ce4b-ef26-0410-bec9-ea0150e637f0

27 files changed:
INSTALL
config/conf.pl
config/config_default.php
doc/index.html
doc/themes.txt [new file with mode: 0644]
doc/translating_help.txt
functions/imap_mailbox.php
functions/page_header.php
plugins/README.plugins [new file with mode: 0644]
src/folders.php
src/folders_rename_do.php
src/help.php
src/left_help.php [deleted file]
src/load_prefs.php
themes/README.themes [new file with mode: 0644]
themes/bluesteel_theme.php [moved from config/bluesteel_theme.php with 100% similarity]
themes/dark_grey_theme.php [moved from config/dark_grey_theme.php with 100% similarity]
themes/deepocean_theme.php [moved from config/deepocean_theme.php with 100% similarity]
themes/default_theme.php [new file with mode: 0644]
themes/forest_theme.php [moved from config/forest_theme.php with 100% similarity]
themes/high_contrast_theme.php [moved from config/high_contrast_theme.php with 100% similarity]
themes/ice_theme.php [moved from config/ice_theme.php with 100% similarity]
themes/plain_blue_theme.php [moved from config/plain_blue_theme.php with 100% similarity, mode: 0644]
themes/purple_theme.php [moved from config/purple_theme.php with 100% similarity]
themes/sandstorm_theme.php [moved from config/sandstorm_theme.php with 100% similarity]
themes/seaspray_theme.php [moved from config/seaspray_theme.php with 100% similarity]
themes/slashdot_theme.php [moved from config/slashdot_theme.php with 100% similarity]

diff --git a/INSTALL b/INSTALL
index b15089c02c749469c82368c240ff81a5a08d8024..91a68ec763dfc7df8b0ffdbe0e88dc9629fe21cb 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -111,8 +111,8 @@ b. Setting up directories
   must be writable by the webserver. If your webserver is running as
   the user nobody you can fix this by running:
 
-    chown -R nobody data
-    chgrp -R nobody data
+    chown -R nobody data
+    chgrp -R nobody data
   
   There also needs to be a directory where attachments are stored
   before they are sent. Since personal mail is stored in this
@@ -123,26 +123,32 @@ b. Setting up directories
   permissions. You could do this by running these commands (still
   granted that the webserver is running as nobody/nobody)
 
-    cd /var/some/place
-    mkdir SomeDirectory
-    chgrp -R nobody SomeDirectory
-    chmod 730 SomeDirectory
+    cd /var/some/place
+    mkdir SomeDirectory
+    chgrp -R nobody SomeDirectory
+    chmod 730 SomeDirectory
 
   If you trust all the users on you system not to read mail they are
   not supposed to read change the last line to chmod 777 SomeDirectory
-  or simply use /tmp as you attachments directory. If a user is
-  aborting a mail but has uploaded som attachments to it the files
-  will be lying around in this directory forever if you do not remove
-  them.
+  or simply use /tmp as you attachments directory. 
+  
+  If a user is aborting a mail but has uploaded som attachments to it 
+  the files will be lying around in this directory forever if you do not 
+  remove them.  To fix this, it is recommended to create a cron job that
+  deletes everything in the attachment directory.  Something similar
+  to the folling will be good enough:
+
+    $ cd /var/attach/directory
+    $ rm -f *
 
 c. Setting up SquirrelMail
 
   There are two ways to configure Squirrelmail.  In the config/ directory,
   there is a perl script called conf.pl that will aid you in the
-  configuration process.  This is the most recommended way of handling
+  configuration process.  This is the recommended way of handling
   the config.
 
-  You can also copy the config/config_default.php file to config.php
+  You can also copy the config/config_default.php file to config/config.php
   and edit that manually.
 
 4. RUNNING SQUIRRELMAIL
index 10c673c3138065c4306869a87eb5097e0de577f3..e57f4b1ee882ba1c8e50d2bed7aedd7011649a38 100755 (executable)
@@ -1024,8 +1024,8 @@ sub command41 {
          $name = <STDIN>;
          $name =~ s/[\r|\n]//g;
          $theme_name[$#theme_name+1] = $name;
-         print "Be sure to put ../config/ before the filename.\n";
-         print "What file is this stored in (ex: ../config/default_theme.php): ";
+         print "Be sure to put ../themes/ before the filename.\n";
+         print "What file is this stored in (ex: ../themes/default_theme.php): ";
          $name = <STDIN>;
          $name =~ s/[\r|\n]//g;
          $theme_path[$#theme_path+1] = $name;
@@ -1311,7 +1311,6 @@ sub save_data {
       print FILE ");\n\n";
    }
 
-   print FILE "\n";
    print FILE "\t\$motd = \"$motd\";\n";
 
    print FILE "?>\n";
index 1b10bc92ff74b7f0984268a1250a8895ab4a72b7..0f29a6c014e58182c3258b17c0c8d907c55cebaa 100644 (file)
@@ -1,4 +1,14 @@
 <?php
+//
+//  BEFORE EDITING THIS FILE!
+//
+//  Don't edit this file directly.  Copy it to config.php before you
+//  edit it.  However, it is best to use the configuration script
+//  conf.pl if at all possible.  That is the easiest and cleanest way
+//  to configure.
+//
+
+
 //  Organization's logo picture (blank if none)
     $org_logo = "../images/sm_logo.jpg";
 
 
     // The first one HAS to be here, and is your system's default theme.
     // It can be any theme you want
-    $theme[0]["PATH"] = "../config/default_theme.php";
+    $theme[0]["PATH"] = "../themes/default_theme.php";
     $theme[0]["NAME"] = "Default";
 
-    $theme[1]["PATH"] = "../config/plain_blue_theme.php";
+    $theme[1]["PATH"] = "../themes/plain_blue_theme.php";
     $theme[1]["NAME"] = "Plain Blue";
 
-    $theme[2]["PATH"] = "../config/sandstorm_theme.php";
+    $theme[2]["PATH"] = "../themes/sandstorm_theme.php";
     $theme[2]["NAME"] = "Sand Storm";
 
-    $theme[3]["PATH"] = "../config/deepocean_theme.php";
+    $theme[3]["PATH"] = "../themes/deepocean_theme.php";
     $theme[3]["NAME"] = "Deep Ocean";
 
-    $theme[4]["PATH"] = "../config/slashdot_theme.php";
+    $theme[4]["PATH"] = "../themes/slashdot_theme.php";
     $theme[4]["NAME"] = "Slashdot";
 
-    $theme[5]["PATH"] = "../config/purple_theme.php";
+    $theme[5]["PATH"] = "../themes/purple_theme.php";
     $theme[5]["NAME"] = "Purple";
 
-    $theme[6]["PATH"] = "../config/forest_theme.php";
+    $theme[6]["PATH"] = "../themes/forest_theme.php";
     $theme[6]["NAME"] = "Forest";
 
-    $theme[7]["PATH"] = "../config/ice_theme.php";
+    $theme[7]["PATH"] = "../themes/ice_theme.php";
     $theme[7]["NAME"] = "Ice";
 
-    $theme[8]["PATH"] = "../config/seaspray_theme.php";
+    $theme[8]["PATH"] = "../themes/seaspray_theme.php";
     $theme[8]["NAME"] = "Sea Spray";
 
-    $theme[9]["PATH"] = "../config/bluesteel_theme.php";
+    $theme[9]["PATH"] = "../themes/bluesteel_theme.php";
     $theme[9]["NAME"] = "Blue Steel";
 
-    $theme[10]["PATH"] = "../config/dark_grey_theme.php";
+    $theme[10]["PATH"] = "../themes/dark_grey_theme.php";
     $theme[10]["NAME"] = "Dark Grey";
 
-    $theme[11]["PATH"] = "../config/high_contrast_theme.php";
+    $theme[11]["PATH"] = "../themes/high_contrast_theme.php";
     $theme[11]["NAME"] = "High Contrast";
 
 //  LDAP server(s)
index f9d6237c061245eb04937971e8370a7051b5fd90..245e24ce2db2f45a0657318481a81e4f8de984a8 100644 (file)
@@ -3,7 +3,7 @@
 Sorry for the lack of cohesion in the SquirrelMail documentation, but here is a conglomeration
 of all the docs that we have accumulated so far.  Maybe some time in the future we will put
 together a good documentation system.  This is just meant to get you up and running.  If you find
-mistakes, please email them to <a href="lehresma@css.tayloru.edu">lehresma@css.tayloru.edu</a>.
+mistakes, please email them to <a href="luke@squirrelmail.org">luke@squirrelmail.org</a>.
 </p>
 
 
@@ -56,6 +56,14 @@ mistakes, please email them to <a href="lehresma@css.tayloru.edu">lehresma@css.t
    </ul>
 </ul>
 
+<ul>
+   <a href="themes.txt">Themes</a>
+   <ul>
+      You can create your own color themes and add them in the themes/ directory
+      if you wish.  This describes the format of the theme files.
+   </ul>
+</ul>
+
 <ul>
    <a href="README.russian_apache">Russian Apache</a>
    <ul>
@@ -69,6 +77,7 @@ mistakes, please email them to <a href="lehresma@css.tayloru.edu">lehresma@css.t
    <ul>
       <a href="../AUTHORS">AUTHORS</a><br>
       <a href="../INSTALL">INSTALL</a><br>
+      <a href="../UPGRADE">UPGRADE</a><br>
       <a href="../README">README</a><br>
       <a href="../COPYING">COPYING</a><br>
       <a href="../ChangeLog">ChangeLog</a><br>
diff --git a/doc/themes.txt b/doc/themes.txt
new file mode 100644 (file)
index 0000000..5dc642d
--- /dev/null
@@ -0,0 +1,53 @@
+Themes
+======
+
+To create a theme, it is very simple.  Just go into the themes/ directory
+and create a file called yourtheme_theme.php.  You then need to create an
+array with 12 elements (0-11).  Below is an example followed by a
+description of what the different entries are for.
+
+---<START>--- 
+<?php
+
+   #  My Theme
+   #  Author:  My Name
+   #  Date:  Today's Date
+   #
+   #  Optional description
+   $color[0]   = "#xxxxxx";
+   $color[1]   = "#xxxxxx";
+   $color[2]   = "#xxxxxx";
+   $color[3]   = "#xxxxxx";
+   $color[4]   = "#xxxxxx";
+   $color[5]   = "#xxxxxx";
+   $color[6]   = "#xxxxxx";
+   $color[7]   = "#xxxxxx";
+   $color[8]   = "#xxxxxx";
+   $color[9]   = "#xxxxxx";
+   $color[10]  = "#xxxxxx";
+   $color[11]  = "#xxxxxx";
+
+?>
+---<END>---
+
+And here is a description of what the different entries in the array
+are color of:
+
+  0: Title Bar at the top of the page header
+  1: <not currently used>
+  2: Error messages (usually red)
+  3: Left folder list background color
+  4: Normal background color
+  5: Header of the message index (From, Date, Subject)
+  6: Normal text on the left folder list
+  7: Links in the right frame
+  8: Normal text (usually black) 
+  9: Darker version of #0
+ 10: Darker version of #9
+ 11: Special folders color (Inbox, Trash, Sent)
+
+Next all you have to do is run conf.pl and add the theme to the list
+of themes available to you.  If you would like your theme to be 
+included in the distribution of SquirrelMail, just email it to
+<luke@squirrelmail.org> and I will review it.
index 4421b6a6f31f3bb56939a44ee93fc0fb46e03323..435ae63e6291c3a9d20378eee984141a0e3dd952 100644 (file)
@@ -1,46 +1,67 @@
 Translating the help files.
----------------------------
+===========================
 
 I have tried to write the help files in plain english with good grammer.
-Since English is not my strong point you probably can't tell, but I hope it helps.
+Since English is not my strong point you probably can't tell, but I hope it 
+helps.
 
 The help files, at this point, are devided into functional areas.
-Each .hlp file represents a different functional block of how the program looks to the user.
+Each .hlp file represents a different functional block of how the program looks 
+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, 
 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 wil be used
-All over the world and in many different environments so local language dialects might
-confuse someone else. 
-
-File Structure.
-
-All translated files should be placed under the hlp directory.
-Under the hlp directory create another directory. This directory MUST be named
-to the two letter standard abbreviation for the language. English is "en" and 
-Spanish would be "sp" for example.
-
-The help files are written in the following format:
-<P>
-<A NAME=some_name></A>
-<H1>Some Head</H1>
-Some text on some subject.
-</P>
-
-<P>
-<A NAME=some_name></A>
-<H3>Some Head</H3>
-Some text on some subject.
-</P>
-
-This is important because the left menu is dynamically built from what is inside the .hlp files.
-All <A NAME></A>, <H1></H1>, and <H3></H3> tags MUST be on a line by themselves.
-No modifiers may be used for the <A> anchor tags. Modifiers other than the NAME modifier
-Will result in the additional modifier's inclusion in the left menu.
-Any other tags used such as <H4> will be ignored. I am currently working on making all the
-headers which are already listed in the po file translate automatically. We'll see how this goes.
-This will not work for files like FAQ.hlp and Basic.hlp which are not in the main program.
-
-At the current time no logic is in place to check if help is written on a certain subject.
+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 
+dialects might confuse someone else. 
 
+File Structure
+==============
+
+All translated files should be placed under the help directory.  Under the help 
+directory create another directory. This directory MUST be named to the two letter 
+standard abbreviation for the language. English is "en" and Polish would be "pl" 
+for example.
+
+The help files are written in a basic xml format.  Don't worry, XML isn't hard
+at all.  All it does is contain values inside tags like <start> and </start>.
+For these help files, the tags must be on their own line like this:
+   <tag>
+      Value for this tag
+   </tag>
+
+There are two types of main tags: <chapter> and <section>.  There can be only 
+one <chapter> tag in a .hlp file.  However, there can be many <section> tags.
+Inside both of these tags, their can be any combination of any of the following
+tags:  <title>, <description>, <summary>.  Here is an example:
+
+                     | <chapter>
+ The title can only  |    <title>
+ be one line long    |       My first chapter   
+                     |    </title>
+ Summary may be many |    <summary>
+ lines, but is short |       Just a brief summary
+                     |    </summary>
+                     |    <description>
+ Description can be  |       This is a more detailed description that
+ very long.  It is   |       can span many lines.  Usually this is the 
+ the main part of    |       bulk of the help section or chapter description.
+ the help section.   |    </description>
+                     | </chapter>
+
+
+Translating
+===========
+
+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
+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
+the test between tags.
+
+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
+them either.  Only what is contained inside them if needed.
+
+That should be all!!
index 1ac79cffa1b122ff556ef3594af16c0cb8276303..66f6dda6fe7922b6322d5bf70ddce18943da4629 100755 (executable)
             $dm_count--;
             
          for ($j = 0; $j < $dm_count - (countCharInString($folder_prefix, $dm)); $j++)
-            $boxes[$g]["formatted"] = $boxes[$g]["formatted"] . "  ";
+            $boxes[$g]["formatted"] = $boxes[$g]["formatted"] . "&nbsp;&nbsp;";
          $boxes[$g]["formatted"] .= readShortMailboxName($mailbox, $dm);
             
          $boxes[$g]["unformatted-dm"] = $mailbox;
index 1eb18dffa339ffd7f807a279367d120dda6cac0a..ae5e8d8199a954c7d535003b1a4da6985cc9ec93 100644 (file)
@@ -76,6 +76,7 @@
       /** Here is the header and wrapping table **/
       $shortBoxName = readShortMailboxName($mailbox, ".");
       $shortBoxName = stripslashes($shortBoxName);
+      echo "<A NAME=pagetop></A>\n";
       echo "<TABLE BGCOLOR=\"$color[4]\" BORDER=0 WIDTH=\"100%\" CELLSPACING=0 CELLPADDING=2>\n";
       echo "   <TR BGCOLOR=\"$color[9]\">\n";
       echo "      <TD ALIGN=left WIDTH=\"30%\"><b>\n";
diff --git a/plugins/README.plugins b/plugins/README.plugins
new file mode 100644 (file)
index 0000000..ea62502
--- /dev/null
@@ -0,0 +1,27 @@
+Plugins
+=======
+
+To understand more about plugins, read doc/plugin.txt
+
+For the impatient, here is an extremely brief overview of how to
+install plugins.
+
+  1.  Change to the plugins directory.
+
+        $ cd plugins/
+
+  2.  Unarchive the plugin.
+
+        $ tar -zxvf /home/me/myplugin.tar.gz
+
+  3.  Note the directory that the plugin was created into.  For this
+      example, we will assume it was put in the directory: myplugin/.
+
+  4.  Go to the config directory and run conf.pl
+
+        $ cd ../../config/
+        $ ./conf.pl
+
+  5.  Choose option 8 and proceed to add the new plugin following
+      the instructions there.  Save and exit, and your plugin should
+      be in place.
index db48ce95b952dd8083103128274d4eeaf71fca4a..35b5a39fcc2c3c3108d689d823d9d6bb01939194 100644 (file)
 
    for ($i = 0; $i < count($boxes); $i++) {
       if (count($boxes[$i]["flags"]) > 0) {
+         $noinf = false;
          for ($j = 0; $j < count($boxes[$i]["flags"]); $j++) {
-            if ($boxes[$i]["flags"][$j] != "noinferiors") {
-               if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && ($default_sub_of_inbox == true)) {
-                  $box = $boxes[$i]["unformatted"];
-                  $box2 = replace_spaces($boxes[$i]["formatted"]);
-                  echo "<OPTION SELECTED VALUE=\"$box\">$box2\n";
-               } else {
-                  $box = $boxes[$i]["unformatted"];
-                  $box2 = replace_spaces($boxes[$i]["formatted"]);
-                  echo "<OPTION VALUE=\"$box\">$box2\n";
-               }
-            }   
+            if ($boxes[$i]["flags"][$j] == "noinferiors") {
+               $noinf = true;
+               continue;
+            }
          }    
+         if ($noinf == false) {
+            if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && ($default_sub_of_inbox == true)) {
+               $box = $boxes[$i]["unformatted"];
+               $box2 = replace_spaces($boxes[$i]["formatted"]);
+               echo "<OPTION SELECTED VALUE=\"$box\">$box2\n";
+            } else {
+               $box = $boxes[$i]["unformatted"];
+               $box2 = replace_spaces($boxes[$i]["formatted"]);
+               echo "<OPTION VALUE=\"$box\">$box2\n";
+            }
+         }
       } else {
          if ((strtolower($boxes[$i]["unformatted"]) == "inbox") && ($default_sub_of_inbox == true)) {
             $box = $boxes[$i]["unformatted"];
index fe29b9aa7d1f0ca5b3e6bd3c0cc92a6ca38b5ddd..53686009f3df124fee456d43a1048273283f464f 100644 (file)
@@ -38,7 +38,7 @@
    $orig = stripslashes($orig);
    $newone = stripslashes($newone);
 
-   fputs ($imapConnection, ". RENAME \"$orig\" \"$newone\"\n");
+   fputs ($imapConnection, ". RENAME \"$orig\" \"$newone\"\r\n");
    $data = sqimap_read_data($imapConnection, ".", true, $a, $b);
 
    // Renaming a folder doesn't renames the folder but leaves you unsubscribed
       $newone = $newone.$dm;
       $orig = $orig.$dm;
    }   
-
    sqimap_unsubscribe($imapConnection, $orig);
    sqimap_subscribe($imapConnection, $newone);
 
+   fputs ($imapConnection, "a001 LSUB \"\" \"$orig*\"\r\n");
+   $data = sqimap_read_data($imapConnection, "a001", true, $a, $b);
+   for ($i=0; $i < count($data); $i++) {
+      $name = find_mailbox_name($data[$i]);
+      sqimap_unsubscribe($imapConnection, $name);
+      $name = substr($name, strlen($orig));
+      $name = $newone . $name;
+      sqimap_subscribe($imapConnection, $name);
+   }
+
+
    /** Log out this session **/
    sqimap_logout($imapConnection);
    $location = get_location();
    header ("Location: $location/folders.php?success=rename");
-   sqimap_logout($imapConnection);
-   /*
-   displayPageHeader($color, "None");
-   echo "<BR><BR><BR><CENTER><B>";
-   echo _("Folder Renamed!");
-   echo "</B><BR><BR>";
-   echo _("The folder has been successfully renamed.");
-   echo "<BR><A HREF=\"webmail.php?right_frame=folders.php\" TARGET=_top>";
-   echo _("Click here");
-   echo "</A> ";
-   echo _("to continue.");
-   echo "</CENTER>";
-   
-   echo "</BODY></HTML>"; 
-   */
 ?>
index 2b3d85dc95b1d46aaa51ecebedaa007a04453995..60f9235857156f4c2517cd44165a8ef1e4ffa714 100644 (file)
-<HTML>
-
 <?php
-
    /**
-    ** help.php
+    **  help.php
     **
     **  Copyright (c) 1999-2000 The SquirrelMail development team
     **  Licensed under the GNU GPL. For full terms see the file COPYING.
     **
-    **  This checks if the user's preferred language has a directory and file present
-    **  then loads it or english if preferred is not found.
+    **  Displays help for the user
     **
     **/
 
-  if (!isset($config_php))
+   session_start();
+
+   if (!isset($config_php))
       include("../config/config.php");
+   if (!isset($strings_php))
+      include("../functions/strings.php");
+   if (!isset($page_header_php))
+      include("../functions/page_header.php");
+   if (!isset($display_messages_php))
+      include("../functions/display_messages.php");
+   if (!isset($imap_php))
+      include("../functions/imap.php");
+   if (!isset($array_php))
+      include("../functions/array.php");
+   if (!isset($i18n_php))
+      include("../functions/i18n.php");
+   if (!isset($auth_php))
+      include ("../functions/auth.php"); 
+
+   if ($language) {
+      setcookie("squirrelmail_language", $language, time()+2592000);
+      $squirrelmail_language = $language;
+   }   
 
-/** If it was a successful login, lets load their preferences **/
    include("../src/load_prefs.php");
-   echo "<BODY TEXT=\"$color[8]\" BGCOLOR=\"$color[4]\" LINK=\"$color[7]\" VLINK=\"$color[7]\" ALINK=\"$color[7]\">\n";
-
-/** 
- ** Check to see if the help files have been translated into the users language
- ** If so, include them, if not, give them english. The po file should really have
- ** The echo line put in it.
- **/
-
-   if (file_exists("../help/$user_language/basic.hlp")) {
-       include ("../help/$user_language/basic.hlp");
-   } elseif(file_exists("../help/en/basic.hlp")) {
-       echo "<CENTER><B><FONT COLOR=$color[2]>";
-       echo _("Your preferred language is not yet translated. English will be substituted here.");
-       echo "</FONT></B></CENTER><BR>";
-       include ("../help/en/basic.hlp");
-   } else {
-       $nohelp = true;
-   }
-   if (file_exists("../help/$user_language/main_folder.hlp")) {
-       include ("../help/$user_language/main_folder.hlp");
-   } elseif(file_exists("../help/en/main_folder.hlp")) {
-       echo "<CENTER><B><FONT COLOR=$color[2]>";
-       echo _("Your preferred language is not yet translated. English will be substituted here.");
-       echo "</FONT></B></CENTER><BR>";
-       include ("../help/en/main_folder.hlp");
-   } else {
-       $nohelp = true;
-   }
-   if (file_exists("../help/$user_language/read_mail.hlp")) {
-       include ("../help/$user_language/read_mail.hlp");
-   } elseif(file_exists("../help/en/read_mail.hlp")) {
-       echo "<CENTER><B><FONT COLOR=$color[2]>";
-       echo _("Your preferred language is not yet translated. English will be substituted here.");
-       echo "</FONT></B></CENTER><BR>";
-       include ("../help/en/read_mail.hlp");
-   } else {
-       $nohelp = true;
-   }
-   if (file_exists("../help/$user_language/compose.hlp")) {
-       include ("../help/$user_language/compose.hlp");
-   } elseif(file_exists("../help/en/compose.hlp")) {
-       echo "<CENTER><B><FONT COLOR=$color[2]>Your preferred language is not yet translated. English will be substituted here.</FONT></B></CENTER><BR>";
-       echo "<CENTER><B><FONT COLOR=$color[2]>";
-       echo _("Your preferred language is not yet translated. English will be substituted here.");
-       echo "</FONT></B></CENTER><BR>";
-       include ("../help/en/compose.hlp");
-   } else {
-       $nohelp = true;
-   }
-   if (file_exists("../help/$user_language/addresses.hlp")) {
-       include ("../help/$user_language/addresses.hlp");
-   } elseif(file_exists("../help/en/addresses.hlp")) {
-       echo "<CENTER><B><FONT COLOR=$color[2]>";
-       echo _("Your preferred language is not yet translated. English will be substituted here.");
-       echo "</FONT></B></CENTER><BR>";
-       include ("../help/en/addresses.hlp");
-   } else {
-       $nohelp = true;
-   }
-   if (file_exists("../help/$user_language/folders.hlp")) {
-       include ("../help/$user_language/folders.hlp");
-   } elseif(file_exists("../help/en/folders.hlp")) {
-       echo "<CENTER><B><FONT COLOR=$color[2]>";
-       echo _("Your preferred language is not yet translated. English will be substituted here.");
-       echo "</FONT></B></CENTER><BR>";
-       include ("../help/en/folders.hlp");
-   } else {
-       $nohelp = true;
+   displayPageHeader($color, "None");
+   is_logged_in(); 
+
+       $helpdir[0] = "basic.hlp";
+       $helpdir[1] = "main_folder.hlp";
+       $helpdir[2] = "read_mail.hlp";
+       $helpdir[3] = "compose.hlp";
+       $helpdir[4] = "addresses.hlp";
+       $helpdir[5] = "folders.hlp";
+       $helpdir[6] = "options.hlp";
+       $helpdir[7] = "FAQ.hlp";
+
+   /****************[ HELP FUNCTIONS ]********************/
+   function get_info($doc, $pos) {
+      for ($n=$pos; $n < count($doc); $n++) {
+         if (trim(strtolower($doc[$n])) == "<chapter>" || trim(strtolower($doc[$n])) == "<section>") {
+            for ($n++;$n < count($doc) && (trim(strtolower($doc[$n])) != "</section>") && (trim(strtolower($doc[$n])) != "</chapter>"); $n++) {
+               if (trim(strtolower($doc[$n])) == "<title>") {
+                  $n++;
+                  $ary[0] = trim($doc[$n]);
+               }
+               if (trim(strtolower($doc[$n])) == "<description>") {
+                  for ($n++;$n < count($doc) && (trim(strtolower($doc[$n])) != "</description>"); $n++) {
+                     $ary[1] .= $doc[$n];
+                  }
+               }
+               if (trim(strtolower($doc[$n])) == "<summary>") {
+                  for ($n++;$n < count($doc) && (trim(strtolower($doc[$n])) != "</summary>"); $n++) {
+                     $ary[2] .= $doc[$n];
+                  }
+               }
+            }   
+            if ($ary) {
+               $ary[3] = $n;
+               return $ary;
+            } else {
+               $ary[0] = "ERROR: Help files are not in the right format!";
+               $ary[1] = "ERROR: Help files are not in the right format!";
+               $ary[2] = "ERROR: Help files are not in the right format!";
+               return $ary;
+            }   
+         }
+      }
+      $ary[0] = "ERROR: Help files are not in the right format!";
+      $ary[1] = "ERROR: Help files are not in the right format!";
+      return $ary;
    }
-   if (file_exists("../help/$user_language/options.hlp")) {
-       include ("../help/$user_language/options.hlp");
-   } elseif(file_exists("../help/en/options.hlp")) {
-       echo "<CENTER><B><FONT COLOR=$color[2]>";
-       echo _("Your preferred language is not yet translated. English will be substituted here.");
-       echo "</FONT></B></CENTER><BR>";
-       include ("../help/en/options.hlp");
-   } else {
-       $nohelp = true;
+   
+   /**************[ END HELP FUNCTIONS ]******************/
+
+?>
+
+<br>
+<table width=95% align=center cellpadding=2 cellspacing=2 border=0>
+<tr><td bgcolor="<? echo $color[0] ?>">
+   <center><b><? echo _("Help") ?></b></center>
+</td></tr></table>
+
+
+<table width=90% cellpadding=0 cellspacing=10 border=0 align=center><tr><td>
+<?php
+   if ($HTTP_REFERER) {
+      $ref = strtolower($HTTP_REFERER);
+      if (strpos($ref, "src/compose"))
+         $context = "compose"; 
+      else if (strpos($ref, "src/addr"))
+         $context = "address"; 
+      else if (strpos($ref, "src/folders"))
+         $context = "folders"; 
+      else if (strpos($ref, "src/options"))
+         $context = "options"; 
+      else if (strpos($ref, "src/right_main"))
+         $context = "index"; 
+      else if (strpos($ref, "src/read_body"))
+         $context = "read"; 
    }
-   if (file_exists("../help/$user_language/FAQ.hlp")) {
-       include ("../help/$user_language/FAQ.hlp");
-   } elseif(file_exists("../help/en/FAQ.hlp")) {
-       echo "<CENTER><B><FONT COLOR=$color[2]>";
-       echo _("Your preferred language is not yet translated. English will be substituted here.");
-       echo "</FONT></B></CENTER><BR>";
-       include ("../help/en/FAQ.hlp");
+   
+   if (file_exists("../help/$user_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.");
+      echo "</font></center><br>";
+      $user_language = "en";
    } else {
-       $nohelp = true;
+      $help_exists = false;
+      echo "<br><center><font color=\"$color[2]\">";
+      echo _("Some or all of the help documents are not present!");
+      echo "</font></center>";
    }
-// If any of the standard help files aren't there, tell them.
+   
+   if ($help_exists) {
+      if ($context == "compose")
+         $chapter = 4;
+      else if ($context == "address")
+         $chapter = 5;
+      else if ($context == "folders")
+         $chapter = 6;
+      else if ($context == "options")
+         $chapter = 7;
+      else if ($context == "index")
+         $chapter = 2;
+      else if ($context == "read")
+         $chapter = 3;
 
-   if($nohelp) {
-       echo "<BR><CENTER><B><FONT COLOR=$color[2]>",_("ERROR: Some or all of the standard English help files ar missing."), "</FONT></B></CENTER><BR>";
-   }
+      if (!$chapter) {
+         echo "<table cellpadding=0 cellspacing=0 border=0 align=center><tr><td>\n";
+         echo "<b><center>" . _("Table of Contents") . "</center></b><br>";
+         echo "<ol>\n";
+         for ($i=0; $i < count($helpdir); $i++) {
+            $doc = file("../help/$user_language/$helpdir[$i]");
+            $help_info = get_info($doc, 0);
+            echo "<li><a href=\"../src/help.php?chapter=". ($i+1) ."\">$help_info[0]</a>\n";
+            echo "<ul>$help_info[2]</ul>";
+         }
+         echo "</ol>\n";
+         echo "</td></tr></table>\n";
+      } else {
+         $doc = file("../help/$user_language/".$helpdir[$chapter-1]);
+         $help_info = get_info($doc, 0);
+
+         echo "<small><center>";
+
+         if ($chapter <= 1) echo "<font color=\"$color[9]\">Previous</font> | ";
+         else echo "<a href=\"../src/help.php?chapter=".($chapter-1)."\">Previous</a> | ";
+         echo "<a href=\"../src/help.php\">Table of Contents</a>";
+         if ($chapter >= count($helpdir)) echo " | <font color=\"$color[9]\">Next</font>";
+         else echo " | <a href=\"../src/help.php?chapter=".($chapter+1)."\">Next</a>";
+         echo "</center></small><br>\n";
 
+         echo "<font size=5><b>$chapter - $help_info[0]</b></font><br><br>\n";
+         if ($help_info[1])
+            echo "$help_info[1]";
+         else   
+            echo "<p>$help_info[2]</p>";
+
+         for ($n = $help_info[3]; $n < count($doc); $n++) {
+            $section++;
+            $help_info = get_info($doc, $n);
+            echo "<b>$chapter.$section - $help_info[0]</b>";
+            echo "<ul>";
+            echo "$help_info[1]";
+            echo "</ul>";
+            $n = $help_info[3];
+         }
+
+         echo "<br><center><a href=\"#pagetop\">" . _("Top") . "</a></center>";
+      }
+   }
 ?>
-</BODY>
-</HTML>
+<tr><td bgcolor="<? echo $color[0] ?>">&nbsp;</td></tr></table>
+<td></tr></table>
+</body></html>
diff --git a/src/left_help.php b/src/left_help.php
deleted file mode 100644 (file)
index 24b2d43..0000000
+++ /dev/null
@@ -1,85 +0,0 @@
-<?php
-   /**
-    **  left_help.php
-    **
-    **  Copyright (c) 1999-2000 The SquirrelMail development team
-    **  Licensed under the GNU GPL. For full terms see the file COPYING.
-    **
-    **  This is the code for the left help bar.  The left bar normally shows the folders
-    **  available, and has cookie information. This file is only used for the help system.
-    **  To be used, webmail must be called with ?help.php.
-    **
-    **/
-
-   session_start();
-
-   if(!isset($username)) {
-      echo "You need a valid user and password to access this page!";
-      exit;
-   }
-       if (!isset($config_php))
-          include("../config/config.php");
-       if (!isset($i18n_php))
-          include("../functions/i18n.php");
-       include("../src/load_prefs.php");
-       echo "<HTML BGCOLOR=\"$color[3]\">";
-       echo "<BODY BGCOLOR=\"$color[3]\" TEXT=\"$color[6]\" BGCOLOR=\"$color[3]\" LINK=\"$color[11]\" VLINK=\"$color[6]\" ALINK=\"$color[11]\">\n";
-   /**
-    ** Array used to list the include .hlp files, we could use a dir function
-    ** to step through the directory and list its contents but it doesn't order those.
-    ** This should probably go in config.php but it might mess up conf.pl
-    **/
-       $helpdir[0] = "basic.hlp";
-       $helpdir[1] = "main_folder.hlp";
-       $helpdir[2] = "read_mail.hlp";
-       $helpdir[3] = "addresses.hlp";
-       $helpdir[4] = "compose.hlp";
-       $helpdir[5] = "folders.hlp";
-       $helpdir[6] = "options.hlp";
-       $helpdir[7] = "FAQ.hlp";
-
-  /**
-   **  Build a menu dynamically for the left frame from the HTML tagged right frame include (.hlp) files listed in the $helpdir var.
-   **  This is done by first listing all the .hlp files in the $helpdir array. 
-   **  Next, we loop through the array, for every value of $helpdir we loop through the file and look for anchor tags (<A NAME=) and 
-   **  header tags (<H1> or <H3>).
-   **/
-
-       if (file_exists("../help/$user_language")) {                    
-        } elseif(file_exists("../help/en")){                             // If the selected language doesn't exist, use english
-          $user_language = en;
-       } else {                                                         // If that is gone too, send a message
-          $nohelp = true;
-          echo "<BR><CENTER><B><FONT COLOR=$color[2]>",_("ERROR: Some or all of the standard English help files ar missing."), "</FONT></B></CENTER><BR>";
-        }
-
-       if(!$nohelp) {
-          while ( list( $key, $val ) = each( $helpdir ) ) {            // loop through the array of files
-             $fcontents = file("../help/$user_language/$val");         // assign each line of the above file to another array
-             while ( list( $line_num, $line ) = each( $fcontents ) ) { // loop through the second array
-                $temphed="";
-                $tempanc="";
-
-                if ( eregi("<A NAME=", $line, $tempanc)) {             // if a name anchor is found, make a link
-                   $tempanc = trim($line);
-                   $tempanc = str_replace("<A NAME=", "", $tempanc);
-                   $tempanc = str_replace("></A>", "", $tempanc);
-                   echo "<A HREF=\"help.php#$tempanc\" target=\"right\">";
-                }
-                if ( eregi("<H1>", $line, $temphed)) {                 // grab a description for the link made above
-                   $temphed = trim($line);
-                   $temphed = str_replace("<H1>", "", $temphed);
-                   $temphed = str_replace("</H1>", "", $temphed);
-                   echo "<BR>";
-                   echo "<FONT SIZE=+1>" . _("$temphed") . "</FONT></A><BR>\n";        // make it bigger since it is a heading type 1
-                }
-                if ( eregi("<H3>", $line, $temphed)) {                 // grab a description for the link made above
-                   $temphed = trim($line);
-                   $temphed = str_replace("<H3>", "", $temphed);
-                   $temphed = str_replace("</H3>", "", $temphed);
-                   echo "" . _("$temphed") . "</A><BR>\n";             // keep same size since it is a normal entry
-                }
-             }
-          }
-       }
-?>
index 726dafb6cbb17716c9c13cb2ad387af8a23d429c..5979719e17a9f9dd82df12f1ddc4171adaa91282 100644 (file)
    checkForPrefs($data_dir, $username);
 
    $chosen_theme = getPref($data_dir, $username, "chosen_theme");
+   if ((substr($chosen_theme, 0, 10) == "../config/")) {
+      $chosen_theme = substr($chosen_theme, 10);
+      $chosen_theme = "../themes/$chosen_theme";
+   }
 
    if ((isset($chosen_theme)) && (file_exists($chosen_theme))) {
       require("$chosen_theme");
diff --git a/themes/README.themes b/themes/README.themes
new file mode 100644 (file)
index 0000000..13cdb3a
--- /dev/null
@@ -0,0 +1,3 @@
+
+For information on creating themes, please read doc/themes.txt
+
diff --git a/themes/default_theme.php b/themes/default_theme.php
new file mode 100644 (file)
index 0000000..cdaa67c
--- /dev/null
@@ -0,0 +1,31 @@
+<?php
+   /** Author:       Luke Ehresman
+       Date:         January 2, 2000
+       Theme Name:   "Default Theme"
+
+       This is the default theme that comes standard with SquirrelMail.
+       Most of the colors were taken from mail.yahoo.com's theme on their
+       site.
+
+       To create a new theme, just copy this file, and edit the colors.
+       Be sure to rename the file and keep the original, just in case.
+
+       NOTE:
+       Please email any themes you create to luke@usa.om.org for inclusion
+       in further releases of SquirrelMail and for download from the web
+       page.
+    **/
+
+    $color[0]   = "#DCDCDC"; // (light gray)     TitleBar
+    $color[1]   = "#800000"; // (red)
+    $color[2]   = "#CC0000"; // (light red)      Warning/Error Messages
+    $color[3]   = "#A0B8C8"; // (green-blue)     Left Bar Background
+    $color[4]   = "#FFFFFF"; // (white)          Normal Background
+    $color[5]   = "#FFFFCC"; // (light yellow)   Table Headers
+    $color[6]   = "#000000"; // (black)          Text on left bar
+    $color[7]   = "#0000CC"; // (blue)           Links
+    $color[8]   = "#000000"; // (black)          Normal text
+    $color[9]   = "#ABABAB"; // (mid-gray)       Darker version of #0
+    $color[10]  = "#666666"; // (dark gray)      Darker version of #9
+    $color[11]  = "#770000"; // (dark red)       Special Folders color
+?>
similarity index 100%
rename from config/ice_theme.php
rename to themes/ice_theme.php
old mode 100755 (executable)
new mode 100644 (file)
similarity index 100%
rename from config/plain_blue_theme.php
rename to themes/plain_blue_theme.php