function advagg_enabled

cis7 advagg.module advagg_enabled()
cle7 advagg.module advagg_enabled()
elmsmedia7 advagg.module advagg_enabled()
icor7 advagg.module advagg_enabled()
meedjum_blog7 advagg.module advagg_enabled()
mooc7 advagg.module advagg_enabled()

Function used to see if aggregation is enabled.

Return value

bool The value of the advagg_enabled variable.

9 calls to advagg_enabled()
advagg_ajax_render_alter in sites/all/modules/ulmus/advagg/advagg.module
Implements hook_ajax_render_alter().
advagg_css_alter in sites/all/modules/ulmus/advagg/advagg.module
Implements hook_css_alter().
advagg_js_alter in sites/all/modules/ulmus/advagg/advagg.module
Implements hook_js_alter().
advagg_mod_advagg_modify_js_pre_render_alter in sites/all/modules/ulmus/advagg/advagg_mod/advagg_mod.module
Implements hook_advagg_modify_js_pre_render_alter().
advagg_mod_css_alter in sites/all/modules/ulmus/advagg/advagg_mod/advagg_mod.module
Implements hook_css_alter().

... See full list

4 string references to 'advagg_enabled'
advagg_admin_menu_cache_info in sites/all/modules/ulmus/advagg/advagg.module
Implements hook_admin_menu_cache_info().
advagg_admin_menu_output_alter in sites/all/modules/ulmus/advagg/advagg.module
Implements hook_admin_menu_output_alter().
advagg_admin_settings_form in sites/all/modules/ulmus/advagg/advagg.admin.inc
Form builder; Configure advagg settings.
advagg_requirements in sites/all/modules/ulmus/advagg/advagg.install
Implements hook_requirements().

File

sites/all/modules/ulmus/advagg/advagg.module, line 1486
Advanced CSS/JS aggregation module.

Code

function advagg_enabled() {
  $init = &drupal_static(__FUNCTION__);

  if (!empty($init)) {
    return variable_get('advagg_enabled', ADVAGG_ENABLED);
  }

  $init = TRUE;
  // Disable AdvAgg if module needs to be upgraded from 1.x to 2.x.
  if (variable_get('advagg_needs_update', ADVAGG_NEEDS_UPDATE)) {
    if (!db_table_exists('advagg_aggregates_versions')) {
      $GLOBALS['conf']['advagg_enabled'] = FALSE;
      if (user_access('administer site configuration')) {
        drupal_set_message(t('Please run <a href="@link">database updates</a>. AdvAgg will remain disabled until done.', array('@link' => url('update.php'))), 'error');
      }
    }
    else {
      variable_del('advagg_needs_update');
    }
  }
  else {
    // Allow for AdvAgg to be enabled per request.
    // @ignore sniffer_whitespace_openbracketspacing_openingwhitespace
    if (isset($_GET['advagg']) && $_GET['advagg'] == 1 && !defined('MAINTENANCE_MODE') && user_access('bypass advanced aggregation')) {
      $GLOBALS['conf']['advagg_enabled'] = TRUE;
      $GLOBALS['conf']['preprocess_css'] = TRUE;
      $GLOBALS['conf']['preprocess_js'] = TRUE;
    }

    // Disable AdvAgg if maintenance mode is defined.
    if (defined('MAINTENANCE_MODE')) {
      $GLOBALS['conf']['advagg_enabled'] = FALSE;
    }
    // Only run code below if advagg is enabled.
    if (variable_get('advagg_enabled', ADVAGG_ENABLED)) {
      // Do not use AdvAgg or preprocessing functions if the disable cookie is
      // set.
      $cookie_name = 'AdvAggDisabled';
      $key = drupal_hash_base64(drupal_get_private_key());
      if (!empty($_COOKIE[$cookie_name]) && $_COOKIE[$cookie_name] == $key) {
        $GLOBALS['conf']['advagg_enabled'] = FALSE;
        $GLOBALS['conf']['preprocess_css'] = FALSE;
        $GLOBALS['conf']['preprocess_js'] = FALSE;

        // Let the user know that the AdvAgg bypass cookie is currently set.
        static $msg_set;
        if (!isset($msg_set) && variable_get('advagg_show_bypass_cookie_message', ADVAGG_SHOW_BYPASS_COOKIE_MESSAGE)) {
          $msg_set = TRUE;
          if (user_access('administer site configuration')) {
            drupal_set_message(t('The AdvAgg bypass cookie is currently enabled. Turn it off by going to the <a href="@advagg_operations">AdvAgg Operations</a> page and clicking the <em>Toggle the "aggregation bypass cookie" for this browser</em> button.', array(
              '@advagg_operations' => url(advagg_admin_config_root_path() . '/advagg/operations', array('fragment' => 'edit-bypass')),
            )));
          }
          else {
            drupal_set_message(t('The AdvAgg bypass cookie is currently enabled. Turn it off by <a href="@login">logging in</a> with a user with the "administer site configuration" permissions and going to the AdvAgg Operations page (located at @advagg_operations) and clicking the <em>Toggle the "aggregation bypass cookie" for this browser</em> button.', array(
              '@login' => 'user/login',
              '@advagg_operations' => advagg_admin_config_root_path() . '/advagg/operations',
            )));
          }
        }
      }
      // Disable advagg if requested.
      // @ignore sniffer_whitespace_openbracketspacing_openingwhitespace
      if (isset($_GET['advagg']) && $_GET['advagg'] == -1 && user_access('bypass advanced aggregation')) {
        $GLOBALS['conf']['advagg_enabled'] = FALSE;
        $GLOBALS['conf']['preprocess_css'] = FALSE;
        $GLOBALS['conf']['preprocess_js'] = FALSE;
      }
      // Disable core preprocessing if requested.
      // @ignore sniffer_whitespace_openbracketspacing_openingwhitespace
      if (isset($_GET['advagg-core']) && $_GET['advagg-core'] == 0 && user_access('bypass advanced aggregation')) {
        $GLOBALS['conf']['preprocess_css'] = FALSE;
        $GLOBALS['conf']['preprocess_js'] = FALSE;
      }
      // Enable core preprocessing if requested.
      // @ignore sniffer_whitespace_openbracketspacing_openingwhitespace
      if (isset($_GET['advagg-core']) && $_GET['advagg-core'] == 1 && user_access('bypass advanced aggregation')) {
        $GLOBALS['conf']['preprocess_css'] = TRUE;
        $GLOBALS['conf']['preprocess_js'] = TRUE;
      }
      // Enable debugging if requested.
      // @ignore sniffer_whitespace_openbracketspacing_openingwhitespace
      if (isset($_GET['advagg-debug']) && $_GET['advagg-debug'] == 1 && user_access('bypass advanced aggregation')) {
        $GLOBALS['conf']['advagg_debug'] = TRUE;
      }
    }
  }

  return variable_get('advagg_enabled', ADVAGG_ENABLED);
}
Error | ELMSLN API

Error

×

Error message

  • Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/elmsln_community/api.elmsln.org/includes/common.inc:2791) in drupal_send_headers() (line 1499 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
  • Error: Call to undefined function apc_delete() in DrupalAPCCache->clear() (line 289 of /var/www/html/elmsln_community/api.elmsln.org/sites/all/modules/apc/drupal_apc_cache.inc).
The website encountered an unexpected error. Please try again later.