From 80135a8830b5101f5ee9eb794700060fe6d8516e Mon Sep 17 00:00:00 2001 From: lbergman Date: Mon, 5 Jun 2000 20:40:20 +0000 Subject: [PATCH] added help menu stuff git-svn-id: https://svn.code.sf.net/p/squirrelmail/code/trunk/squirrelmail@522 7612ce4b-ef26-0410-bec9-ea0150e637f0 --- src/left_main.php | 67 ++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 66 insertions(+), 1 deletion(-) diff --git a/src/left_main.php b/src/left_main.php index d86a4fe6..eef300c7 100644 --- a/src/left_main.php +++ b/src/left_main.php @@ -14,6 +14,71 @@ exit; } +//** Configure the left frame for the help menu + **/ Maybe this should be a function but since I haven't done one it isn't + + $ishelp = substr(getenv(REQUEST_URI),-8); // take the right 8 characters from the requested URL + if ($ishelp == "help.php") { + if (!isset($config_php)) + include("../config/config.php"); + if (!isset($i18n_php)) + include("../functions/i18n.php"); + include("../src/load_prefs.php"); + echo ""; + echo "\n"; + $left_size = 250; //doesn't seem to work + /** + ** 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 ( or

). produces ugly HTML. Will try to clean up. + **/ + + if (!file_exists("../help/$user_language")) // If the selected language doesn't exist, use english + $user_language = "en"; + + 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("", "", $tempanc); + echo ""; + } + if ( eregi("

", $line, $temphed)) { // grab a description for the link made above + $temphed = $line; + $temphed = ereg_replace("

", "", $temphed); + $temphed = ereg_replace("

", "", $temphed); + echo "
"; + echo "" . _("$temphed") . "

\n"; // make it bigger since it is a heading type 1 + } + if ( eregi("

", $line, $temphed)) { // grab a description for the link made above + $temphed = $line; + $temphed = ereg_replace("

", "", $temphed); + $temphed = ereg_replace("

", "", $temphed); + echo "" . _("$temphed") . "
\n"; // keep same size since it is a normal entry + } + } + } + } else { + if (!isset($config_php)) include("../config/config.php"); if (!isset($array_php)) @@ -125,6 +190,6 @@ fclose($imapConnection); - + } ?> -- 2.25.1