*** empty log message ***
This commit is contained in:
parent
6592b0911c
commit
62f394d10a
|
@ -274,6 +274,25 @@ return <span style="font-weight: bold;">false</span>. If <span
|
|||
style="font-weight: bold;">true</span> is returned the next module
|
||||
page will be displayed.<br>
|
||||
<br>
|
||||
<h3>2.2.4. get_help</h3>
|
||||
<br>
|
||||
<table cellpadding="2" cellspacing="2" border="0"
|
||||
style="text-align: left; width: 300px; height: 30px;">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td
|
||||
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
|
||||
style="font-weight: bold;">function get_help($helpID)</span><br>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
This function is called when a page requests a help topic from this module.<br>
|
||||
<span style="font-weight: bold;">$scope</span> is the help identifier; it must only contain a-z, A-Z, 0-9
|
||||
-, . and _.<br>
|
||||
It must return the help entry as array for the submitted help identifier. The format of the array to be returned is described in section 4. "Help entry syntax".<br>
|
||||
<br>
|
||||
<h3><br>
|
||||
</h3>
|
||||
<h2>3. Meta HTML code</h2>
|
||||
|
@ -395,9 +414,32 @@ example", "td" => array("colspan" => 3))<br>
|
|||
)<br>
|
||||
</code><br>
|
||||
<br>
|
||||
<h3><br>
|
||||
</h3>
|
||||
<h2>4. Help entry syntax</h2>
|
||||
The array that is returned by the get_help function must follow the below described syntax.
|
||||
Fields marked <b>REQUIRED</b> are neccessary under any circumstances. Fields marked
|
||||
<b>OPTIONAL</b> may be left out when not needed.<br>
|
||||
There are basically two different types of help entries that can be used. Internal help entries, that
|
||||
means the headline, text, etc is included in the help entry or external help entries, that means the help
|
||||
entry has only a reference pointing to a HTML/PHP page that offers the help entry. <br>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<h3><br>
|
||||
</h3>
|
||||
<h2>4.1. Internal help entries</h2>
|
||||
<span style="font-weight: bold;">ext</span> <span style="font-style: italic;">(REQUIRED)</span>
|
||||
<br>Must be <b>FALSE</b> in this case.
|
||||
<br><br>
|
||||
<span style="font-weight: bold;">Headline</span> <span style="font-style: italic;">(REQUIRED)</span>
|
||||
<br>The headline of this help entry. Can consist of any alpha-numeric characters. No HTML/CSS
|
||||
elements are not allowed here.
|
||||
<br><br>
|
||||
<span style="font-weight: bold;">Text</span> <span style="font-style: italic;">(REQUIRED)</span>
|
||||
<br>The text of this help entry. Can constist if any alpha-numeric characters and can contain
|
||||
placeholder for variables passed to this help entry. The placeholder must follow the syntax for
|
||||
placeholder defined by the PHP <b>printf</b> function. HTML/CSS elements are allowed here as long
|
||||
as they follow the XHTML1.0 Strict specification.
|
||||
<br><br>
|
||||
<br>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -188,6 +188,11 @@ function checkProfileOptions($scope, $options) {
|
|||
return $return;
|
||||
}
|
||||
|
||||
// get the single help entry array for help identifier $helpID from module $module
|
||||
function getHelp($module,$helpID) {
|
||||
return call_user_func(array($module, "get_help"), $helpID);
|
||||
}
|
||||
|
||||
|
||||
class accountContainer {
|
||||
// Constructor
|
||||
|
|
|
@ -56,56 +56,68 @@ function echoHTMLFoot()
|
|||
}
|
||||
|
||||
/* Print help site */
|
||||
function displayHelp($helpNumber)
|
||||
{
|
||||
global $helpArray;
|
||||
/* If no help number was submitted print error message */
|
||||
if($helpNumber == "")
|
||||
{
|
||||
$errorMessage = _("Sorry no help number submitted.");
|
||||
echoHTMLHead();
|
||||
statusMessage("ERROR","",$errorMessage);
|
||||
echoHTMLFoot();
|
||||
}
|
||||
/* If submitted help number is not in help/help.inc print error message */
|
||||
elseif(!array_key_exists($helpNumber,$helpArray))
|
||||
{
|
||||
$variables = array();
|
||||
array_push($variables,$helpNumber);
|
||||
$errorMessage = _("Sorry this help number ({bold}%d{endbold}) is not available.");
|
||||
echoHTMLHead();
|
||||
statusMessage("ERROR","",$errorMessage,$variables);
|
||||
echoHTMLFoot();
|
||||
}
|
||||
/* Print help site out of $helpArray */
|
||||
elseif($helpArray[$helpNumber]["ext"] == "FALSE")
|
||||
{
|
||||
echoHTMLHead();
|
||||
echo " <h1 class=\"help\">" . $helpArray[$helpNumber]['Headline'] . "</h1>\n";
|
||||
$format = " <p class=\"help\">" . $helpArray[$helpNumber]['Text'] . "</p>\n";
|
||||
printf($format,$helpArray[$helpNumber]['variables'][0],$helpArray[$helpNumber]['variables'][1],$helpArray[$helpNumber]['variables'][2],$helpArray[$helpNumber]['variables'][3],$helpArray[$helpNumber]['variables'][4],$helpArray[$helpNumber]['variables'][5],$helpArray[$helpNumber]['variables'][6],$helpArray[$helpNumber]['variables'][7],$helpArray[$helpNumber]['variables'][8],$helpArray[$helpNumber]['variables'][9]);
|
||||
//echo " <p class=\"help\">" . $helpArray[$helpNumber]['Text'] . "</p>\n";
|
||||
if($helpArray[$helpNumber]["SeeAlso"] <> "")
|
||||
{
|
||||
echo " <p class=\"help\">" . _("See also") . ": " . $helpArray[$helpNumber]['SeeAlso'] . "</p>\n";
|
||||
}
|
||||
echoHTMLFoot();
|
||||
}
|
||||
function displayHelp($helpEntry) {
|
||||
/* Load external help page */
|
||||
elseif($helpArray[$helpNumber]["ext"] == "TRUE")
|
||||
if($helpEntry["ext"] == "TRUE")
|
||||
{
|
||||
echoHTMLHead();
|
||||
include_once("../help/" . $helpArray[$helpNumber]["Link"]);
|
||||
include_once("../help/" . $helpEntry["Link"]);
|
||||
echoHTMLFoot();
|
||||
}
|
||||
/* Print empty page in all other cases */
|
||||
/* Print help site out of $helpEntry */
|
||||
else
|
||||
{
|
||||
$helpVariables = array();
|
||||
while($current = current($helpEntry['variables'])) {
|
||||
array_push($helpVariables,$current);
|
||||
next($helpEntry['variables']);
|
||||
}
|
||||
echoHTMLHead();
|
||||
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);
|
||||
if($helpEntry["SeeAlso"] <> "")
|
||||
{
|
||||
echo " <p class=\"help\">" . _("See also") . ": " . $helpEntry['SeeAlso'] . "</p>\n";
|
||||
}
|
||||
echoHTMLFoot();
|
||||
}
|
||||
}
|
||||
|
||||
displayHelp($_GET['HelpNumber']);
|
||||
/* 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))
|
||||
{
|
||||
$variables = array();
|
||||
array_push($variables,$_GET['HelpNumber']);
|
||||
$errorMessage = _("Sorry this help number ({bold}%d{endbold}) is not available.");
|
||||
echoHTMLHead();
|
||||
statusMessage("ERROR","",$errorMessage,$variables);
|
||||
echoHTMLFoot();
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
$helpEntry = $helpArray[$_GET['HelpNumber']];
|
||||
}
|
||||
}
|
||||
|
||||
displayHelp($helpEntry);
|
||||
|
||||
?>
|
Loading…
Reference in New Issue