You are here

function salesforce_mapping_requirements in Salesforce Suite 7.3

Same name and namespace in other branches
  1. 8.3 modules/salesforce_mapping/salesforce_mapping.install \salesforce_mapping_requirements()

Implements hook_requirements().

File

modules/salesforce_mapping/salesforce_mapping.install, line 6
Install and uninstall instructions for salesforce_mapping.

Code

function salesforce_mapping_requirements($phase) {
  $requirements = array();
  $t = get_t();
  switch ($phase) {
    case 'install':
      drupal_set_message(t('At least one sync method (Push or Pull) must be <a href="/admin/modules">enabled</a> to configure Salesforce Mappings.'), 'status', FALSE);
      break;
    case 'runtime':
      if (!module_exists('salesforce_pull') && !module_exists('salesforce_push')) {
        $requirements['salesforce_mapping'] = array(
          'title' => $t('Salesforce Mapping'),
          'description' => $t('<a href="/admin/modules">Enable</a> at least one sync method (Push or Pull) to configure Salesforce Mappings.'),
          'severity' => REQUIREMENT_ERROR,
        );
      }
      break;
  }
  return $requirements;
}