You are here

function skinr_inherited_skins in Skinr 6

Same name and namespace in other branches
  1. 6.2 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_process_info_files in ./skinr.module
Themes are allowed to set Skinr styles in their .info files.

File

./skinr.module, line 563

Code

function skinr_inherited_skins($theme, $themes) {
  $all_skins = $skins = array();
  $base_theme = !empty($themes[$theme]->info['base theme']) ? $themes[$theme]->info['base theme'] : '';
  while ($base_theme) {
    $all_skins[] = !empty($themes[$base_theme]->info['skinr']) ? (array) $themes[$base_theme]->info['skinr'] : array();
    $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;
}