You are here

function _skinr_add_paths_to_files in Skinr 6.2

2 calls to _skinr_add_paths_to_files()
skinr_inherited_skins in ./skinr.module
Retrieves all the Skinr skins from theme parents. Theme skins will override any skins of the same name from its parents.
_skinr_skinset in ./skinr.module
Helper function to process a skin or theme .info file.

File

./skinr.module, line 785

Code

function _skinr_add_paths_to_files(&$skinr_info, $path_root) {
  foreach ($skinr_info as $id => $skin) {
    if (!is_array($skin)) {
      continue;
    }

    // Give the stylesheets proper path information.
    if (!empty($skin['stylesheets'])) {
      $skinr_info[$id]['stylesheets'] = _skinr_add_path_to_files($skin['stylesheets'], $path_root, 'css');
    }

    // Give the scripts proper path information.
    if (!empty($skin['scripts'])) {
      $skinr_info[$id]['scripts'] = _skinr_add_path_to_files($skin['scripts'], $path_root, 'js');
    }
    if (!empty($skin['options'])) {
      foreach ($skin['options'] as $oid => $option) {
        if (!empty($option['stylesheets'])) {
          $skinr_info[$id]['options'][$oid]['stylesheets'] = _skinr_add_path_to_files($option['stylesheets'], $path_root, 'css');
        }
        if (isset($option['scripts'])) {
          $skinr_info[$id]['options'][$oid]['scripts'] = _skinr_add_path_to_files($option['scripts'], $path_root, 'js');
        }
      }
    }
  }
}