@@ -94,39 +93,41 @@ contains the LDAP attributes which are useful for this module.
* This function will create the meta HTML code to
show a page with all attributes.
*
- * @param array $post HTTP-POST values
+ * @return htmlElement HTML meta data
*/
- functiondisplay_html_attributes($post) {
- $return = array();
+ functiondisplay_html_attributes() { $return = new htmlTable();
+ $macCount = 0;
// list current MACs
- for ($i = 0; $i <
-sizeof($this->attributes['macAddress']); $i++) {
- $return[] =
-array(
+ if (isset($this->attributes['macAddress'])) {
+ $macCount = sizeof($this->attributes['macAddress']);
+ for ($i = 0;
+$i < sizeof($this->attributes['macAddress']); $i++) {
- array('kind' => 'text', 'text' =>
-_('MAC address')),
+ $return->addElement(new htmlOutputText(_('MAC
+address')));
- array('kind' => 'input', 'name' =>
-'macAddress' . $i, 'type' => 'text', 'size' => '17', 'maxlength'
-=> '17', 'value' => $this->attributes['macAddress'][$i]),
+ $macInput = new htmlInputField('macAddress' . $i,
+$this->attributes['macAddress'][$i]);
+ $macInput->setFieldSize(17);
+ $macInput->setFieldMaxLength(17);
+ $return->addElement($macInput);
- array('kind' => 'input', 'type' =>
-'submit', 'name' => 'delMAC' . $i, 'value' => _("Remove")),
+ $return->addElement(new htmlButton('delMAC' . $i,
+'del.png', true));
- array('kind' => 'help', 'value' =>
-'mac'));
+ $return->addElement(new htmlHelpLink('mac'),
+true);
+ }
}
// input box for new MAC
- $return[] = array(
- array('kind' => 'text', 'text' => _('New MAC address')),
- array('kind' => 'input', 'name' => 'macAddress', 'type' =>
-'text', 'size' => '17', 'maxlength' => '17', 'value' => ''),
- array('kind' => 'input', 'type' => 'submit', 'name' =>
-'addMAC', 'value' => _("Add")),
- array('kind' => 'help', 'value' => 'mac'),
- array('kind' => 'input', 'type' => 'hidden', 'value' =>
-sizeof($this->attributes['macAddress']), 'name' => 'mac_number'));
+ $return->addElement(new htmlOutputText(_('New MAC address')));
+ $newMacInput = new htmlInputField('macAddress', '');
+ $newMacInput->setFieldSize(17);
+ $newMacInput->setFieldMaxLength(17);
+ $return->addElement($newMacInput);
+ $return->addElement(new htmlButton('addMAC', 'add.png', true));
+ $return->addElement(new htmlHelpLink('mac'));
+ $return->addElement(new htmlHiddenInput('mac_number', $macCount));
return $return;
}
diff --git a/lam/docs/devel/mod_config.htm b/lam/docs/devel/mod_config.htm
index d4e6c138..373af105 100644
--- a/lam/docs/devel/mod_config.htm
+++ b/lam/docs/devel/mod_config.htm
@@ -1,11 +1,9 @@
Module HowTo - Configuration options
+
-
-
-
-
+
Module HowTo - Configuration options
@@ -31,9 +29,7 @@ or meta['config_options'].
Example:
-The posixGroup module offers
-three configuration options. The min/maximum values for GIDs and the
-password hash type.
+The posixGroup module offers several configuration options including the min/maximum values for GIDs.
-The min/maximum GID numbers are defined with simple text boxes. The
-password hash is selected with a drop down box and SSHA as default
-value.
-You should make sure that the column count (here: 6) is the same for
-each row. Otherwise the configuration page might be badly rendered by
-the browser.
-
+The min/maximum GID numbers are defined with simple text boxes.
2. Checking user input
Probably you also want to check if the input data is syntactically
correct.
diff --git a/lam/docs/devel/mod_profiles.htm b/lam/docs/devel/mod_profiles.htm
index 1034b1a3..a7ac2ca0 100644
--- a/lam/docs/devel/mod_profiles.htm
+++ b/lam/docs/devel/mod_profiles.htm
@@ -1,10 +1,8 @@
Module HowTo - Account profiles
-
-
-
-
+
+
This defines two text boxes in the profile editor, one for the job
title and one for the employee type.
-Your profile options should also provide a help link if the description
+Your profile options should also provide a help link because the description
of the input element might be not enough.
@@ -22,14 +21,12 @@ and several other values.
The upload columns are specified with get_uploadColumns()
or meta['upload_columns'].
-Example:
+Example:
The ieee802Device
module has only one attribute and therefore one column: the MAC address.
-
+
/**
@@ -46,11 +43,9 @@ get_metaData() {
$return["account_types"] = array("host");
// upload fields
- $return['upload_columns'] = array(
+ $return['upload_columns'] = array(
- array(
+ array(
'name' =>
'ieee802Device_mac',
@@ -64,8 +59,7 @@ get_metaData() {
'example'
=> '00:01:02:DE:EF:18'
- )
+ )
);
return $return;
@@ -85,16 +79,14 @@ This is done with build_uploadAccounts()
The function gets the input data and a list of LDAP accounts as
parameter.
-Example:
+Example:
The ieee802Device
module has only one LDAP attribute - 'macAddress'
- and the 'ieee802Device'
objectClass which is added to all accounts.
-
+
/**
@@ -105,12 +97,10 @@ objectClass which is added to all accounts.
* @param array $partialAccounts list of hash arrays
(name => value) which are later added to LDAP
* @param array $ids list of IDs for column position
-(e.g. "posixAccount_uid" => 5)
- * @param array $selectedModules list of selected account modules
+(e.g. "posixAccount_uid" => 5) * @param array $selectedModules list of selected account modules
* @return array list of error messages if any
*/
- functionbuild_uploadAccounts($rawAccounts,
+ functionbuild_uploadAccounts($rawAccounts,
$ids, &$partialAccounts, $selectedModules) {
$messages = array();
for ($i = 0; $i <
@@ -169,5 +159,4 @@ $errMsg;