You are here

fieldgroup.install in Content Construction Kit (CCK) 6

File

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

// Updates happen in random order, whether or not the module is enabled,
// so include critical code here just to be sure.
include_once './' . drupal_get_path('module', 'content') . '/content.module';

/**
 * Implementation of hook_install().
 */
function fieldgroup_install() {
  drupal_install_schema('fieldgroup');
  content_notify('install', 'fieldgroup');
  variable_set('fieldgroup_schema_version', 6000);
}

/**
 * Implementation of hook_uninstall().
 */
function fieldgroup_uninstall() {
  drupal_uninstall_schema('fieldgroup');
  content_notify('uninstall', 'fieldgroup');
}

/**
 * Implementation of hook_enable().
 *
 * Notify content module when this module is enabled.
 */
function fieldgroup_enable() {
  content_notify('enable', 'fieldgroup');
}

/**
 * Implementation of hook_disable().
 *
 * Notify content module when this module is disabled.
 */
function fieldgroup_disable() {
  content_notify('disable', 'fieldgroup');
}
function fieldgroup_update_last_removed() {
  return 4;
}

/**
 * Implementation of hook_schema.
 */
function fieldgroup_schema() {
  $schema['content_group'] = array(
    'fields' => array(
      'type_name' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'group_name' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'label' => array(
        'type' => 'varchar',
        'length' => 255,
        'not null' => TRUE,
        'default' => '',
      ),
      'settings' => array(
        'type' => 'text',
        'size' => 'medium',
        'not null' => TRUE,
      ),
      'weight' => array(
        'type' => 'int',
        'size' => 'tiny',
        'not null' => TRUE,
        'default' => 0,
      ),
    ),
    'primary key' => array(
      'type_name',
      'group_name',
    ),
  );
  $schema['content_group_fields'] = array(
    'fields' => array(
      'type_name' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'group_name' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
      'field_name' => array(
        'type' => 'varchar',
        'length' => 32,
        'not null' => TRUE,
        'default' => '',
      ),
    ),
    'primary key' => array(
      'type_name',
      'group_name',
      'field_name',
    ),
  );
  return $schema;
}

/**
 * Placeholder update to set newly installed versions to the latest update number.
 */
function fieldgroup_update_6000() {
  $ret = array();
  return $ret;
}

Functions

Namesort descending Description
fieldgroup_disable Implementation of hook_disable().
fieldgroup_enable Implementation of hook_enable().
fieldgroup_install Implementation of hook_install().
fieldgroup_schema Implementation of hook_schema.
fieldgroup_uninstall Implementation of hook_uninstall().
fieldgroup_update_6000 Placeholder update to set newly installed versions to the latest update number.
fieldgroup_update_last_removed