You are here

function advagg_generate_filenames in Advanced CSS/JS Aggregation 7.2

Given a group of files calculate what the aggregate filename will be.

Parameters

array $groups: An array of CSS/JS groups.

string $type: String; css or js.

Return value

array Files array.

4 calls to advagg_generate_filenames()
advagg_advagg_build_aggregate_plans_alter in ./advagg.advagg.inc
Implements hook_advagg_build_aggregate_plans_alter().
advagg_build_aggregate_plans in ./advagg.inc
Replacement for drupal_build_css_cache() and drupal_build_js_cache().
advagg_bundler_advagg_build_aggregate_plans_alter in advagg_bundler/advagg_bundler.advagg.inc
Implements hook_advagg_build_aggregate_plans_alter().
hook_advagg_build_aggregate_plans_alter in ./advagg.api.php
Allow modules to modify the aggregate plan.

File

./advagg.inc, line 443
Advanced CSS/JS aggregation module.

Code

function advagg_generate_filenames(array $groups, $type) {
  $files = array();
  foreach ($groups as $data) {
    foreach ($data as $files_with_meta_data) {

      // Get the aggregate filename and info about each file.
      $aggregate_info = advagg_get_aggregate_info_from_files($type, $files_with_meta_data);
      $values['files'] = $aggregate_info[1];
      $values['aggregate_filenames_hash'] = $aggregate_info[2];
      $values['aggregate_contents_hash'] = $aggregate_info[3];

      // Add information to the files array.
      $files[$aggregate_info[0]] = $values;
    }
  }
  return $files;
}