removed unneeded functions from accountContainer

This commit is contained in:
Roland Gruber 2004-10-28 19:37:40 +00:00
parent 503410a6f6
commit 6f6f9607e8
1 changed files with 19 additions and 67 deletions

View File

@ -261,13 +261,13 @@ function getAvailableModules($scope) {
* @return array profile elements * @return array profile elements
*/ */
function getProfileOptions($scope) { function getProfileOptions($scope) {
// create new account container if needed $mods = $_SESSION['config']->get_AccountModules($scope);
if (! isset($_SESSION["profile_account_$scope"])) { $return = array();
$_SESSION["profile_account_$scope"] = new accountContainer($scope, "profile_account_$scope"); for ($i = 0; $i < sizeof($mods); $i++) {
$_SESSION["profile_account_$scope"]->new_account(); $module = new $mods[$i]($scope);
$return[$mods[$i]] = $module->get_profileOptions();
} }
// get options return $return;
return $_SESSION["profile_account_$scope"]->getProfileOptions();
} }
/** /**
@ -278,13 +278,14 @@ function getProfileOptions($scope) {
* @return array list of error messages * @return array list of error messages
*/ */
function checkProfileOptions($scope, $options) { function checkProfileOptions($scope, $options) {
// create new account container if needed $mods = $_SESSION['config']->get_AccountModules($scope);
if (! isset($_SESSION["profile_account_$scope"])) { $return = array();
$_SESSION["profile_account_$scope"] = new accountContainer($scope, "profile_account_$scope"); for ($i = 0; $i < sizeof($mods); $i++) {
$_SESSION["profile_account_$scope"]->new_account(); $module = new $mods[$i]($scope);
$temp = $module->check_profileOptions($options);
$return = array_merge($return, $temp);
} }
// get options return $return;
return $_SESSION["profile_account_$scope"]->checkProfileOptions($options);
} }
/** /**
@ -395,13 +396,13 @@ function getAvailableScopes() {
* @return array column list * @return array column list
*/ */
function getUploadColumns($scope) { function getUploadColumns($scope) {
// create new account container if needed $mods = $_SESSION['config']->get_AccountModules($scope);
if (! isset($_SESSION["profile_account_$scope"])) { $return = array();
$_SESSION["profile_account_$scope"] = new accountContainer($scope, "profile_account_$scope"); for ($i = 0; $i < sizeof($mods); $i++) {
$_SESSION["profile_account_$scope"]->new_account(); $module = new $mods[$i]($scope);
$return[$mods[$i]] = $module->get_uploadColumns();
} }
// get options return $return;
return $_SESSION["profile_account_$scope"]->get_uploadColumns();
} }
/** /**
@ -1223,33 +1224,6 @@ class accountContainer {
return 0; return 0;
} }
/**
* Returns an hash array containing all profile options
*/
function getProfileOptions() {
$return = array();
$modules = array_keys($this->module);
foreach ($modules as $singlemodule) {
$return[$singlemodule] = $this->module[$singlemodule]->get_profileOptions();
}
return $return;
}
/**
* Checks the input values of an account profile.
*
* @param array $options list of input values
* @return array list of error messages
*/
function checkProfileOptions($options) {
$return = array();
$modules = array_keys($this->module);
foreach ($modules as $singlemodule) {
$temp = $this->module[$singlemodule]->check_profileOptions($options);
$return = array_merge($return, $temp);
}
return $return;
}
// TODO remove this function? // TODO remove this function?
function proccess_profile($post) { function proccess_profile($post) {
@ -1546,27 +1520,5 @@ class accountContainer {
$return['main'] = array( 'dn'); $return['main'] = array( 'dn');
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;
}
} }
?> ?>