You are here

term_permissions.install in Taxonomy Term Permissions 6

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

File

term_permissions.install
View source
<?php

/**
 * Implementation of hook_install()
 */
function term_permissions_install() {
  $ret = array();
  $results = drupal_install_schema('term_permissions');
  $install_pass = TRUE;
  foreach ($results as $result) {
    if (!$result['success']) {
      $install_pass = FALSE;
    }
  }
  if (!$install_pass) {
    drupal_set_message(t('There was an error installing the Taxonomy Term Permissions module. The <a href="@watchdog-url">error log</a> may have more information about the error.', array(
      '@watchdog-url' => url('admin/reports/dblog'),
    )), 'error');
  }
}

/**
 * Implementation of hook_schema()
 */
function term_permissions_schema() {
  $schema = array();
  $schema['term_permissions_user'] = array(
    'fields' => array(
      'tid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'uid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'tid',
      'uid',
    ),
  );
  $schema['term_permissions_role'] = array(
    'fields' => array(
      'tid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'rid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
    'primary key' => array(
      'tid',
      'rid',
    ),
  );
  return $schema;
}

/**
 * Implementation of hook_uninstall().
 */
function term_permissions_uninstall() {
  drupal_uninstall_schema('term_permissions');
}

Functions

Namesort descending Description
term_permissions_install Implementation of hook_install()
term_permissions_schema Implementation of hook_schema()
term_permissions_uninstall Implementation of hook_uninstall().