| 1 |
<?php
|
| 2 |
// $Id: tac_lite.install,v 1.2.2.1 2008/06/04 04:31:54 yogadex Exp $
|
| 3 |
/**
|
| 4 |
* Implementation of hook_install()
|
| 5 |
*
|
| 6 |
* This function modifies the database as needed when tac_lite is installed.
|
| 7 |
*/
|
| 8 |
function tac_lite_install() {
|
| 9 |
// Ensure we come after taxonomy.
|
| 10 |
db_query("UPDATE {system} SET weight = 9 WHERE name = 'tac_lite'");
|
| 11 |
|
| 12 |
// Note that it is not necessary to rebuild the node access table here, as
|
| 13 |
// that will be done when module settings are saved.
|
| 14 |
}
|
| 15 |
|
| 16 |
/**
|
| 17 |
* Ensure that tac_lite hooks are invoked after taxonomy module hooks.
|
| 18 |
*/
|
| 19 |
function tac_lite_update_1() {
|
| 20 |
$ret[] = update_sql("UPDATE {system} SET weight = 9 WHERE name = 'tac_lite'");
|
| 21 |
return $ret;
|
| 22 |
}
|
| 23 |
|
| 24 |
/**
|
| 25 |
* Ensure that the node_access table is thoroughly cleaned up.
|
| 26 |
*/
|
| 27 |
function tac_lite_update_2() {
|
| 28 |
$ret = array();
|
| 29 |
// node_access_rebuild function introduced in drupal 5 will ensure that the node_access
|
| 30 |
// table is correct.
|
| 31 |
node_access_rebuild();
|
| 32 |
$ret[] = array('success' => TRUE, // assume success
|
| 33 |
'query' => t('Rebuilt node access table for tac_lite module.'));
|
| 34 |
return $ret;
|
| 35 |
}
|
| 36 |
|
| 37 |
/**
|
| 38 |
* Introducing schemes. Rename tac_lite_default_grants to tac_lite_grants_scheme_1.
|
| 39 |
*/
|
| 40 |
function tac_lite_update_3() {
|
| 41 |
$ret = array();
|
| 42 |
$ret[] = update_sql("UPDATE {variable} SET name='tac_lite_grants_scheme_1' WHERE name='tac_lite_default_grants'");
|
| 43 |
return $ret;
|
| 44 |
}
|
| 45 |
|
| 46 |
|
| 47 |
?>
|