diff --git a/lam/help/help.inc b/lam/help/help.inc
index 989cd47b..dcf1f744 100644
--- a/lam/help/help.inc
+++ b/lam/help/help.inc
@@ -4,7 +4,7 @@ $Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
Copyright (C) 2003 - 2006 Michael Duergner
- 2003 - 2007 Roland Gruber
+ 2003 - 2009 Roland Gruber
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
@@ -31,8 +31,6 @@ $Id$
* @package Help
*/
-setlanguage();
-
// generate help entry for translated list attributes
$types = getTypes();
$entry206Example = "";
diff --git a/lam/lib/lists.inc b/lam/lib/lists.inc
index 21bfaa28..ebed436a 100644
--- a/lam/lib/lists.inc
+++ b/lam/lib/lists.inc
@@ -3,7 +3,7 @@
$Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
- Copyright (C) 2003 - 2008 Roland Gruber
+ Copyright (C) 2003 - 2009 Roland Gruber
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
@@ -736,6 +736,7 @@ class lamList {
echo "type . ".css\">\n";
echo "
\n";
$tabindex = 0;
- $tabindexLink = 0;
for ($i = 0; $i < sizeof($this->configOptions); $i++) {
- parseHtml('main', $this->configOptions[$i]->getMetaHTML(), array(), true, $tabindex, $tabindexLink, $this->type);
+ parseHtml('', $this->configOptions[$i]->getMetaHTML(), array(), true, $tabindex, $this->type);
}
echo " ";
diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc
index 71ba32f8..a661e258 100644
--- a/lam/lib/modules.inc
+++ b/lam/lib/modules.inc
@@ -3,7 +3,7 @@
$Id$
This code is part of LDAP Account Manager (http://www.sourceforge.net/projects/lam)
- Copyright (C) 2003 - 2007 Roland Gruber
+ Copyright (C) 2003 - 2009 Roland Gruber
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
@@ -337,6 +337,12 @@ function checkConfigOptions($scopes, $options) {
* @return array help entry
*/
function getHelp($module,$helpID,$scope='') {
+ if (!isset($module) || ($module == '') || ($module == 'main')) {
+ $helpPath = "../help/help.inc";
+ if (is_file("../../help/help.inc")) $helpPath = "../../help/help.inc";
+ include_once($helpPath);
+ return $helpArray[$helpID];
+ }
$moduleObject = new $module((($scope != '') ? $scope : 'none'));
return $moduleObject->get_help($helpID);
}
@@ -670,11 +676,10 @@ function getRequiredExtensions() {
* @param array $values List of values which override the defaults in $input (name => value)
* @param boolean $restricted If true then no buttons will be displayed
* @param integer $tabindex Start value of tabulator index for input fields
-* @param integer $tabindexLink Start value of tabulator index for links
* @param string $scope Account type
* @return array List of input field names and their type (name => type)
*/
-function parseHtml($module, $input, $values, $restricted, &$tabindex, &$tabindexLink, $scope) {
+function parseHtml($module, $input, $values, $restricted, &$tabindex, $scope) {
$ret = array();
if (is_array($input)) {
echo "
\n";
@@ -761,7 +766,7 @@ function parseHtml($module, $input, $values, $restricted, &$tabindex, &$tabindex
case 'fieldset':
echo "\n";
break;
@@ -829,17 +834,13 @@ function parseHtml($module, $input, $values, $restricted, &$tabindex, &$tabindex
break;
// sub table
case 'table':
- $retTemp = parseHtml($module, $input[$i][$j]['value'], $values, $restricted, $tabindex, $tabindexLink, $scope);
+ $retTemp = parseHtml($module, $input[$i][$j]['value'], $values, $restricted, $tabindex, $scope);
$ret = array_merge($ret, $retTemp);
break;
// help link
case 'help':
- $helpPath = "../";
- if (is_file("./help.php")) $helpPath = "";
- echo "";
- echo "";
- echo "\n";
- $tabindexLink++;
+ $helpEntry = getHelp($module, $input[$i][$j]['value'], $scope);
+ printHelpLink($helpEntry, $input[$i][$j]['value'], $module, $scope);
break;
// status message
case 'message':
@@ -868,6 +869,30 @@ function parseHtml($module, $input, $values, $restricted, &$tabindex, &$tabindex
return $ret;
}
+/**
+ * Prints a LAM help link.
+ *
+ * @param array $entry help entry
+ * @param String $number help number
+ * @param String $module module name
+ * @param String $scope account scope
+ */
+function printHelpLink($entry, $number, $module='', $scope='') {
+ $helpPath = "../";
+ if (is_file("./help.php")) $helpPath = "";
+ $title = $entry['Headline'];
+ $message = $entry['Text'];
+ // if help message contains special characters then point to help page
+ if (!(strpos($message, '"') === false) || !(strpos($message, "'") === false) || !(strpos($message, "\n") === false)) {
+ $message = _('Please click on the icon to view the help text.');
+ }
+ echo "";
+ echo "";
+ echo "";
+}
+
/**
* This class includes all modules and attributes of an account.
@@ -1137,8 +1162,7 @@ class accountContainer {
$return = call_user_func(array($this->module[$this->order[$this->current_page]], 'display_html_'.$this->subpage));
$y = 5000;
- $z = 10000;
- parseHtml($this->order[$this->current_page], $return, array(), false, $y, $z, $this->type);
+ parseHtml($this->order[$this->current_page], $return, array(), false, $y, $this->type);
// Display rest of html-page
echo " *" . _('required');
echo "