- if ($context == 'compose'){
- $chapter = 4;
- } else if ($context == 'address'){
- $chapter = 5;
- } else if ($context == 'folders'){
- $chapter = 6;
- } else if ($context == 'options'){
- $chapter = 7;
- } else if ($context == 'index'){
- $chapter = 2;
- } else if ($context == 'read'){
- $chapter = 3;
- } else if ($context == 'search'){
- $chapter = 8;
+}
+
+if ( $chapter == 0 || !isset( $helpdir[$chapter-1] ) ) {
+ echo html_tag( 'table', '', 'center', '', 'cellpadding="0" cellspacing="0" border="0"' );
+ html_tag( 'tr' ) .
+ html_tag( 'td' ) .
+ '<b><center>' . _("Table of Contents") . '</center></b><br>';
+ do_hook('help_chapter');
+ echo html_tag( 'ol' );
+ for ($i=0, $cnt = count($helpdir); $i < $cnt; $i++) {
+ $doc = file("../help/$user_language/$helpdir[$i]");
+ $help_info = get_info($doc, 0);
+ echo '<li><a href="../src/help.php?chapter=' . ($i+1)
+ . '">' . $help_info[0] . '</a>' .
+ html_tag( 'ul', $help_info[2] );
+ }
+ echo '</ol></td></tr></table>';
+} else {
+ $doc = file("../help/$user_language/" . $helpdir[$chapter-1]);
+ $help_info = get_info($doc, 0);
+ echo '<small><center>';
+ if ($chapter <= 1){
+ echo '<font color="' . $color[9] . '">' . _("Previous")
+ . '</font> | ';
+ } else {
+ echo '<a href="../src/help.php?chapter=' . ($chapter-1)
+ . '">' . _("Previous") . '</a> | ';