You are here

function hook_advagg_get_root_files_dir in Advanced CSS/JS Aggregation 7.2

Allow other modules to alter css and js paths.

Parameters

array $css_paths: Array containing the local path and url path.

array $js_paths: Array containing the local path and url path.

See also

advagg_get_root_files_dir()

advagg_mod_advagg_get_root_files_dir_alter()

Related topics

File

./advagg.api.php, line 176
Hooks provided by the AdvAgg module.

Code

function hook_advagg_get_root_files_dir(array &$css_paths, array &$js_paths) {
  $dir = rtrim(variable_get('advagg_mod_unified_multisite_dir', ''), '/');
  if (empty($dir) || !file_exists($dir) || !is_dir($dir)) {
    return;
  }

  // Change directory.
  $css_paths[0] = $dir . '/advagg_css';
  $js_paths[0] = $dir . '/advagg_js';
  file_prepare_directory($css_paths[0], FILE_CREATE_DIRECTORY);
  file_prepare_directory($js_paths[0], FILE_CREATE_DIRECTORY);

  // Set the URI of the directory.
  $css_paths[1] = advagg_get_relative_path($css_paths[0]);
  $js_paths[1] = advagg_get_relative_path($js_paths[0]);
}