support for dynamic self service options

This commit is contained in:
Roland Gruber 2012-03-25 10:48:39 +00:00
parent 53b9165e54
commit 4733dbf95c
3 changed files with 6 additions and 4 deletions

View File

@ -1271,12 +1271,13 @@ abstract class baseModule {
* and save settings. We recommend to use the module name as prefix for them
* (e.g. posixAccount_homeDirectory) to avoid naming conflicts.
*
* @param selfServiceProfile $profile currently edited profile
* @return htmlElement meta HTML object
*
* @see baseModule::get_metaData()
* @see htmlElement
*/
public function getSelfServiceSettings() {
public function getSelfServiceSettings($profile) {
if (isset($this->meta['selfServiceSettings'])) {
return $this->meta['selfServiceSettings'];
}

View File

@ -2164,7 +2164,7 @@ class htmlHiddenInput extends htmlElement {
*/
function generateHTML($module, $input, $values, $restricted, &$tabindex, $scope) {
echo '<input type="hidden" name="' . $this->name . '" value="' . $this->value . '">';
return array();
return array($this->name => 'hidden');
}
}

View File

@ -237,14 +237,15 @@ function isSelfServiceProfileWritable($name, $scope) {
* Returns a hash array (module name => elements) of all module options for the configuration page.
*
* @param string $scope account type
* @param selfServiceProfile $profile currently edited profile
* @return array configuration options
*/
function getSelfServiceSettings($scope) {
function getSelfServiceSettings($scope, $profile) {
$return = array();
$modules = getAvailableModules($scope);
for ($i = 0; $i < sizeof($modules); $i++) {
$m = new $modules[$i]($scope);
$return[$modules[$i]] = $m->getSelfServiceSettings();
$return[$modules[$i]] = $m->getSelfServiceSettings($profile);
}
return $return;
}