function skinr_info_templates_filter in Skinr 6
Helper function to filter templates by preprocess_hook.
1 call to skinr_info_templates_filter()
- skinr_form_alter in ./
skinr.module - Implementation of hook_form_alter().
File
- ./
skinr.module, line 660
Code
function skinr_info_templates_filter($templates, $preprocess_hook) {
$filtered_templates = array();
foreach ($templates as $template) {
// If it exists, strip .tpl.php from template
$template = str_replace('.tpl.php', '', $template);
if (drupal_substr(str_replace('_', '-', $template), drupal_strlen($preprocess_hook) * -1) == str_replace('_', '-', $preprocess_hook)) {
$filtered_templates[] = $template;
}
}
return $filtered_templates;
}