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

Diff of /contributions/modules/image_gallery_access/image_gallery_access.install

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

revision 1.8, Wed Feb 25 13:05:40 2009 UTC revision 1.9, Sun Sep 20 00:10:16 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: image_gallery_access.install,v 1.7 2009/02/19 23:43:25 salvis Exp $  // $Id: image_gallery_access.install,v 1.8 2009/02/25 13:05:40 salvis Exp $
3    
4  /**  /**
5   * Implementation of hook_install().   * Implementation of hook_install().
# Line 7  Line 7 
7  function image_gallery_access_install() {  function image_gallery_access_install() {
8    drupal_install_schema('image_gallery_access');    drupal_install_schema('image_gallery_access');
9    db_query("UPDATE {system} SET weight = 2 WHERE name = 'image_gallery_access'");    db_query("UPDATE {system} SET weight = 2 WHERE name = 'image_gallery_access'");
10    
11      if ($vid = _image_gallery_get_vid()) {
12        foreach (array(DRUPAL_ANONYMOUS_RID => 0, DRUPAL_AUTHENTICATED_RID => 1) as $rid => $grant_create) {
13          db_query("
14            INSERT INTO {image_gallery_access} (tid, rid, grant_view, grant_update, grant_delete, grant_create, priority)
15            SELECT t.tid, %d, 1, 0, 0, %d, 0
16              FROM {image_gallery_access} iga RIGHT JOIN {term_data} t ON iga.tid = t.tid AND t.vid = %d AND iga.rid <> %d
17                WHERE iga.tid IS NULL",
18            $rid, $grant_create, DRUPAL_AUTHENTICATED_RID, $vid
19          );
20        }
21      }
22  }  }
23    
24  /**  /**

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.9

  ViewVC Help
Powered by ViewVC 1.1.2