diff --git a/lam/docs/modules-specification.htm b/lam/docs/modules-specification.htm index 074a184a..319c5b44 100644 --- a/lam/docs/modules-specification.htm +++ b/lam/docs/modules-specification.htm @@ -579,15 +579,13 @@ section 4. "Help entry syntax".
function get_PDF_Entries($scope)
+ style="font-weight: bold;">function get_PDF_Entries()

This function is called when a PDF is to be created.
-$scope is the account type -("user", "group", "host" at this time).
It returns the fields which are printed in the PDF file for the specified account type. At the monent there is no (easy) possibility for the user to decide which fields are to be displayed. Perhaps there diff --git a/lam/lib/baseModule.inc b/lam/lib/baseModule.inc index b3c53743..1d8ba526 100644 --- a/lam/lib/baseModule.inc +++ b/lam/lib/baseModule.inc @@ -439,7 +439,7 @@ class baseModule { * @param string $scope account type * @return array list of available fields for PDF output */ - function get_pdfFields($scope = 'user') { + function get_pdfFields() { return ((isset($this->meta['PDF_fields'])) ? $this->meta['PDF_fields'] : array()); } diff --git a/lam/lib/modules.inc b/lam/lib/modules.inc index 55b67fcd..efa21da5 100644 --- a/lam/lib/modules.inc +++ b/lam/lib/modules.inc @@ -362,12 +362,14 @@ function getHelp($module,$helpID,$scope='') { * @return array PDF entries */ function getAvailablePDFFields($scope) { - // create new account container if needed - if (! isset($_SESSION["profile_account_$scope"])) { - $_SESSION["profile_account_$scope"] = new accountContainer($scope, "profile_account_$scope"); + $mods = $_SESSION['config']->get_AccountModules($scope); + $return = array(); + for ($i = 0; $i < sizeof($mods); $i++) { + $module = new $mods[$i]($scope); + $return[$mods[$i]] = $module->get_pdfFields(); } - // get options - return $_SESSION["profile_account_$scope"]->getAvailablePDFFields(); + $return['main'] = array('dn'); + return $return; } /** @@ -1607,18 +1609,5 @@ class accountContainer { return $return; } - /** - * - * - * @return - */ - function getAvailablePDFFields() { - $return = array(); - foreach($this->module as $moduleName => $module) { - $return[$moduleName] = $module->get_pdfFields($this->type); - } - $return['main'] = array( 'dn'); - return $return; - } } ?>