Fix for Replace theme functions in live code.

  1. /**
  2.  * Clever hack to hide display of blocks during wizard.
  3.  *
  4.  * The wizard installation tries to keep things as simple and uncluttered
  5.  * as possible, making basic use of the menus and forms.
  6.  *
  7.  * This uses eval to replace the theme_block function implementation.
  8.  * It's done this way so it doesn't affect the interface of the rest
  9.  * of the site, and just clicking on home will make the site render
  10.  * normally.
  11.  *
  12.  * Only way this could break is if the theme already had a $theme_block,
  13.  * which i consider unlikely, as most themes are phptemplate based these days.
  14.  *
  15.  * This could probably work for a number of theme functions.
  16.  */
  17. function hosting_wizard_dummy_theme_block() {
  18.   $func = $GLOBALS['conf']['theme_default'] . "_block";
  19.  
  20.   if (!function_exists($func)) {
  21.     drupal_eval("<?php function $func() { return ' ';}");
  22.   }
  23. }
  24.  
  25.  
  26.  
  27. function hook_wizard_menu($may_cache) {
  28.   if (!$may_cache && (sprintf("%s/%s", arg(0), arg(1)) == 'hosting/wizard')) {
  29.     hosting_wizard_dummy_theme_block();
  30.   }
  31. }
  32.  
  33.