You are here

tac_lite.install in Taxonomy Access Control Lite 5

Same filename and directory in other branches
  1. 8 tac_lite.install
  2. 6 tac_lite.install
  3. 7 tac_lite.install

File

tac_lite.install
View source
<?php

/**
 * Implementation of hook_install()
 * 
 * This function modifies the database as needed when tac_lite is installed.
 */
function tac_lite_install() {

  // Ensure we come after taxonomy.
  db_query("UPDATE {system} SET weight = 9 WHERE name = 'tac_lite'");

  // Note that it is not necessary to rebuild the node access table here, as
  // that will be done when module settings are saved.
}

/**
 * Ensure that tac_lite hooks are invoked after taxonomy module hooks.
 */
function tac_lite_update_1() {
  $ret[] = update_sql("UPDATE {system} SET weight = 9 WHERE name = 'tac_lite'");
  return $ret;
}

/**
 * Ensure that the node_access table is thoroughly cleaned up.
 */
function tac_lite_update_2() {
  $ret = array();

  // node_access_rebuild function introduced in drupal 5 will ensure that the node_access
  // table is correct.
  node_access_rebuild();
  $ret[] = array(
    'success' => TRUE,
    // assume success
    'query' => t('Rebuilt node access table for tac_lite module.'),
  );
  return $ret;
}

/**
 * Introducing schemes.  Rename tac_lite_default_grants to tac_lite_grants_scheme_1.
 */
function tac_lite_update_3() {
  $ret = array();
  $ret[] = update_sql("UPDATE {variable} SET name='tac_lite_grants_scheme_1' WHERE name='tac_lite_default_grants'");
  return $ret;
}

Functions

Namesort descending Description
tac_lite_install Implementation of hook_install()
tac_lite_update_1 Ensure that tac_lite hooks are invoked after taxonomy module hooks.
tac_lite_update_2 Ensure that the node_access table is thoroughly cleaned up.
tac_lite_update_3 Introducing schemes. Rename tac_lite_default_grants to tac_lite_grants_scheme_1.