function mobile_switch_block_requirements in Mobile Switch Block 6
Same name and namespace in other branches
- 7 mobile_switch_block.install \mobile_switch_block_requirements()
Implementation of hook_requirements().
File
- ./
mobile_switch_block.install, line 10 - Install, update and uninstall functions for the Mobile Switch Block module.
Code
function mobile_switch_block_requirements($phase) {
$requirements = array();
$t = get_t();
$requirements['mobile_switch']['value'] = '';
$info = drupal_parse_info_file(drupal_get_path('module', 'mobile_switch') . '/mobile_switch.info');
switch ($phase) {
case 'install':
// Ensure Mobile Switch module version.
// Release datestamps or+ are ok:
// 6.x-1.0-beta1: 1349261467
// dev: 1349267870
if ($info['datestamp'] < 1349261467) {
$requirements['mobile_switch'] = array(
'severity' => REQUIREMENT_ERROR,
'description' => $t('<em>Mobile Switch Block</em> module: The version of the required <em>Mobile Switch</em> module is too low. Please update this module.'),
);
}
else {
$requirements['mobile_switch'] = array(
'severity' => REQUIREMENT_OK,
);
}
break;
}
$requirements['mobile_switch']['value'] = $t('!version', array(
'!version' => $info['version'],
));
$requirements['mobile_switch']['title'] = $t('<em>Mobile Switch</em> module');
return $requirements;
}