Implements hook_advagg_build_aggregate_plans_alter().
Used to alter the plan so it has the same grouping as cores.
Sujets associés
Fichier
-
./
advagg.advagg.inc, line 118
Code
function advagg_advagg_build_aggregate_plans_alter(array &$files, &$modified, $type) {
// * @param array $files
// * List of files in the aggregate as well as the aggregate name.
// * @param bool $modified
// * Change this to TRUE if $files has been changed.
// * @param string $type
// * String containing css or js.
//
// Do nothing if core grouping is disabled.
if (!variable_get('advagg_core_groups', ADVAGG_CORE_GROUPS)) {
return;
}
$temp_new_files = array();
$counter = 0;
foreach ($files as $data) {
$group = NULL;
$every_page = NULL;
foreach ($data['files'] as $fileinfo) {
// Grouped by group and every_page variables.
if (is_null($group)) {
$group = $fileinfo['group'];
}
if (is_null($every_page)) {
$every_page = $fileinfo['every_page'];
}
// Bump Counter if group/every_page has changed from the last one.
if ($group != $fileinfo['group'] || $every_page != $fileinfo['every_page']) {
++$counter;
$group = $fileinfo['group'];
$every_page = $fileinfo['every_page'];
$modified = TRUE;
}
$temp_new_files[$counter][] = $fileinfo;
}
++$counter;
}
// Replace $files array with new aggregate filenames.
$files = advagg_generate_filenames(array(
$temp_new_files,
), $type);
}