changed getProfileOptions

This commit is contained in:
Roland Gruber 2004-03-06 19:15:40 +00:00
parent 045c391f71
commit 0902c105ef
1 changed files with 11 additions and 9 deletions

View File

@ -87,9 +87,8 @@ function getModulesDependencies($scope) {
while ($entry = readdir($dir)) while ($entry = readdir($dir))
if (is_file('../../lib/modules/'.$entry)) { if (is_file('../../lib/modules/'.$entry)) {
$entry = substr($entry, 0, strpos($entry, '.')); $entry = substr($entry, 0, strpos($entry, '.'));
$eval = '$module = '.$entry."::get_dependencies(".$scope.");"; $deps = call_user_func(array($entry, "get_dependencies"), $scope);
eval ($eval); if ($deps != -1) $return[$entry] = $deps;
if ($module != -1) $return[$entry] = $module;
} }
return $return; return $return;
} }
@ -165,13 +164,15 @@ function getAvailableModules($scope) {
} }
// $scope = user, group, host, ... // $scope = user, group, host, ...
function getProfileOptions($scope, $post=false) { function getProfileOptions($scope) {
if (!isset($_SESSION['profile_account'])) { // get module names.
// create new object $dir = opendir('../../lib/modules');
$_SESSION['profile_account'] = new accountContainer($scope, 'profile_account'); while ($entry = readdir($dir))
$_SESSION['profile_account']->new_account(); if (is_file('../../lib/modules/'.$entry)) {
$entry = substr($entry, 0, strpos($entry, '.'));
if (call_user_func(array($entry, "can_manage"), $scope)) $return[$entry] = call_user_func(array($entry, "get_profileOptions"), $scope);
} }
return $_SESSION['profile_account']->display_profile($post); return $return;
} }
function checkProfileOptions($scope, $post) { function checkProfileOptions($scope, $post) {
@ -692,6 +693,7 @@ class accountContainer {
return 0; return 0;
} }
// TODO function can be removed?
function display_profile($post) { function display_profile($post) {
$return = array(); $return = array();
$post = array(); $post = array();