From 390372b45bd353cbfc6843382bc7f4291544fc49 Mon Sep 17 00:00:00 2001 From: lkehresman Date: Wed, 26 Jul 2000 11:07:07 +0000 Subject: [PATCH] - fixed renaming folders, now renames subfolders as well - 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 --- INSTALL | 30 ++- config/conf.pl | 5 +- config/config_default.php | 34 ++- doc/index.html | 11 +- doc/themes.txt | 53 ++++ doc/translating_help.txt | 93 ++++--- functions/imap_mailbox.php | 2 +- functions/page_header.php | 1 + plugins/README.plugins | 27 ++ src/folders.php | 27 +- src/folders_rename_do.php | 29 +-- src/help.php | 271 +++++++++++++-------- src/left_help.php | 85 ------- src/load_prefs.php | 4 + themes/README.themes | 3 + {config => themes}/bluesteel_theme.php | 0 {config => themes}/dark_grey_theme.php | 0 {config => themes}/deepocean_theme.php | 0 themes/default_theme.php | 31 +++ {config => themes}/forest_theme.php | 0 {config => themes}/high_contrast_theme.php | 0 {config => themes}/ice_theme.php | 0 {config => themes}/plain_blue_theme.php | 0 {config => themes}/purple_theme.php | 0 {config => themes}/sandstorm_theme.php | 0 {config => themes}/seaspray_theme.php | 0 {config => themes}/slashdot_theme.php | 0 27 files changed, 429 insertions(+), 277 deletions(-) create mode 100644 doc/themes.txt create mode 100644 plugins/README.plugins delete mode 100644 src/left_help.php create mode 100644 themes/README.themes rename {config => themes}/bluesteel_theme.php (100%) rename {config => themes}/dark_grey_theme.php (100%) rename {config => themes}/deepocean_theme.php (100%) create mode 100644 themes/default_theme.php rename {config => themes}/forest_theme.php (100%) rename {config => themes}/high_contrast_theme.php (100%) rename {config => themes}/ice_theme.php (100%) rename {config => themes}/plain_blue_theme.php (100%) mode change 100755 => 100644 rename {config => themes}/purple_theme.php (100%) rename {config => themes}/sandstorm_theme.php (100%) rename {config => themes}/seaspray_theme.php (100%) rename {config => themes}/slashdot_theme.php (100%) diff --git a/INSTALL b/INSTALL index b15089c0..91a68ec7 100644 --- 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 diff --git a/config/conf.pl b/config/conf.pl index 10c673c3..e57f4b1e 100755 --- a/config/conf.pl +++ b/config/conf.pl @@ -1024,8 +1024,8 @@ sub command41 { $name = ; $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 = ; $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"; diff --git a/config/config_default.php b/config/config_default.php index 1b10bc92..0f29a6c0 100644 --- a/config/config_default.php +++ b/config/config_default.php @@ -1,4 +1,14 @@ lehresma@css.tayloru.edu. +mistakes, please email them to luke@squirrelmail.org.

@@ -56,6 +56,14 @@ mistakes, please email them to lehresma@css.t +
    + Themes +
      + 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. +
    +
+
    Russian Apache
      @@ -69,6 +77,7 @@ mistakes, please email them to lehresma@css.t
        AUTHORS
        INSTALL
        + UPGRADE
        README
        COPYING
        ChangeLog
        diff --git a/doc/themes.txt b/doc/themes.txt new file mode 100644 index 00000000..5dc642d2 --- /dev/null +++ b/doc/themes.txt @@ -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. + +------ + +------ + +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: + 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 + and I will review it. diff --git a/doc/translating_help.txt b/doc/translating_help.txt index 4421b6a6..435ae63e 100644 --- a/doc/translating_help.txt +++ b/doc/translating_help.txt @@ -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: -

        - -

        Some Head

        -Some text on some subject. -

        - -

        - -

        Some Head

        -Some text on some subject. -

        - -This is important because the left menu is dynamically built from what is inside the .hlp files. -All ,

        , and

        tags MUST be on a line by themselves. -No modifiers may be used for the 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

        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 and . +For these help files, the tags must be on their own line like this: + + Value for this tag + + +There are two types of main tags: and
        . There can be only +one tag in a .hlp file. However, there can be many
        tags. +Inside both of these tags, their can be any combination of any of the following +tags: , <description>, <summary>. Here is an example: + + | <chapter> + The title can only | <title> + be one line long | My first chapter + | + Summary may be many | + lines, but is short | Just a brief summary + | + | + 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. | + | + + +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 +or . 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 for bold or 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!! diff --git a/functions/imap_mailbox.php b/functions/imap_mailbox.php index 1ac79cff..66f6dda6 100755 --- a/functions/imap_mailbox.php +++ b/functions/imap_mailbox.php @@ -106,7 +106,7 @@ $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; diff --git a/functions/page_header.php b/functions/page_header.php index 1eb18dff..ae5e8d81 100644 --- a/functions/page_header.php +++ b/functions/page_header.php @@ -76,6 +76,7 @@ /** Here is the header and wrapping table **/ $shortBoxName = readShortMailboxName($mailbox, "."); $shortBoxName = stripslashes($shortBoxName); + echo "\n"; echo "\n"; echo " \n"; echo "
        \n"; diff --git a/plugins/README.plugins b/plugins/README.plugins new file mode 100644 index 00000000..ea62502e --- /dev/null +++ b/plugins/README.plugins @@ -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. diff --git a/src/folders.php b/src/folders.php index db48ce95..35b5a39f 100644 --- a/src/folders.php +++ b/src/folders.php @@ -162,19 +162,24 @@ 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 "