X-Git-Url: https://vcs.fsf.org/?a=blobdiff_plain;f=src%2Fhelp.php;h=99671fbece74f26eb7b7e3057eb99d7ab0bec777;hb=3a85cfb8d54434a889f7782b0d79985408f965d0;hp=7b65faee71a914b183b9ccd38898762053ccb9c2;hpb=c9062c05d957b48de56d8323a2c8b841cc57ca8d;p=squirrelmail.git diff --git a/src/help.php b/src/help.php index 7b65faee..99671fbe 100644 --- a/src/help.php +++ b/src/help.php @@ -11,10 +11,14 @@ * $Id$ */ -require_once('../src/validate.php'); -require_once('../functions/display_messages.php'); -require_once('../functions/imap.php'); -require_once('../functions/array.php'); +/* Path for SquirrelMail required files. */ +define('SM_PATH','../'); + +/* 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'); displayPageHeader($color, 'None' ); @@ -37,6 +41,7 @@ $helpdir[8] = 'FAQ.hlp'; */ function get_info($doc, $pos) { + for ($n=$pos; $n < count($doc); $n++) { if (trim(strtolower($doc[$n])) == '' || trim(strtolower($doc[$n])) == '
') { @@ -66,41 +71,39 @@ function get_info($doc, $pos) { } if (isset($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] = $ary[0]; + $ary[2] = $ary[0]; } + 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; + + $ary[0] = _("ERROR: Help files are not in the right format!"); + $ary[1] = $ary[0]; + + return( $ary ); } /**************[ END HELP FUNCTIONS ]******************/ -?> -
- - - - -
-
-
- - - - - -
-' . _("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')){ @@ -136,7 +139,7 @@ if (file_exists("../help/$squirrelmail_language")) { echo "
" . _("Some or all of the help documents are not present!"). '
'. - '
'; + ''; /* this is really silly, because there may be some * footers. What about them. * TODO: Fix this so it's not just "exit". @@ -162,19 +165,25 @@ if ($help_exists == true) { $chapter = 3; } else if ($context == 'search'){ $chapter = 8; + } else if ( isset( $_GET['chapter'] ) ) { + $chapter = intval( $_GET['chapter']); + } else { + $chapter = 0; } - if (!isset($chapter)) { - echo '
' . - '
' . _("Table of Contents") . '

'; + if ( $chapter == 0 || !isset( $helpdir[$chapter-1] ) ) { + echo html_tag( 'table', '', 'center', '', 'cellpadding="0" cellspacing="0" border="0"' ); + html_tag( 'tr' ) . + html_tag( 'td' ) . + '
' . _("Table of Contents") . '

'; do_hook('help_chapter'); - echo '
    '; + echo html_tag( 'ol' ); for ($i=0; $i < count($helpdir); $i++) { $doc = file("../help/$user_language/$helpdir[$i]"); $help_info = get_info($doc, 0); echo '
  1. ' . $help_info[0] . ''; - echo '
      ' . $help_info[2] . '
    '; + . '">' . $help_info[0] . '' . + html_tag( 'ul', $help_info[2] ); } echo '
'; } else { @@ -190,7 +199,7 @@ if ($help_exists == true) { } echo '' . _("Table of Contents") . ''; if ($chapter >= count($helpdir)){ - echo ' | ' . _("Next") . ''; + echo ' | ' . _("Next") . ''; } else { echo ' | ' . _("Next") . ''; @@ -202,17 +211,15 @@ if ($help_exists == true) { if (isset($help_info[1])){ echo $help_info[1]; } else { - echo '

' . $help_info[2] . '

'; + echo html_tag( 'p', $help_info[2], 'left' ); } $section = 0; for ($n = $help_info[3]; $n < count($doc); $n++) { $section++; $help_info = get_info($doc, $n); - echo "$chapter.$section - $help_info[0]"; - echo ''; + echo "$chapter.$section - $help_info[0]" . + html_tag( 'ul', $help_info[1] ); $n = $help_info[3]; } @@ -220,6 +227,9 @@ if ($help_exists == true) { } } do_hook('help_bottom'); + +echo html_tag( 'tr', + html_tag( 'td', ' ', 'left', $color[0] ) + ). + ''; ?> -  -