You are here

function _skinr_add_path_to_files in Skinr 6.2

Helper function to prepend a path to an array of stylesheets or scripts in a .info file.

Parameters

$files: A an array of filenames that need the path prepended.

$path: The path to prepend.

$type: Either 'css' or 'js', depending on which files you wish to retrieve from these skins.

Return value

An array of files with the root path added.

1 call to _skinr_add_path_to_files()
_skinr_add_paths_to_files in ./skinr.module

File

./skinr.module, line 828

Code

function _skinr_add_path_to_files($files, $path, $type) {
  if ($type == 'css') {
    $pathed_stylesheets = array();
    foreach ($files as $media => $stylesheets) {
      foreach ($stylesheets as $stylesheet) {
        $pathed_stylesheets[$media][$stylesheet] = $path . '/' . $stylesheet;
      }
    }
    return $pathed_stylesheets;
  }
  elseif ($type == 'js') {
    $pathed_scripts = array();
    foreach ($files as $script) {
      $pathed_scripts[$script] = $path . '/' . $script;
    }
    return $pathed_scripts;
  }
  return FALSE;
}