function skinr_ui_get_skinable_hooks in Skinr 7.2
Same name and namespace in other branches
- 8.2 skinr_ui/skinr_ui.module \skinr_ui_get_skinable_hooks()
Fetch all theme_hooks that are compatible with active skins.
Return value
An array of all theme hooks listed in active skins for current theme.
1 call to skinr_ui_get_skinable_hooks()
- skinr_ui_element_is_skinable in ./
skinr_ui.module - Fetch all theme_hooks that are compatible with active skins.
File
- ./
skinr_ui.module, line 254 - Handles Skinr UI functionality allowing users to apply skins to their site.
Code
function skinr_ui_get_skinable_hooks($theme = NULL) {
$skinable_hooks =& drupal_static(__FUNCTION__);
if (!isset($skinable_hooks)) {
if ($cached = cache_get('skinr_skinable_hooks')) {
$skinable_hooks = $cached->data;
}
}
if (!isset($theme)) {
$theme = skinr_current_theme();
}
if (!isset($skinable_hooks[$theme])) {
$skinable_hooks[$theme] = array();
$skin_infos = skinr_get_skin_info();
foreach ($skin_infos as $skin_name => $skin_info) {
$skin_infos[$skin_name]['status'] = skinr_skin_info_status_get($skin_infos[$skin_name]);
if (!empty($skin_infos[$skin_name]['status'][$theme])) {
foreach ($skin_infos[$skin_name]['theme hooks'] as $active_hook) {
if (!isset($skinable_hooks[$active_hook])) {
$skinable_hooks[$theme][$active_hook] = $active_hook;
}
}
}
}
// Allow modules to alter config info via hook_skinr_skinnable_hooks_alter().
drupal_alter('skinr_skinable_hooks', $skinable_hooks);
cache_set('skinr_skinable_hooks', $skinable_hooks);
}
return $skinable_hooks[$theme];
}