X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fhelp.php;h=155d184b55f036185063b2de347e776d16cb531d;hp=884b8fdda06e0ad013ff1b4e433be6cace883dc0;hb=15e6162eacc97158393bc75aed3afeb7b19c24a6;hpb=04632dbcbdd2793b533c66df10ba321441d03c2f
diff --git a/src/help.php b/src/help.php
index 884b8fdd..155d184b 100644
--- a/src/help.php
+++ b/src/help.php
@@ -1,49 +1,52 @@
") {
+ $ary[1] = "";
for ($n++;$n < count($doc) && (trim(strtolower($doc[$n])) != ""); $n++) {
$ary[1] .= $doc[$n];
}
}
if (trim(strtolower($doc[$n])) == "") {
+ $ary[2] = "";
for ($n++;$n < count($doc) && (trim(strtolower($doc[$n])) != ""); $n++) {
$ary[2] .= $doc[$n];
}
}
- }
- if ($ary) {
+ }
+ if (isset($ary)) {
$ary[3] = $n;
return $ary;
} else {
@@ -74,14 +79,14 @@
$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;
}
-
+
/**************[ END HELP FUNCTIONS ]******************/
?>
@@ -99,21 +104,24 @@
if ($HTTP_REFERER) {
$ref = strtolower($HTTP_REFERER);
if (strpos($ref, "src/compose"))
- $context = "compose";
+ $context = "compose";
else if (strpos($ref, "src/addr"))
- $context = "address";
+ $context = "address";
else if (strpos($ref, "src/folders"))
- $context = "folders";
+ $context = "folders";
else if (strpos($ref, "src/options"))
- $context = "options";
+ $context = "options";
else if (strpos($ref, "src/right_main"))
- $context = "index";
+ $context = "index";
else if (strpos($ref, "src/read_body"))
- $context = "read";
+ $context = "read";
else if (strpos($ref, "src/search"))
- $context = "search";
+ $context = "search";
}
-
+
+ if (!$squirrelmail_language)
+ $squirrelmail_language = "en";
+
if (file_exists("../help/$squirrelmail_language")) {
$help_exists = true;
$user_language = $squirrelmail_language;
@@ -131,8 +139,10 @@
echo "";
exit;
}
-
+
if ($help_exists) {
+ if (! isset($context))
+ $context = '';
if ($context == "compose")
$chapter = 4;
else if ($context == "address")
@@ -148,7 +158,7 @@
else if ($context == "search")
$chapter = 8;
- if (!$chapter) {
+ if (!isset($chapter)) {
echo "
\n";
echo "" . _("Table of Contents") . " ";
do_hook("help_chapter");
@@ -167,19 +177,20 @@
echo "";
- if ($chapter <= 1) echo "Previous | ";
- else echo "Previous | ";
- echo "Table of Contents";
- if ($chapter >= count($helpdir)) echo " | Next";
- else echo " | Next\n";
+ if ($chapter <= 1) echo ""._("Previous")." | ";
+ else echo ""._("Previous")." | ";
+ echo ""._("Table of Contents")."";
+ if ($chapter >= count($helpdir)) echo " | "._("Next")."";
+ else echo " | "._("Next")."\n";
echo " \n";
echo "$chapter - $help_info[0]
\n";
- if ($help_info[1])
+ if (isset($help_info[1]))
echo "$help_info[1]\n";
- else
+ else
echo "$help_info[2] \n";
+ $section = 0;
for ($n = $help_info[3]; $n < count($doc); $n++) {
$section++;
$help_info = get_info($doc, $n);
@@ -193,7 +204,7 @@
echo " " . _("Top") . "\n";
}
}
- do_hook("help_bottom");
+ do_hook("help_bottom");
?>
|
|
|