fixed reading of possible PDF entries
This commit is contained in:
parent
697893fbc0
commit
47d857ba81
|
@ -579,15 +579,13 @@ section 4. "Help entry syntax".<br>
|
|||
<tbody>
|
||||
<tr>
|
||||
<td style="vertical-align: top; text-align: center;"><span
|
||||
style="font-weight: bold;">function get_PDF_Entries($scope)</span><br>
|
||||
style="font-weight: bold;">function get_PDF_Entries()</span><br>
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<br>
|
||||
This function is called when a PDF is to be created.<br>
|
||||
<span style="font-weight: bold;">$scope</span> is the account type
|
||||
("user", "group", "host" at this time).<br>
|
||||
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
|
||||
|
|
|
@ -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());
|
||||
}
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
Loading…
Reference in New Issue