function termstatus_requirements in Taxonomy Term Status 7
Implements hook_requirements().
File
- ./
termstatus.install, line 30 - Install, update and uninstall functions for the termstatus module.
Code
function termstatus_requirements($phase) {
$requirements = array();
// Ensure translations don't break at install time.
$t = get_t();
if ($phase != 'install') {
// Check if term status is enabled.
if (!variable_get('termstatus_enable', FALSE)) {
$requirements['taxonomy_term_status'] = array(
'title' => $t('Taxonomy Term Status'),
'value' => $t('Term status is not configured yet. First visit the <a href="@config_link">configuration page</a> in order to build the status records and then enable it.', array(
'@config_link' => url('admin/config/system/termstatus'),
)),
'severity' => REQUIREMENT_WARNING,
);
}
else {
$requirements['taxonomy_term_status'] = array(
'title' => $t('Taxonomy Term Status'),
'value' => $t('Term status is configured and active. If the site is experiencing problems with visibility of taxonomy terms, you may have to rebuild the term status records using the <a href="@config_link">configuration page</a>.', array(
'@config_link' => url('admin/config/system/termstatus'),
)),
'severity' => REQUIREMENT_OK,
);
}
}
return $requirements;
}