You are here

function skinr_ui_info_templates_filter in Skinr 6.2

Helper function to filter templates by preprocess_hooks.

1 call to skinr_ui_info_templates_filter()
skinr_ui_form_alter in ./skinr_ui.module
Implementation of hook_form_alter().

File

./skinr_ui.module, line 793

Code

function skinr_ui_info_templates_filter($templates, $preprocess_hooks) {
  $filtered_templates = array();
  foreach ($templates as $template) {

    // If it exists, strip .tpl.php from template.
    $template = str_replace('.tpl.php', '', $template);
    foreach ($preprocess_hooks as $preprocess_hook) {
      if (drupal_substr(str_replace('_', '-', $template), drupal_strlen($preprocess_hook) * -1) == str_replace('_', '-', $preprocess_hook)) {
        $filtered_templates[] = $template;
      }
    }
  }
  return $filtered_templates;
}