Advertisement
b0r7

hook_theme_registry_alter issue

Jun 25th, 2013
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.95 KB | None | 0 0
  1. /*
  2. Below are the functions and places i cannot get my head around
  3. i try to override a functionality in (1) whith a theme_preprocess function (3) but..
  4. there is a registry_alter function (2) and my overrides in the template.php are not kicking in..
  5. what can i do?
  6. */
  7.  
  8.  
  9. /*
  10. * 1: function in date.module
  11. * (modules\calendar\theme\theme.inc)
  12. */
  13.  
  14. function template_preprocess_calendar_datebox(&$vars) {
  15. // do this and that
  16. }
  17.  
  18. /*
  19. * 2: function in calendar_tooltips.module
  20. * (modules\calendar_tooltips\calendar_tooltips.module)
  21. */
  22.  
  23. function calendar_tooltips_theme_registry_alter(&$theme_registry) {
  24.   if (!empty($theme_registry['preprocess_calendar_datebox'])) {
  25.     $theme_registry['preprocess_calendar_datebox']['function'] =
  26.       'calendar_tooltips_preprocess_calendar_datebox';
  27.   }
  28. // (..other stuff)
  29. }
  30.  
  31. /*
  32. * 3: function in a mytheme
  33. * themes\mytheme\template.php
  34. */
  35.  
  36.  
  37. function mytheme_preprocess_calendar_datebox(&$vars) {
  38. // do stuff
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement