You are here

function skinr_inherited_skins in Skinr 6.2

Same name and namespace in other branches
  1. 6 skinr.module \skinr_inherited_skins()

Retrieves all the Skinr skins from theme parents. Theme skins will override any skins of the same name from its parents.

1 call to skinr_inherited_skins()
_skinr_skinset in ./skinr.module
Helper function to process a skin or theme .info file.

File

./skinr.module, line 643

Code

function skinr_inherited_skins($theme) {
  $themes = system_theme_data();
  $all_skins = $skins = array();
  $base_theme = !empty($themes[$theme]->info['base theme']) ? $themes[$theme]->info['base theme'] : '';
  while ($base_theme) {

    // Add in path info here.
    $base_skins = !empty($themes[$base_theme]->info['skinr']) ? (array) $themes[$base_theme]->info['skinr'] : array();
    $base_path = $path_root = dirname($themes[$base_theme]->filename);
    _skinr_add_paths_to_files($base_skins, $base_path);
    $all_skins[] = $base_skins;
    $base_theme = !empty($themes[$base_theme]->info['base theme']) ? $themes[$base_theme]->info['base theme'] : '';
  }
  array_reverse($all_skins);
  foreach ($all_skins as $new_skin) {
    $skins = array_merge($skins, $new_skin);
  }
  return $skins;
}