You are here

clean_markup_blocks.install in Clean Markup 7

File

modules/clean_markup_blocks/clean_markup_blocks.install
View source
<?php

/**
 * @file
 * Installs the clean_markup_blocks module.
 */
module_load_include('module', 'clean_markup_blocks', 'clean_markup_blocks');

/**
 * Implements hook_install().
 */
function clean_markup_blocks_install() {
  $defaults = array(
    'block_wrapper' => 'div',
    'additional_block_classes' => '',
    'enable_inner_div' => FALSE,
    'title_wrapper' => 'h2',
    'title_hide' => FALSE,
    'content_wrapper' => CLEAN_MARKUP_BLOCK_NO_ELEMENT,
    'block_html_id_as_class' => TRUE,
  );

  // Save default settings for all blocks.
  variable_set('clean_markup_blocks-defaults', $defaults);
}

/**
 * Implements hook_uninstall().
 */
function clean_markup_blocks_uninstall() {

  // Delete all variables in this module's namespace.
  db_delete('variable')
    ->condition('name', 'clean_markup_blocks-%', 'LIKE')
    ->execute();
}

/**
 * Sets default content wrapper to "No element".
 */
function clean_markup_blocks_update_7100(&$sandbox) {
  $defaults = variable_get('clean_markup_blocks-defaults', array());
  $defaults['content_wrapper'] = CLEAN_MARKUP_NO_ELEMENT;
  variable_set('clean_markup_blocks-defaults', $defaults);
}

/**
 * Adds block_html_id_as_class setting.
 */
function clean_markup_blocks_update_7200(&$sandbox) {
  $defaults = variable_get('clean_markup_blocks-defaults', array());
  $defaults['block_html_id_as_class'] = TRUE;
  variable_set('clean_markup_blocks-defaults', $defaults);
}

Functions

Namesort descending Description
clean_markup_blocks_install Implements hook_install().
clean_markup_blocks_uninstall Implements hook_uninstall().
clean_markup_blocks_update_7100 Sets default content wrapper to "No element".
clean_markup_blocks_update_7200 Adds block_html_id_as_class setting.