You are here

cms_blog.install in Glazed CMS Blog 7

Same filename and directory in other branches
  1. 8 cms_blog.install

Install, update and uninstall functions for the CMS Blog module.

File

cms_blog.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the CMS Blog module.
 */

/**
 * Implements hook_install().
 */
function cms_blog_install() {

  // Enable some standard blocks.
  $default_theme = variable_get('theme_default', 'bartik');
  $blocks = array(
    array(
      'cache' => '-1',
      'delta' => 'cms_blog-blog_authors',
      'module' => 'views',
      'pages' => "blog\nblog/*\ntags/*",
      'region' => 'sidebar_second',
      'status' => '1',
      'theme' => $default_theme,
      'visibility' => '1',
      'weight' => '0',
    ),
    array(
      'cache' => -'1',
      'delta' => '2',
      'module' => 'tagclouds',
      'pages' => "blog\nblog/*\ntags/*",
      'region' => 'sidebar_second',
      'status' => '1',
      'theme' => $default_theme,
      'visibility' => '1',
      'weight' => '1',
    ),
    array(
      'cache' => '-1',
      'delta' => 'cms_blog_cat-blog_categories',
      'module' => 'views',
      'pages' => "blog\nblog/*\ntags/*",
      'region' => 'sidebar_second',
      'status' => '1',
      'theme' => $default_theme,
      'visibility' => '1',
      'weight' => '2',
    ),
  );
  foreach ($blocks as $block) {
    db_merge('block')
      ->key(array(
      'module' => $block['module'],
      'delta' => $block['delta'],
      'theme' => $default_theme,
    ))
      ->fields($block)
      ->execute();
  }
  module_enable(array(
    'comment',
  ));
}

Functions

Namesort descending Description
cms_blog_install Implements hook_install().