function date_ical_theme_registry_alter in Date iCal 7
Implements hook_theme_registry_alter().
Technique borrowed from Display Suite module. Add a custom preprocess hook that will work for all types of entities
File
- ./
date_ical.module, line 147 - Adds ical functionality to Views.
Code
function date_ical_theme_registry_alter(&$theme_registry) {
$entity_info = entity_get_info();
foreach ($entity_info as $entity => $info) {
// User uses user_profile for theming.
if ($entity == 'user') {
$entity = 'user_profile';
}
// Only add preprocess functions if entity exposes theme function.
if (isset($theme_registry[$entity])) {
$theme_registry[$entity]['preprocess functions'][] = 'date_ical_preprocess_date_ical';
}
}
// Support for File Entity.
if (isset($theme_registry['file_entity'])) {
$theme_registry['file_entity']['preprocess functions'][] = 'date_ical_preprocess_date_ical';
}
// Support for Entity API.
if (isset($theme_registry['entity'])) {
$theme_registry['entity']['preprocess functions'][] = 'date_ical_preprocess_date_ical';
}
}