/[drupal]/contributions/modules/tac_lite/tac_lite.install
ViewVC logotype

Diff of /contributions/modules/tac_lite/tac_lite.install

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

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

Legend:
Removed from v.1.3  
changed lines
  Added in v.1.3.2.1

  ViewVC Help
Powered by ViewVC 1.1.2