Integration of the "bridge" module and new mechanism for auto_select modules.

SVN:trunk[2544]
This commit is contained in:
Denis Flaven
2012-12-06 17:51:52 +00:00
parent aa6cfc205e
commit f0ae02fd8e
4 changed files with 90 additions and 12 deletions

View File

@@ -1254,4 +1254,33 @@ EOF
}
return false;
}
}
/**
* Helper class to write rules (as PHP expressions) in the 'auto_select' field of the 'module'
*/
class SetupInfo
{
static $aSelectedModules = array();
/**
* Called by the setup process to initializes the list of selected modules. Do not call this method
* from an 'auto_select' rule
* @param hash $aModules
* @return void
*/
static function SetSelectedModules($aModules)
{
self::$aSelectedModules = $aModules;
}
/**
* Returns true if a module is selected (as a consequence of the end-user's choices,
* or because the module is hidden, or mandatory, or because of a previous auto_select rule)
* @param string $sModuleId The identifier of the module (without the version number. Example: itop-config-mgmt)
* @return boolean True if the module is already selected, false otherwise
*/
static function ModuleIsSelected($sModuleId)
{
return (array_key_exists($sModuleId, self::$aSelectedModules));
}
}