You are here

block_aria_landmark_roles.install in Block ARIA Landmark Roles 7

Install, update, and uninstall functions for the Blocks ARIA Landmark Roles module.

File

block_aria_landmark_roles.install
View source
<?php

/**
 * @file
 * Install, update, and uninstall functions for the Blocks ARIA Landmark Roles module.
 */

/**
 * Implements hook_schema().
 *
 * Creates a new database table when the module is installed.
 */
function block_aria_landmark_roles_schema() {
  $schema['block_aria_landmark_roles'] = array(
    'description' => 'Stores ARIA landmark roles assigned to blocks',
    'fields' => array(
      'module' => array(
        'description' => 'The name of the module that generates the block',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
      'delta' => array(
        'description' => 'The delta value of the block',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
      'role' => array(
        'description' => 'The assigned landmark role',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
    ),
  );
  $schema['block_aria_landmark_roles_label'] = array(
    'description' => 'Stores ARIA labels assigned to blocks',
    'fields' => array(
      'module' => array(
        'description' => 'The name of the module that generates the block',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
      'delta' => array(
        'description' => 'The delta value of the block',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
      'label' => array(
        'description' => 'The assigned label',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
    ),
  );
  return $schema;
}

/**
 * Remove the primary key from the table.
 */
function block_aria_landmark_roles_update_7100() {
  db_drop_primary_key('block_aria_landmark_roles');
}

/**
 * Rename the 'aria_role' column to 'role'.
 */
function block_aria_landmark_roles_update_7101() {
  $spec = array(
    'description' => 'The assigned landmark role',
    'type' => 'varchar',
    'length' => '255',
    'not null' => TRUE,
    'default' => '',
  );
  db_change_field('block_aria_landmark_roles', 'aria_role', 'role', $spec);
}

/**
 * Add a new table for ARIA labels.
 */
function block_aria_landmark_roles_update_7102() {
  $schema = array(
    'description' => 'Stores ARIA labels assigned to blocks',
    'fields' => array(
      'module' => array(
        'description' => 'The name of the module that generates the block',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
      'delta' => array(
        'description' => 'The delta value of the block',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
      'label' => array(
        'description' => 'The assigned label',
        'type' => 'varchar',
        'length' => '255',
        'not null' => TRUE,
        'default' => '',
      ),
    ),
  );
  db_create_table('block_aria_landmark_roles_label', $schema);
}

Functions

Namesort descending Description
block_aria_landmark_roles_schema Implements hook_schema().
block_aria_landmark_roles_update_7100 Remove the primary key from the table.
block_aria_landmark_roles_update_7101 Rename the 'aria_role' column to 'role'.
block_aria_landmark_roles_update_7102 Add a new table for ARIA labels.