moved profile functions to non-static because they need the cache

This commit is contained in:
Roland Gruber 2004-04-03 14:43:40 +00:00
parent 06263f5b61
commit 2f160db0ae
1 changed files with 155 additions and 130 deletions

View File

@ -1,8 +1,8 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <html>
<head> <head>
<meta http-equiv="content-type" <meta content="text/html; charset=ISO-8859-15"
content="text/html; charset=ISO-8859-15"> http-equiv="content-type">
<title>Module specification</title> <title>Module specification</title>
</head> </head>
<body> <body>
@ -28,8 +28,8 @@ allowed to call other static functions.<br>
</h3> </h3>
<h3>2.1.1. can_manage</h3> <h3>2.1.1. can_manage</h3>
<br> <br>
<table style="text-align: left; width: 300px;" border="0" <table cellpadding="2" cellspacing="2" border="0"
cellspacing="2" cellpadding="2"> style="text-align: left; width: 300px;">
<tbody> <tbody>
<tr> <tr>
<td <td
@ -49,8 +49,8 @@ the account type ("user", "group", "host" at this time).<br>
<br> <br>
<h3>2.1.2. get_alias</h3> <h3>2.1.2. get_alias</h3>
<br> <br>
<table cellpadding="2" cellspacing="2" border="0" <table style="text-align: left; width: 300px;" border="0"
style="text-align: left; width: 300px;"> cellspacing="2" cellpadding="2">
<tbody> <tbody>
<tr> <tr>
<td <td
@ -71,8 +71,8 @@ the account type ("user", "group", "host" at this time).<br>
<br> <br>
<h3>2.1.3. is_base_module</h3> <h3>2.1.3. is_base_module</h3>
<br> <br>
<table cellpadding="2" cellspacing="2" border="0" <table style="text-align: left; width: 300px; height: 30px;" border="0"
style="text-align: left; width: 300px; height: 30px;"> cellspacing="2" cellpadding="2">
<tbody> <tbody>
<tr> <tr>
<td <td
@ -96,8 +96,8 @@ quota module is no base module as it needs posixAccount.<br>
<br> <br>
<h3>2.1.4. get_ldap_filter</h3> <h3>2.1.4. get_ldap_filter</h3>
<br> <br>
<table cellpadding="2" cellspacing="2" border="0" <table style="text-align: left; width: 300px; height: 30px;" border="0"
style="text-align: left; width: 300px; height: 30px;"> cellspacing="2" cellpadding="2">
<tbody> <tbody>
<tr> <tr>
<td <td
@ -125,8 +125,8 @@ implement it.</span><br>
<br> <br>
<h3>2.1.5. get_dependencies</h3> <h3>2.1.5. get_dependencies</h3>
<br> <br>
<table style="text-align: left; width: 300px; font-weight: bold;" <table cellpadding="2" cellspacing="2" border="0"
border="0" cellspacing="2" cellpadding="2"> style="text-align: left; width: 300px; font-weight: bold;">
<tbody> <tbody>
<tr> <tr>
<td <td
@ -156,7 +156,92 @@ your module depends on one of these modules.<br>
=&gt; array("exim"));</span><br =&gt; array("exim"));</span><br
style="font-weight: bold; font-style: italic;"> style="font-weight: bold; font-style: italic;">
<br> <br>
<h3>2.1.6. get_profileOptions</h3> <br>
<h3>2.2. Class functions</h3>
<h3>2.2.1. Constructor</h3>
<br>
<table cellpadding="2" cellspacing="2" border="0"
style="text-align: left; width: 300px; height: 30px;">
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function &lt;module name&gt; ($base)</span><br>
</td>
</tr>
</tbody>
</table>
<br>
Every module needs a constructor that has an<span
style="font-style: italic;"> <span style="font-weight: bold;">account
container</span></span> as argument $base.<br>
With this account container you can interact with other modules and use
several helper functions.<br>
<br>
<h3>2.2.2. module_ready</h3>
<br>
<table cellpadding="2" cellspacing="2" border="0"
style="text-align: left; width: 300px; height: 30px;">
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function module_ready()</span><br>
</td>
</tr>
</tbody>
</table>
<br>
Your module might depend on input of other modules. This function
determines if the module button on the account page is active or not.<br>
The return value is <span style="font-weight: bold;">true</span> if
your module accepts input, otherwise <span style="font-weight: bold;">false</span>.<br>
<br>
<h3>2.2.3. module_complete</h3>
<br>
<table style="text-align: left; width: 300px; height: 30px;" border="0"
cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function module_complete()</span><br>
</td>
</tr>
</tbody>
</table>
<br>
This function is called after your module has processed the POST input
data.<br>
If there was an input error and you want to display a page again then
return <span style="font-weight: bold;">false</span>. If <span
style="font-weight: bold;">true</span> is returned the next module
page will be displayed.<br>
<br>
<h3>2.2.4. get_help</h3>
<br>
<table style="text-align: left; width: 300px; height: 30px;" border="0"
cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function get_help($helpID)</span><br>
</td>
</tr>
</tbody>
</table>
<br>
This function is called when a page requests a help topic from this
module.<br>
<span style="font-weight: bold;">$helpID</span> is the help identifier;
it must only contain a-z, A-Z, 0-9
-, . and _.<br>
It must return the help entry as array for the submitted help
identifier. The format of the array to be returned is described in
section 4. "Help entry syntax".<br>
<br>
<h3>2.1.5. get_profileOptions</h3>
<br> <br>
<table cellpadding="2" cellspacing="2" border="0" <table cellpadding="2" cellspacing="2" border="0"
style="text-align: left; width: 300px; height: 30px;"> style="text-align: left; width: 300px; height: 30px;">
@ -184,7 +269,7 @@ as keywords to load and save profiles. We recommend to use the module
name as prefix for them (e.g. posixAccount_homeDirectory) to avoid name as prefix for them (e.g. posixAccount_homeDirectory) to avoid
naming confilcts.<br> naming confilcts.<br>
<br> <br>
<h3>2.1.7. check_profileOptions</h3> <h3>2.1.6. check_profileOptions</h3>
<br> <br>
<table style="text-align: left; width: 400px; height: 30px;" border="0" <table style="text-align: left; width: 400px; height: 30px;" border="0"
cellspacing="2" cellpadding="2"> cellspacing="2" cellpadding="2">
@ -212,87 +297,6 @@ head, 2 =&gt; message text, 3 =&gt; additional variables).<br>
If no errors occured the function returns an empty array.<span If no errors occured the function returns an empty array.<span
style="font-weight: bold;"></span><br> style="font-weight: bold;"></span><br>
<br> <br>
<br>
<h3>2.2. Class functions</h3>
<h3>2.2.1. Constructor</h3>
<br>
<table style="text-align: left; width: 300px; height: 30px;" border="0"
cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function &lt;module name&gt; ($base)</span><br>
</td>
</tr>
</tbody>
</table>
<br>
Every module needs a constructor that has an<span
style="font-style: italic;"> <span style="font-weight: bold;">account
container</span></span> as argument $base.<br>
With this account container you can interact with other modules and use
several helper functions.<br>
<br>
<h3>2.2.2. module_ready</h3>
<br>
<table style="text-align: left; width: 300px; height: 30px;" border="0"
cellspacing="2" cellpadding="2">
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function module_ready()</span><br>
</td>
</tr>
</tbody>
</table>
<br>
Your module might depend on input of other modules. This function
determines if the module button on the account page is active or not.<br>
The return value is <span style="font-weight: bold;">true</span> if
your module accepts input, otherwise <span style="font-weight: bold;">false</span>.<br>
<br>
<h3>2.2.3. module_complete</h3>
<br>
<table cellpadding="2" cellspacing="2" border="0"
style="text-align: left; width: 300px; height: 30px;">
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function module_complete()</span><br>
</td>
</tr>
</tbody>
</table>
<br>
This function is called after your module has processed the POST input
data.<br>
If there was an input error and you want to display a page again then
return <span style="font-weight: bold;">false</span>. If <span
style="font-weight: bold;">true</span> is returned the next module
page will be displayed.<br>
<br>
<h3>2.2.4. get_help</h3>
<br>
<table cellpadding="2" cellspacing="2" border="0"
style="text-align: left; width: 300px; height: 30px;">
<tbody>
<tr>
<td
style="vertical-align: top; background-color: rgb(204, 204, 204); text-align: center;"><span
style="font-weight: bold;">function get_help($helpID)</span><br>
</td>
</tr>
</tbody>
</table>
<br>
This function is called when a page requests a help topic from this module.<br>
<span style="font-weight: bold;">$helpID</span> is the help identifier; it must only contain a-z, A-Z, 0-9
-, . and _.<br>
It must return the help entry as array for the submitted help identifier. The format of the array to be returned is described in section 4. "Help entry syntax".<br>
<br>
<h3><br> <h3><br>
</h3> </h3>
<h2>3. Meta HTML code</h2> <h2>3. Meta HTML code</h2>
@ -417,45 +421,66 @@ example", "td" =&gt; array("colspan" =&gt; 3))<br>
<h3><br> <h3><br>
</h3> </h3>
<h2>4. Help entry syntax</h2> <h2>4. Help entry syntax</h2>
The array that is returned by the get_help function must follow the below described syntax. The array that is returned by the get_help function must follow the
Fields marked <b>REQUIRED</b> are neccessary under any circumstances. Fields marked below described syntax. Fields marked <b>REQUIRED</b> are neccessary
<b>OPTIONAL</b> may be left out when not needed.<br> under any circumstances. Fields marked <b>OPTIONAL</b> may be left out
There are basically two different types of help entries that can be used. Internal help entries, that when not needed.<br>
means the headline, text, etc is included in the help entry or external help entries, that means the help There are basically two different types of help entries that can be
entry has only a reference pointing to a HTML/PHP page that offers the help entry. used. Internal help entries, that means the headline, text, etc is
included in the help entry or external help entries, that means the
help entry has only a reference pointing to a HTML/PHP page that offers
the help entry.
<br> <br>
<h3><br>4.1. Internal help entries</h3> <h3><br>
<span style="font-weight: bold;">ext</span> <span style="font-style: italic;">(REQUIRED)</span> 4.1. Internal help entries</h3>
<br>Must be <b>FALSE</b> in this case. <span style="font-weight: bold;">ext</span> <span
<br><br> style="font-style: italic;">(REQUIRED)</span> <br>
<span style="font-weight: bold;">Headline</span> <span style="font-style: italic;">(REQUIRED)</span> Must be <b>FALSE</b> in this case.
<br>The headline of this help entry. Can consist of any alpha-numeric characters. No HTML/CSS <br>
elements are not allowed here. <br>
<br><br> <span style="font-weight: bold;">Headline</span> <span
<span style="font-weight: bold;">Text</span> <span style="font-style: italic;">(REQUIRED)</span> style="font-style: italic;">(REQUIRED)</span> <br>
<br>The text of this help entry. Can constist if any alpha-numeric characters and can contain The headline of this help entry. Can consist of any alpha-numeric
placeholder for variables passed to this help entry. The placeholder must follow the syntax for characters. No HTML/CSS elements are not allowed here.
placeholder defined by the PHP <b>printf</b> function. HTML/CSS elements are allowed here as long <br>
as they follow the XHTML1.0 Strict specification.<br><br> <br>
When placeholders are included you can submit the values that should be displayed there as arguments <span style="font-weight: bold;">Text</span> <span
when calling the <b>templates/help.php</b> file. There they are attached as <b>var1</b>, <b>var2</b> style="font-style: italic;">(REQUIRED)</span> <br>
and so on. The names must follow the following rules:<br> The text of this help entry. Can constist if any alpha-numeric
characters and can contain placeholder for variables passed to this
help entry. The placeholder must follow the syntax for placeholder
defined by the PHP <b>printf</b> function. HTML/CSS elements are
allowed here as long as they follow the XHTML1.0 Strict specification.<br>
<br>
When placeholders are included you can submit the values that should be
displayed there as arguments when calling the <b>templates/help.php</b>
file. There they are attached as <b>var1</b>, <b>var2</b> and so on.
The names must follow the following rules:<br>
<ul> <ul>
<li>1. They must be named <b>var$i</b> where $i is any positive number except the '0'.</li> <li>1. They must be named <b>var$i</b> where $i is any positive
<li>2. This number ($i) must either be '1' or $i -1 must be present.</li> number except the '0'.</li>
<li>2. This number ($i) must either be '1' or $i -1 must be present.</li>
</ul> </ul>
<br> <br>
<span style="font-weight: bold;">SeeAlso</span> <span style="font-style: italic;">(OPTIONAL)</span> <span style="font-weight: bold;">SeeAlso</span> <span
<br>An array of references to anonther related subjects. Each row of the array must contain a field style="font-style: italic;">(OPTIONAL)</span> <br>
called "text" with the text that should be displayed and may contain a field called "link" which is used An array of references to anonther related subjects. Each row of the
as value for the href attribute of a HTML <a> tag when set. array must contain a field called "text" with the text that should be
displayed and may contain a field called "link" which is used as value
for the href attribute of a HTML <a> tag when set.
<br> <br>
<h3><br>4.2. External help entries</h3> </a>
<span style="font-weight: bold;">ext</span> <span style="font-style: italic;">(REQUIRED)</span> <h3><a><br>
<br>Must be <b>TRUE</b> in this case. 4.2. External help entries</a></h3>
<br><br> <span style="font-weight: bold;"><a>ext</a></span><a> <span
<span style="font-weight: bold;">Link</span> <span style="font-style: italic;">(REQUIRED)</span> style="font-style: italic;">(REQUIRED)</span> <br>
<br>The complete filename of the file stored under the help/ directory which should be displayed Must be <b>TRUE</b> in this case.
when this help entry is called. <br>
<br>
<span style="font-weight: bold;">Link</span> <span
style="font-style: italic;">(REQUIRED)</span> <br>
The complete filename of the file stored under the help/ directory
which should be displayed when this help entry is called.
</a>
</body> </body>
</html> </html>