X-Git-Url: https://vcs.fsf.org/?p=squirrelmail.git;a=blobdiff_plain;f=src%2Fhelp.php;h=e797f98a81958f8ec8ebf054d38217ac14f6b6f3;hp=99671fbece74f26eb7b7e3057eb99d7ab0bec777;hb=caa592dc7d3d53777323707cc5731fb48d3dc1bc;hpb=a32985a59fe460e2bf5c2e9ea2dd6004d0f66b54
diff --git a/src/help.php b/src/help.php
index 99671fbe..e797f98a 100644
--- a/src/help.php
+++ b/src/help.php
@@ -3,24 +3,23 @@
/**
* help.php
*
- * Copyright (c) 1999-2002 The SquirrelMail Project Team
- * Licensed under the GNU GPL. For full terms see the file COPYING.
- *
* Displays help for the user
*
- * $Id$
+ * @copyright 1999-2015 The SquirrelMail Project Team
+ * @license http://opensource.org/licenses/gpl-license.php GNU Public License
+ * @version $Id$
+ * @package squirrelmail
*/
-/* Path for SquirrelMail required files. */
-define('SM_PATH','../');
+/** This is the help page */
+define('PAGE_NAME', 'help');
-/* SquirrelMail required files. */
-require_once(SM_PATH . 'include/validate.php');
-require_once(SM_PATH . 'functions/display_messages.php');
-require_once(SM_PATH . 'functions/imap.php');
-require_once(SM_PATH . 'functions/array.php');
+/**
+ * Include the SquirrelMail initialization file.
+ */
+require('../include/init.php');
-displayPageHeader($color, 'None' );
+displayPageHeader($color);
$helpdir[0] = 'basic.hlp';
$helpdir[1] = 'main_folder.hlp';
@@ -41,12 +40,15 @@ $helpdir[8] = 'FAQ.hlp';
*/
function get_info($doc, $pos) {
+ $ary = array(0,0,0);
- for ($n=$pos; $n < count($doc); $n++) {
+ $cntdoc = count($doc);
+
+ for ($n=$pos; $n < $cntdoc; $n++) {
if (trim(strtolower($doc[$n])) == ''
|| trim(strtolower($doc[$n])) == '') {
- for ($n++;$n < count($doc)
- && (trim(strtolower($doc[$n])) != '')
+ for ($n++; $n < $cntdoc
+ && (trim(strtolower($doc[$n])) != '')
&& (trim(strtolower($doc[$n])) != ''); $n++) {
if (trim(strtolower($doc[$n])) == '
') {
$n++;
@@ -54,7 +56,7 @@ function get_info($doc, $pos) {
}
if (trim(strtolower($doc[$n])) == '') {
$ary[1] = '';
- for ($n++;$n < count($doc)
+ for ($n++;$n < $cntdoc
&& (trim(strtolower($doc[$n])) != '');
$n++) {
$ary[1] .= $doc[$n];
@@ -62,8 +64,8 @@ function get_info($doc, $pos) {
}
if (trim(strtolower($doc[$n])) == '') {
$ary[2] = '';
- for ($n++; $n < count($doc)
- && (trim(strtolower($doc[$n])) != '');
+ for ($n++; $n < $cntdoc
+ && (trim(strtolower($doc[$n])) != '');
$n++) {
$ary[2] .= $doc[$n];
}
@@ -76,160 +78,165 @@ function get_info($doc, $pos) {
$ary[1] = $ary[0];
$ary[2] = $ary[0];
}
- return( $ary );
+ return( $ary );
+ } else if (!trim(strtolower($doc[$n]))) {
+ $ary[0] = '';
+ $ary[1] = '';
+ $ary[2] = '';
+ $ary[3] = $n;
}
}
-
$ary[0] = _("ERROR: Help files are not in the right format!");
$ary[1] = $ary[0];
-
+ $ary[2] = $ary[0];
+ $ary[3] = $n;
return( $ary );
}
/**************[ END HELP FUNCTIONS ]******************/
+do_hook('help_top', $null);
-
-echo html_tag( 'table',
- html_tag( 'tr',
- html_tag( 'td','' . _("Help") .'', 'center', $color[0] )
- ) ,
- 'center', '', 'width="95%" cellpadding="1" cellspacing="2" border="0"' );
-
-do_hook("help_top");
-
-echo html_tag( 'table', '', 'center', '', 'width="90%" cellpadding="0" cellspacing="10" border="0"' ) .
- html_tag( 'tr' ) .
- html_tag( 'td' );
-
-if (isset($_SERVER['HTTP_REFERER'])) {
- $ref = strtolower($_SERVER['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';
- } else if (strpos($ref, 'src/search')){
- $context = 'search';
- }
-}
-
if (!isset($squirrelmail_language)) {
$squirrelmail_language = 'en_US';
}
if (file_exists("../help/$squirrelmail_language")) {
- $help_exists = true;
$user_language = $squirrelmail_language;
} else if (file_exists('../help/en_US')) {
- $help_exists = true;
- echo "";
- printf (_("The help has not been translated to %s. It will be displayed in English instead."), $languages[$squirrelmail_language]['NAME']);
- echo '
';
+ error_box(_("Help is not available in the selected language. It will be displayed in English instead."));
+ echo '
';
$user_language = 'en_US';
} else {
- $help_exists = false;
- echo "
" .
- _("Some or all of the help documents are not present!").
- ''.
- '