function to display simple PDF fields
This commit is contained in:
parent
0676b9528a
commit
981cf628a8
|
@ -3,7 +3,7 @@
|
|||
$Id$
|
||||
|
||||
This code is part of LDAP Account Manager (http://www.ldap-account-manager.org/)
|
||||
Copyright (C) 2003 - 2012 Roland Gruber
|
||||
Copyright (C) 2003 - 2013 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
|
||||
|
@ -824,6 +824,26 @@ abstract class baseModule {
|
|||
return array();
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a simple PDF entry to the given array.
|
||||
*
|
||||
* @param array $result result array (entry will be added here)
|
||||
* @param String $name ID
|
||||
* @param String $label label name
|
||||
* @param String $attrName attribute name (default: =$name)
|
||||
* @param String $delimiter delimiter if multiple attribute values exist
|
||||
*/
|
||||
protected function addSimplePDFField(&$result, $name, $label, $attrName = null, $delimiter = ', ') {
|
||||
if ($attrName == null) {
|
||||
$attrName = $name;
|
||||
}
|
||||
$value = '';
|
||||
if (isset($this->attributes[$attrName]) && (sizeof($this->attributes[$attrName]) > 0)) {
|
||||
$value = implode($delimiter, $this->attributes[$attrName]);
|
||||
}
|
||||
$result[get_class($this) . '_' . $name] = array('<block><key>' . $label . '</key><value>' . $value . '</value></block>');
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns an array containing all input columns for the file upload.
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue