You are here

function farm_install_blocks in farmOS 7

Callback for farmOS blocks install task.

File

./farm.install, line 245
farmOS install file.

Code

function farm_install_blocks() {

  // Update blocks for the farmOS theme.
  // We need to run _block_rehash() so that hook_block_info_alter() in
  // farm_theme has a chance to alter blocks provided by other farmOS modules
  // (eg: to enable/insert them into regions).
  // We need to override the global $theme variable and manually include the
  // theme's template.php file so that drupal_alter() runs its alter hooks.
  // @see https://github.com/farmOS/farmOS/issues/273
  global $theme;
  $old_theme = $theme;
  $theme = 'farm_theme';
  include_once drupal_get_path('theme', $theme) . '/template.php';
  _block_rehash($theme);
  $theme = $old_theme;
}