You are here

closeblock.module in Close Block 7

Same filename and directory in other branches
  1. 8 closeblock.module
  2. 6 closeblock.module

Add close button to blocks.

File

closeblock.module
View source
<?php

/**
 * @file
 * Add close button to blocks.
 */
define('CLOSEBLOCK_ACTIVE', 0);
define('CLOSEBLOCK_CUSTOM', 0);
define('CLOSEBLOCK_TYPE', 2);
define('CLOSEBLOCK_SPEED', 500);
define('CLOSEBLOCK_SAVE', 1);
define('CLOSEBLOCK_COUNT', 1);
define('CLOSEBLOCK_FREQUENCY', '');
define('CLOSEBLOCK_BUTTON_TEXT', 'close');
require_once 'includes/closeblock.api.inc';
require_once 'includes/closeblock.form.inc';
require_once 'model/closeblock.db.inc';

/**
 * Implements hook_permission().
 */
function closeblock_permission() {
  return array(
    'closeblock' => array(
      'title' => t('Close block'),
      'description' => t('Add close button to block.'),
    ),
  );
}

/**
 * Implements hook_init().
 */
function closeblock_init() {
  closeblock_initialization();
}

/**
 * Implements hook_menu().
 */
function closeblock_menu() {
  $items = array();
  $items['closeblock/%/%'] = array(
    'title' => 'Closeblock',
    'page callback' => 'closeblock_ajax_callback',
    'page arguments' => array(
      1,
      2,
    ),
    'access arguments' => array(
      'closeblock',
    ),
  );
  return $items;
}

/**
 * Implements hook_theme().
 */
function closeblock_theme($existing, $type, $theme, $path) {
  return array(
    'closeblock_block_id' => array(
      'path' => $path . '/theme',
      'file' => 'closeblock.theme.inc',
    ),
  );
}

/**
 * Implements hook_block_view_alter().
 */
function closeblock_block_view_alter(&$data, $block) {
  closeblock_ajax_settings($data, $block);
}

/**
 * Implements hook_form_FORM_ID_alter().
 */
function closeblock_form_system_theme_settings_alter(&$form, $form_state) {
  closeblock_system_theme_settings($form, $form_state);
}

/**
 * Implements hook_form_FORM_ID_alter().
 */
function closeblock_form_block_admin_configure_alter(&$form, $form_state) {
  closeblock_block_admin_configure($form, $form_state);
}

/**
 * Implements hook_form_FORM_ID_alter().
 */
function closeblock_form_block_add_block_form_alter(&$form, $form_state) {
  closeblock_block_admin_configure($form, $form_state);
}