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
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
$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;
print FILE ");\n\n";
}
- print FILE "\n";
print FILE "\t\$motd = \"$motd\";\n";
print FILE "?>\n";
<?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)
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>
</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>
<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>
--- /dev/null
+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.
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!!
$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"] . " ";
$boxes[$g]["formatted"] .= readShortMailboxName($mailbox, $dm);
$boxes[$g]["unformatted-dm"] = $mailbox;
/** 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";
--- /dev/null
+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.
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"];
$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>";
- */
?>
-<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] ?>"> </td></tr></table>
+<td></tr></table>
+</body></html>
+++ /dev/null
-<?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
- }
- }
- }
- }
-?>
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");
--- /dev/null
+
+For information on creating themes, please read doc/themes.txt
+
--- /dev/null
+<?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
+?>