152 lines
4.9 KiB
HTML
152 lines
4.9 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html>
|
|
<head>
|
|
<title>Module HowTo - PDF output</title>
|
|
<link rel="stylesheet" type="text/css" href="style/layout.css">
|
|
</head>
|
|
<body>
|
|
|
|
<p align="center">
|
|
<script type="text/javascript"><!--
|
|
google_ad_client = "pub-4179059556107138";
|
|
google_alternate_ad_url = "http://lam.sourceforge.net/google_adsense_script.html";
|
|
google_ad_width = 728;
|
|
google_ad_height = 90;
|
|
google_ad_format = "728x90_as";
|
|
google_ad_type = "text_image";
|
|
google_ad_channel ="";
|
|
google_page_url = document.location;
|
|
google_color_border = "EEEEEE";
|
|
google_color_bg = "FFFFFF";
|
|
google_color_link = "0000FF";
|
|
google_color_url = "008000";
|
|
google_color_text = "000000";
|
|
//--></script>
|
|
<script type="text/javascript"
|
|
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
|
</script>
|
|
</p>
|
|
|
|
|
|
<div style="text-align: center;">
|
|
<h1>Module HowTo - PDF output<br>
|
|
</h1>
|
|
<br>
|
|
<br>
|
|
<div style="text-align: left;"><br>
|
|
<h2>1. Defining possible PDF values<br>
|
|
</h2>
|
|
The first step to PDF output is defining what values your module
|
|
provides. This is needed for the PDF editor, otherwise the user will
|
|
not be able to select values from your module.<br>
|
|
<br>
|
|
The PDF values are specified with <span style="font-weight: bold;">get_pdfFields()</span>
|
|
or <span style="font-weight: bold;">meta['PDF_fields']</span>.<br>
|
|
<br>
|
|
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br
|
|
style="font-weight: bold; text-decoration: underline;">
|
|
<br>
|
|
The <span style="font-style: italic;">ieee802Device</span>
|
|
module has only one attribute and therefore one PDF value: the MAC
|
|
address.<br>
|
|
<br>
|
|
<table style="width: 100%; text-align: left;" class="mod-code"
|
|
border="0" cellpadding="2" cellspacing="2">
|
|
<tbody>
|
|
<tr>
|
|
<td style="vertical-align: top;"> /**<br>
|
|
* Returns meta data that is interpreted by parent
|
|
class<br>
|
|
*<br>
|
|
* @return array array with meta data<br>
|
|
*/<br>
|
|
<span style="font-weight: bold;">function</span>
|
|
get_metaData() {<br>
|
|
$return = array();<br>
|
|
[...]<br>
|
|
// available PDF fields<br>
|
|
<span style="color: rgb(255, 0, 0);">
|
|
$return['PDF_fields'] = array(</span><br
|
|
style="color: rgb(255, 0, 0);">
|
|
<span style="color: rgb(255, 0, 0);">
|
|
'macAddress'</span><br
|
|
style="color: rgb(255, 0, 0);">
|
|
<span style="color: rgb(255, 0, 0);">
|
|
);</span><br style="color: rgb(255, 0, 0);">
|
|
return $return;<br>
|
|
}<br>
|
|
<br>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<br>
|
|
<br>
|
|
<h2>2. Providing data to put into the PDF file<br>
|
|
</h2>
|
|
When the user wants to create a PDF file the LDAP account is loaded and
|
|
you module is asked for data to put into the PDF file.<br>
|
|
<br>
|
|
This is done with <span style="font-weight: bold;">get_pdfEntries()</span>.<br>
|
|
<br>
|
|
<span style="font-weight: bold; text-decoration: underline;">Example:</span><br
|
|
style="font-weight: bold; text-decoration: underline;">
|
|
<br>
|
|
The <span style="font-style: italic;">ieee802Device</span>
|
|
module will return the MAC address list of the account.<br>
|
|
<br>
|
|
<table style="width: 100%; text-align: left;" class="mod-code"
|
|
border="0" cellpadding="2" cellspacing="2">
|
|
<tbody>
|
|
<tr>
|
|
<td style="vertical-align: top;"> /**<br>
|
|
* Returns a list of PDF entries<br>
|
|
*/<br>
|
|
function get_pdfEntries() {<br>
|
|
$return = array();<br>
|
|
if
|
|
(sizeof($this->attributes['macAddress']) > 0) {<br>
|
|
|
|
$return['ieee802Device_macAddress'] = '<block><key>' .
|
|
_('MAC address list') . '</key><value>' . implode(', ',
|
|
$this->attributes['macAddress']) . '</value></block>';<br>
|
|
}<br>
|
|
return $return;<br>
|
|
}<br>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<br>
|
|
<span style="font-weight: bold;"></span>
|
|
<h2><span style="font-weight: bold;"></span></h2>
|
|
</div>
|
|
</div>
|
|
|
|
<p align="center">
|
|
<script type="text/javascript"><!--
|
|
google_ad_client = "pub-4179059556107138";
|
|
google_alternate_ad_url = "http://lam.sourceforge.net/google_adsense_script.html";
|
|
google_ad_width = 728;
|
|
google_ad_height = 90;
|
|
google_ad_format = "728x90_as";
|
|
google_ad_type = "text_image";
|
|
google_ad_channel ="";
|
|
google_page_url = document.location;
|
|
google_color_border = "EEEEEE";
|
|
google_color_bg = "FFFFFF";
|
|
google_color_link = "0000FF";
|
|
google_color_url = "008000";
|
|
google_color_text = "000000";
|
|
//--></script>
|
|
<script type="text/javascript"
|
|
src="http://pagead2.googlesyndication.com/pagead/show_ads.js">
|
|
</script>
|
|
</p>
|
|
|
|
</body>
|
|
</html>
|