forked from phppgadmin/phppgadmin
-
Notifications
You must be signed in to change notification settings - Fork 1
/
help.php
88 lines (64 loc) · 1.56 KB
/
help.php
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
<?php
/**
* Help page redirection/browsing.
*
* $Id: help.php,v 1.3 2006/12/31 16:21:26 soranzo Exp $
*/
// Include application functions
include_once('./libraries/lib.inc.php');
$action = (isset($_REQUEST['action'])) ? $_REQUEST['action'] : '';
function doDefault() {
global $data, $lang;
if (isset($_REQUEST['help'])) {
$url = $data->getHelp($_REQUEST['help']);
if (is_array($url)) {
doChoosePage($url);
return;
}
if ($url) {
header("Location: $url");
exit;
}
}
doBrowse($lang['strinvalidhelppage']);
}
function doBrowse($msg = '') {
global $misc, $data, $lang;
$misc->printHeader($lang['strhelppagebrowser']);
$misc->printBody();
$misc->printTitle($lang['strselecthelppage']);
echo $misc->printMsg($msg);
echo "<dl>\n";
$pages = $data->getHelpPages();
foreach ($pages as $page => $dummy) {
echo "<dt>{$page}</dt>\n";
$urls = $data->getHelp($page);
if (!is_array($urls)) $urls = array($urls);
foreach ($urls as $url) {
echo "<dd><a href=\"{$url}\">{$url}</a></dd>\n";
}
}
echo "</dl>\n";
$misc->printFooter();
}
function doChoosePage($urls) {
global $misc, $lang;
$misc->printHeader($lang['strhelppagebrowser']);
$misc->printBody();
$misc->printTitle($lang['strselecthelppage']);
echo "<ul>\n";
foreach($urls as $url) {
echo "<li><a href=\"{$url}\">{$url}</a></li>\n";
}
echo "</ul>\n";
$misc->printFooter();
}
switch ($action) {
case 'browse':
doBrowse();
break;
default:
doDefault();
break;
}
?>