function flag_requirements in Flag 6
Same name and namespace in other branches
- 8.4 flag.install \flag_requirements()
- 5 flag.install \flag_requirements()
- 6.2 flag.install \flag_requirements()
- 7.3 flag.install \flag_requirements()
- 7.2 flag.install \flag_requirements()
Implementation of hook_requirements().
Prevent installing this module if the "Flag content" module is installed as well.
File
- ./
flag.install, line 77 - Flag module install/schema/update hooks.
Code
function flag_requirements($phase) {
$requirements = array();
$t = get_t();
if ($phase == 'install') {
if (!defined('MAINTENANCE_MODE') && _flag_flag_content_installed()) {
$requirements['flag_content_clash']['title'] = $t('Flag');
$requirements['flag_content_clash']['severity'] = REQUIREMENT_ERROR;
$requirements['flag_content_clash']['description'] = _flag_flag_content_message();
}
}
if ($phase == 'runtime' && module_exists('translation') && !module_exists('translation_helpers')) {
$requirements['flag_translation']['title'] = $t('Flag');
$requirements['flag_translation']['severity'] = REQUIREMENT_ERROR;
$requirements['flag_translation']['description'] = $t('To have the flag module work with translations, you need to install and enable the <a href="http://drupal.org/project/translation_helpers">Translation helpers</a> module.');
$requirements['flag_translation']['value'] = $t('Translation helpers module not found.');
}
return $requirements;
}