added/updated get_uploadColumns()

This commit is contained in:
Roland Gruber 2004-08-28 11:53:40 +00:00
parent b3192badd5
commit 4b51087239
5 changed files with 144 additions and 2 deletions

View File

@ -437,6 +437,37 @@ user to decide which fields are to be displayed on the PDF file. The
format of the array to be returned is described in section 5. "PDF format of the array to be returned is described in section 5. "PDF
syntax".<br> syntax".<br>
<br> <br>
<h3>2.2.8. get_uploadColumns</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_uploadColumns()</span><br>
</td>
</tr>
</tbody>
</table>
<br>
Returns a list of column entries for the upload .csv-file.<br>
Each column entry is an array containing these values:<br>
<ul>
<li><span style="font-weight: bold;"><span style="font-style: italic;">string</span>
name:</span> fixed non-translated name which is used as column name
(should be of format: &lt;module name&gt;_&lt;column name&gt;)</li>
<li><span style="font-weight: bold;"><span style="font-style: italic;">string</span>
description:</span> short descriptive name</li>
<li><span style="font-weight: bold;"><span style="font-style: italic;">string</span>
help:</span> help ID</li>
<li><span style="font-weight: bold;"><span style="font-style: italic;">string</span>
example:</span> example value</li>
<li><span style="font-weight: bold;"><span style="font-style: italic;">boolean</span>
required:</span> true, if user must set a value for this column<br>
</li>
</ul>
<br>
<br> <br>
<span style="font-weight: bold;">*: These functions do not need to be <span style="font-weight: bold;">*: These functions do not need to be
implemented if meta data is supplied. See 6 for a list of meta data implemented if meta data is supplied. See 6 for a list of meta data

View File

@ -342,8 +342,8 @@ class baseModule {
* Syntax: * Syntax:
* <br> array( * <br> array(
* <br> string: name, // fixed non-translated name which is used as column name (should be of format: <module name>_<column name>) * <br> string: name, // fixed non-translated name which is used as column name (should be of format: <module name>_<column name>)
* <br> string: descriptive name, // short descriptive name * <br> string: description, // short descriptive name
* <br> string: help entry, // help ID * <br> string: help, // help ID
* <br> string: example, // example value * <br> string: example, // example value
* <br> boolean: required // true, if user must set a value for this column * <br> boolean: required // true, if user must set a value for this column
* <br> ) * <br> )

View File

@ -340,6 +340,32 @@ function getAvailableScopes() {
return array('user','group','host'); return array('user','group','host');
} }
/**
* Returns an array containing all input columns for the file upload.
*
* Syntax:
* <br> array(
* <br> string: name, // fixed non-translated name which is used as column name (should be of format: <module name>_<column name>)
* <br> string: description, // short descriptive name
* <br> string: help, // help ID
* <br> string: example, // example value
* <br> boolean: required // true, if user must set a value for this column
* <br> )
*
* @param string $scope account type
* @return array column list
*/
function get_uploadColumns($scope) {
// create new account container if needed
if (! isset($_SESSION["profile_account_$scope"])) {
$_SESSION["profile_account_$scope"] = new accountContainer($scope, "profile_account_$scope");
$_SESSION["profile_account_$scope"]->new_account();
}
// get options
return $_SESSION["profile_account_$scope"]->get_uploadColumns();
}
/** /**
* This class includes all modules and attributes of an account. * This class includes all modules and attributes of an account.
* *
@ -1186,5 +1212,28 @@ class accountContainer {
} }
return $return; return $return;
} }
/**
* Returns an array containing all input columns for the file upload.
*
* Syntax:
* <br> array(
* <br> string: name, // fixed non-translated name which is used as column name (should be of format: <module name>_<column name>)
* <br> string: description, // short descriptive name
* <br> string: help, // help ID
* <br> string: example, // example value
* <br> boolean: required // true, if user must set a value for this column
* <br> )
*
* @return array column list
*/
function get_uploadColumns() {
$return = array();
foreach($this->module as $moduleName => $module) {
$return[$moduleName] = $module->get_uploadColumns();
}
return $return;
}
} }
?> ?>

View File

@ -126,6 +126,44 @@ class posixGroup extends baseModule {
'gidNumber', 'gidNumber',
'memberUid', 'memberUid',
'description'); 'description');
// upload fields
$return['upload_columns'] = array(
array(
'name' => 'posixGroup_cn',
'description' => _('Group name'),
'help' => 'TODO',
'example' => _('adminstrators'),
'required' => true
),
array(
'name' => 'posixGroup_gid',
'description' => _('GID number'),
'help' => 'TODO',
'example' => _('2034'),
'required' => false
),
array(
'name' => 'posixGroup_description',
'description' => _('Group description'),
'help' => 'TODO',
'example' => _('Administrators group'),
'required' => false
),
array(
'name' => 'posixGroup_members',
'description' => _('Group members'),
'help' => 'TODO',
'example' => _('user01,user02,user03'),
'required' => false
),
array(
'name' => 'posixGroup_password',
'description' => _('Group password'),
'help' => 'TODO',
'example' => _('secret'),
'required' => false
)
);
return $return; return $return;
} }

View File

@ -73,6 +73,30 @@ class sambaGroupMapping extends baseModule {
'displayName', 'displayName',
'sambaGroupType', 'sambaGroupType',
'description'); 'description');
// upload fields
$return['upload_columns'] = array(
array(
'name' => 'sambaGroupMapping_domain',
'description' => _('Samba 3 domain name'),
'help' => 'TODO',
'example' => _('domain1'),
'required' => true
),
array(
'name' => 'sambaGroupMapping_name',
'description' => _('Samba 3 display name'),
'help' => 'TODO',
'example' => _('Domain administrators'),
'required' => false
),
array(
'name' => 'sambaGroupMapping_rid',
'description' => _('Samba 3 rid number'),
'help' => 'TODO',
'example' => 'DOMAIN_ADMINS',
'required' => false
)
);
return $return; return $return;
} }