Commit c6545d1a authored by Karen Stevenson's avatar Karen Stevenson

Issue #1447194 by tim.plunkett, Prevent date_ical_preprocess from running for every theme function.

parent edbed841
Date iCal 7.x
=================
===================
Version 7.x-1.x-dev
===================
===================
Version 7.x-1.0
===================
- Issue #1447194 by tim.plunkett, Prevent date_ical_preprocess from running for every theme function.
- Issue #1447118 by tim.plunkett: Use properly namespaced template functions.
- Issue #1447104 by tim.plunkett: Fixed code clean-up and undefined notices.
- Issue #1446936 by tim.plunkett: Views display format will not save.
- Initial commit of D7 code.
\ No newline at end of file
......@@ -138,18 +138,18 @@ function date_ical_theme_registry_alter(&$theme_registry) {
// Only add preprocess functions if entity exposes theme function.
if (isset($theme_registry[$entity])) {
$theme_registry[$entity]['preprocess functions'][] = 'date_ical_preprocess';
$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';
$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';
$theme_registry['entity']['preprocess functions'][] = 'date_ical_preprocess_date_ical';
}
}
......@@ -157,7 +157,7 @@ function date_ical_theme_registry_alter(&$theme_registry) {
* Technique borrowed from Display Suite module.
* Add ical template suggestions to all types of entities.
*/
function date_ical_preprocess(&$vars, $hook) {
function date_ical_preprocess_date_ical(&$vars) {
if (isset($vars['elements']) && isset($vars['elements']['#entity_type']) && isset($vars['elements']['#bundle']) && isset($vars['view_mode']) && $vars['view_mode'] == 'ical') {
$vars['theme_hook_suggestions'][] = $vars['elements']['#entity_type'] . '__ical';
$vars['theme_hook_suggestions'][] = $vars['elements']['#entity_type'] . '__' . $vars['elements']['#bundle'] . '__ical';
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment