LDAPAccountManager/lam/templates/help.php

124 lines
3.4 KiB
PHP
Raw Normal View History

2003-05-07 20:07:25 +00:00
<?php
/*
$Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 Michael Duergner
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
LDAP Account Manager display help pages.
2003-05-07 20:07:25 +00:00
*/
2003-06-07 15:00:06 +00:00
include_once("../lib/ldap.inc");
include_once("../lib/config.inc");
2003-05-07 20:07:25 +00:00
session_save_path("../sess"); // Set session save path
@session_start(); // Start LDAP Account Manager session
include_once("../lib/status.inc"); // Include lib/status.php which provides statusMessage()
include_once("../help/help.inc"); // Include help/help.inc which provides $helpArray where the help pages are stored
2003-09-21 20:29:19 +00:00
setlanguage();
/* Print HTML head */
function echoHTMLHead()
{
echo $_SESSION['header'];
?>
<title>LDAP Account Manager Help Center</title>
<link rel="stylesheet" type="text/css" href="../style/layout.css">
</head>
<body>
<?php
}
/* Print HTML foot */
function echoHTMLFoot()
{
?>
</body>
</html>
<?php
}
/* Print help site */
2004-03-15 16:30:52 +00:00
function displayHelp($helpEntry) {
/* Load external help page */
if($helpEntry["ext"] == "TRUE")
{
echoHTMLHead();
2004-03-15 16:30:52 +00:00
include_once("../help/" . $helpEntry["Link"]);
echoHTMLFoot();
}
2004-03-15 16:30:52 +00:00
/* Print help site out of $helpEntry */
else
{
2004-03-15 16:30:52 +00:00
$helpVariables = array();
2004-03-15 16:56:37 +00:00
while($current = current($helpEntry['Variables'])) {
2004-03-15 16:30:52 +00:00
array_push($helpVariables,$current);
next($helpEntry['variables']);
}
echoHTMLHead();
2004-03-15 16:30:52 +00:00
echo " <h1 class=\"help\">" . $helpEntry['Headline'] . "</h1>\n";
$format = " <p class=\"help\">" . $helpEntry['Text'] . "</p>\n";
array_unshift($helpVariables,$format);
call_user_func_array("printf",$helpVariables);
2004-03-15 16:56:37 +00:00
while($current = current($helpEntry["SeeAlso"]))
{
2004-03-15 16:56:37 +00:00
echo " <p class=\"help\">" . ((isset($current['link']) ? "<a class=\"helpSeeAlso\" href=\"" . $current['link']"\">" : "") . _("See also") . ": " . $current['text'] . ((isset($current['link'])) ? "</a>" : "") . "</p>\n";
next($helpEntry["SeeAlso"]);
}
echoHTMLFoot();
}
2004-03-15 16:30:52 +00:00
}
/* If no help number was submitted print error message */
if(!isset($_GET['HelpNumber']))
{
$errorMessage = _("Sorry no help number submitted.");
echoHTMLHead();
statusMessage("ERROR","",$errorMessage);
echoHTMLFoot();
exit;
}
$helpEntry = array();
if(isset[$_GET['Module']) {
include_once("../lib/modules.inc");
$helpEntry = getHelp($_GET['Module'],$_GET['HelpNumber']);
}
else {
/* If submitted help number is not in help/help.inc print error message */
if(!array_key_exists($_GET['HelpNumber'],$helpArray))
{
2004-03-15 16:30:52 +00:00
$variables = array();
array_push($variables,$_GET['HelpNumber']);
$errorMessage = _("Sorry this help number ({bold}%d{endbold}) is not available.");
echoHTMLHead();
2004-03-15 16:30:52 +00:00
statusMessage("ERROR","",$errorMessage,$variables);
echoHTMLFoot();
2004-03-15 16:30:52 +00:00
exit;
}
2004-03-15 16:30:52 +00:00
else {
$helpEntry = $helpArray[$_GET['HelpNumber']];
}
}
2004-03-15 16:30:52 +00:00
displayHelp($helpEntry);
2004-03-15 16:30:52 +00:00
?>