vertical_tabs_config.install in Vertical Tabs Config 7
Same filename and directory in other branches
Install and uninstall handling of module.
File
vertical_tabs_config.installView source
<?php
/**
 * @file
 * Install and uninstall handling of module.
 */
/**
 * Implements hook_enable().
 *
 * Force late execution of this module.
 */
function vertical_tabs_config_enable() {
  db_update('system')
    ->fields(array(
    'weight' => 1001,
  ))
    ->condition('type', 'module')
    ->condition('name', 'vertical_tabs_config')
    ->execute();
}
/**
 * Implements hook_uninstall().
 */
function vertical_tabs_config_uninstall() {
  $cur_path = drupal_get_path('module', 'vertical_tabs_config');
  require_once DRUPAL_ROOT . '/' . $cur_path . '/vertical_tabs_config.module';
  db_delete('variable')
    ->condition('name', 'vertical_tabs_config_%', 'LIKE')
    ->execute();
}
/**
 * Implements hook_schema().
 */
function vertical_tabs_config_schema() {
  $schema = array();
  $schema['vertical_tabs_config'] = array(
    'description' => 'Module configuration',
    'fields' => array(
      'id' => array(
        'description' => 'Primary key: ID de registro.',
        'type' => 'serial',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'vertical_tab' => array(
        'description' => 'Vertical tab name',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'content_type' => array(
        'description' => 'CT machine name',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'roles' => array(
        'description' => 'Roles compressed in json',
        'type' => 'text',
        'not null' => TRUE,
      ),
      'hidden' => array(
        'description' => 'Indicates if option is visible or not',
        'type' => 'int',
        'length' => 1,
        'not null' => TRUE,
        'default' => '0',
      ),
    ),
    'primary key' => array(
      'id',
    ),
  );
  return $schema;
}Functions
| Name   | Description | 
|---|---|
| vertical_tabs_config_enable | Implements hook_enable(). | 
| vertical_tabs_config_schema | Implements hook_schema(). | 
| vertical_tabs_config_uninstall | Implements hook_uninstall(). | 
