File: help.php

package info (click to toggle)
horde2 2.2.8-1sarge3
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 3,832 kB
  • ctags: 2,897
  • sloc: php: 12,784; sh: 954; sql: 149; makefile: 104; perl: 97; xml: 24; pascal: 6
file content (54 lines) | stat: -rw-r--r-- 1,951 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
 * $Horde: horde/help.php,v 2.41.2.13 2005/01/03 11:25:44 jan Exp $
 *
 * Copyright 1999-2005 Jon Parise <jon@horde.org>
 *
 * See the enclosed file COPYING for license information (LGPL). If you
 * did not receive this file, see http://www.fsf.org/copyleft/lgpl.html.
 */

define('HORDE_BASE', dirname(__FILE__));
require_once HORDE_BASE . '/lib/base.php';
require_once HORDE_BASE . '/lib/Help.php';

$title = _("Help");
$js_onLoad = null;
$show = strtolower(Horde::getFormData('show', 'index'));
$module = strtolower(basename(Horde::getFormData('module', 'horde')));
$topic = Horde::getFormData('topic');

$help_file          = $registry->getParam('fileroot', $module) . "/locale/$language/help.xml";
$help_file_fallback = $registry->getParam('fileroot', $module) . "/locale/en_US/help.xml";

if ($show == 'index') {
    include HORDE_TEMPLATES . '/help/index.inc';
} else {
    include HORDE_TEMPLATES . '/common-header.inc';
    if ($show == 'menu') {
        include HORDE_TEMPLATES . '/help/menu.inc';
    } else {
        include HORDE_TEMPLATES . '/help/header.inc';

        $help = new Help(HELP_SOURCE_FILE, array($help_file, $help_file_fallback));
        if (($show == 'entry') && !empty($topic)) {
            $help->lookup($topic);
            $help->display();
        } else {
            $topics = $help->topics();
            foreach ($topics as $id => $title) {
                $link = Horde::url($registry->getParam('webroot', 'horde') . '/help.php');
                $link = Horde::addParameter($link, 'show=entry');
                $link = Horde::addParameter($link, 'module=' . $module);
                $link = Horde::addParameter($link, 'topic=' . $id);
                Horde::plink($link, '', 'helpitem');
                echo $title . "</a><br />\n";
            }
        }
        $help->cleanup();

        include HORDE_TEMPLATES . '/help/footer.inc';
    }
}

require HORDE_TEMPLATES . '/common-footer.inc';