You are here

function skinr_ui_element_is_skinable in Skinr 8.2

Same name and namespace in other branches
  1. 7.2 skinr_ui.module \skinr_ui_element_is_skinable()

Fetch all theme_hooks that are compatible with active skins.

1 call to skinr_ui_element_is_skinable()
skinr_ui_test_skinable_element in skinr_ui/tests/modules/skinr_ui_test_skinable/skinr_ui_test_skinable.module

File

skinr_ui/skinr_ui.module, line 143
Handles Skinr UI functionality allowing users to apply skins to their site.

Code

function skinr_ui_element_is_skinable($module, $element) {
  $theme_hooks = skinr_theme_hooks($module, $element);
  $skinable_hooks = skinr_ui_get_skinable_hooks();
  if (isset($skinable_hooks['*'])) {

    // Skins exist that apply to any hook.
    return TRUE;
  }
  $theme_hooks = skinr_theme_hooks($module, $element);
  list($element_base) = explode('__', $element, 2);
  foreach ($theme_hooks as $theme_hook) {
    if (isset($skinable_hooks[$theme_hook])) {
      return TRUE;
    }
  }
  return FALSE;
}