function hook_advagg_css_groups_alter

×

Error message

User warning: The following module is missing from the file system: theme/theme. For information about how to fix this, see the documentation page. in _drupal_trigger_error_with_delayed_logging() (line 1156 of /var/www/html/elmsln_community/api.elmsln.org/includes/bootstrap.inc).
cis7 advagg.api.php hook_advagg_css_groups_alter(&$css_groups, $preprocess_css)
cle7 advagg.api.php hook_advagg_css_groups_alter(&$css_groups, $preprocess_css)
elmsmedia7 advagg.api.php hook_advagg_css_groups_alter(&$css_groups, $preprocess_css)
icor7 advagg.api.php hook_advagg_css_groups_alter(&$css_groups, $preprocess_css)
meedjum_blog7 advagg.api.php hook_advagg_css_groups_alter(&$css_groups, $preprocess_css)
mooc7 advagg.api.php hook_advagg_css_groups_alter(&$css_groups, $preprocess_css)

Allow other modules to modify $css_groups right before it is processed.

Parameters

array $css_groups: An associative array. key - group

bool $preprocess_css: TRUE if preprocessing is enabled.

See also

_advagg_aggregate_css()

advagg_css_cdn_advagg_css_groups_alter()

Related topics

1 function implements hook_advagg_css_groups_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

advagg_css_cdn_advagg_css_groups_alter in sites/all/modules/ulmus/advagg/advagg_css_cdn/advagg_css_cdn.module
Implements hook_advagg_css_groups_alter().
1 invocation of hook_advagg_css_groups_alter()
_advagg_aggregate_css in sites/all/modules/ulmus/advagg/advagg.module
Default callback to aggregate CSS files and inline content.

File

sites/all/modules/ulmus/advagg/advagg.api.php, line 306
Hooks provided by the AdvAgg module.

Code

function hook_advagg_css_groups_alter(&$css_groups, $preprocess_css) {
  // Work around a bug with seven_css_alter.
  // http://drupal.org/node/1937860
  $theme_keys[] = $GLOBALS['theme'];
  if (!empty($GLOBALS['base_theme_info'])) {
    foreach ($GLOBALS['base_theme_info'] as $base) {
      $theme_keys[] = $base->name;
    }
  }
  $match = FALSE;
  foreach ($theme_keys as $name) {
    if ($name == 'seven') {
      $match = TRUE;
    }
  }
  if (empty($match)) {
    return;
  }

  $target = FALSE;
  $last_group = FALSE;
  $last_key = FALSE;
  $kill_key = FALSE;
  $replaced = FALSE;
  foreach ($css_groups as $key => $group) {
    if (empty($target)) {
      if ($group['type'] == 'external' && $group['preprocess'] && $preprocess_css) {
        foreach ($group['items'] as $k => $value) {
          if ($value['data'] == 'themes/seven/jquery.ui.theme.css') {
            // Type should be file and not external (core bug).
            $value['type'] = 'file';
            $target = $value;
            unset($css_groups[$key]['items'][$k]);
            if (empty($css_groups[$key]['items'])) {
              unset($css_groups[$key]);
              $kill_key = $key;
            }
          }
        }
      }
    }
    else {
      $diff = array_merge(array_diff_assoc($group['browsers'], $target['browsers']), array_diff_assoc($target['browsers'], $group['browsers']));
      // @ignore sniffer_whitespace_openbracketspacing_openingwhitespace
      if ($group['type'] != $target['type'] || $group['group'] != $target['group'] || $group['every_page'] != $target['every_page'] || $group['media'] != $target['media'] || $group['media'] != $target['media'] || $group['preprocess'] != $target['preprocess'] || !empty($diff)) {
        if (!empty($last_group)) {
          $diff = array_merge(array_diff_assoc($last_group['browsers'], $target['browsers']), array_diff_assoc($target['browsers'], $last_group['browsers']));
          // @ignore sniffer_whitespace_openbracketspacing_openingwhitespace
          if ($last_group['type'] != $target['type'] || $last_group['group'] != $target['group'] || $last_group['every_page'] != $target['every_page'] || $last_group['media'] != $target['media'] || $last_group['media'] != $target['media'] || $last_group['preprocess'] != $target['preprocess'] || !empty($diff)) {
            // Insert New.
            $css_groups[$kill_key] = array(
              'group' => $target['group'],
              'type' => $target['type'],
              'every_page' => $target['every_page'],
              'media' => $target['media'],
              'preprocess' => $target['preprocess'],
              'browsers' => $target['browsers'],
              'items' => array($target),
            );
            $replaced = TRUE;
          }
          else {
            // Insert above.
            $css_groups[$last_key]['items'][] = $target;
            $replaced = TRUE;
          }
        }
      }
      else {
        // Insert below.
        array_unshift($css_groups[$key]['items'], $target);
        $replaced = TRUE;
      }
    }
    $last_group = $group;
    $last_key = $key;
    if ($replaced) {
      break;
    }
  }
  ksort($css_groups);
}
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.