You are here

function revenue_sharing_basic_requirements in Google AdSense integration 7

Same name and namespace in other branches
  1. 5.3 old/revenue_sharing_basic/revenue_sharing_basic.module \revenue_sharing_basic_requirements()
  2. 6 old/revenue_sharing_basic/revenue_sharing_basic.module \revenue_sharing_basic_requirements()

Implements hook_requirements().

File

old/revenue_sharing_basic/revenue_sharing_basic.install, line 11
Install file of the revenue_sharing_basic module.

Code

function revenue_sharing_basic_requirements($phase) {
  $requirements = array();
  $t = get_t();
  switch ($phase) {

    // At runtime, make sure that we have a publisher ID.
    case 'runtime':
      if (variable_get('cache', 0) && variable_get('adsense_id_module', ADSENSE_ID_MODULE_DEFAULT) == 'revenue_sharing_basic_adsense') {
        $requirements['revenue_sharing_nocache'] = array(
          'title' => $t('Revenue Sharing'),
          'value' => $t('Drupal page cache is enabled.'),
          'description' => $t('This causes conflicts with revenue sharing, since the pages are stored in the cache and are not dynamically generated. If you experience issues with revenue sharing, then disable the page cache.'),
          'severity' => REQUIREMENT_WARNING,
        );
      }
      break;
  }
  return $requirements;
}