You are here

i18n_access.install in Translation Access 6

Same filename and directory in other branches
  1. 7 i18n_access.install

file_description

File

i18n_access.install
View source
<?php

/**
 * @file
 * file_description
 */

/**
 * Implementation of hook_schema().
 */
function i18n_access_schema() {
  $schema['i18n_access'] = array(
    'description' => 'Store language permissions per user',
    'fields' => array(
      'uid' => array(
        'description' => 'The primary identifier for a user.',
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'perm' => array(
        'description' => 'List of languages that the user has permission for.',
        'type' => 'text',
        'not null' => FALSE,
        'size' => 'big',
      ),
    ),
    'primary key' => array(
      'uid',
    ),
  );
  return $schema;
}

/**
 * Implementation of hook_install().
 */
function i18n_access_install() {
  drupal_install_schema('i18n_access');

  // Set module weight for it to run after core and i18n modules
  db_query("UPDATE {system} SET weight = 20 WHERE name = 'i18n_access' AND type = 'module'");
}

/**
 * Implementation of hook_uninstall().
 */
function i18n_access_uninstall() {
  drupal_uninstall_schema('i18n_access');
}

/**
 * Implementation of hook_update_xxxx().
 */
function i18n_access_update_6100() {
  $ret = array();

  // http://drupal.org/node/697324 Accidentally implements hook_node_access()
  // clear cache to rebuild the menu access callback
  drupal_flush_all_caches();
  return $ret;
}

Functions

Namesort descending Description
i18n_access_install Implementation of hook_install().
i18n_access_schema Implementation of hook_schema().
i18n_access_uninstall Implementation of hook_uninstall().
i18n_access_update_6100 Implementation of hook_update_xxxx().