You are here

function cms_events_install in Glazed CMS Events 7

Same name and namespace in other branches
  1. 8 cms_events.install \cms_events_install()

Implements hook_install().

File

./cms_events.install, line 12
Install, update and uninstall functions for the CMS Events module.

Code

function cms_events_install() {

  // Enable some standard blocks.
  $default_theme = variable_get('theme_default', 'bartik');
  $blocks = array(
    array(
      'cache' => '-1',
      'delta' => 'cms_events-monthly_archive',
      'module' => 'views',
      'pages' => "events\nevents/*\nevents-archive\nevents-archive/*",
      'region' => 'sidebar_second',
      'status' => '1',
      'theme' => $default_theme,
      'title' => 'Events Archive',
      'visibility' => '1',
      'weight' => '0',
    ),
  );
  foreach ($blocks as $block) {
    db_merge('block')
      ->key(array(
      'module' => $block['module'],
      'delta' => $block['delta'],
      'theme' => $default_theme,
    ))
      ->fields($block)
      ->execute();
  }
}