You are here

mobile_tools_roles.install in Mobile Tools 6.3

Mobile Tools Roles installation file

File

mobile_tools_roles.install
View source
<?php

// $Id:

/**
 * @file
 *  Mobile Tools Roles installation file
 */
function mobile_tools_roles_install() {
  drupal_install_schema('mobile_tools_roles');
}
function mobile_tools_roles_uninstall() {
  $query = "SELECT * FROM {mobile_tools_roles_relations}";
  $result = db_query($query);
  while ($item = db_fetch_object($result)) {
    db_query("DELETE FROM {role} WHERE rid = %d", $item->mrid);
  }
  drupal_uninstall_schema('mobile_tools_roles');
  variable_del('mobile_tools_roles');
  variable_del('mobile_tools_enable_roles');
}

/**
 * Installing the Mobile Tools roles schema
 */
function mobile_tools_roles_schema() {
  $schema['mobile_tools_roles_relations'] = array(
    'fields' => array(
      'rid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
      'mrid' => array(
        'type' => 'int',
        'unsigned' => TRUE,
        'not null' => TRUE,
      ),
    ),
  );
  return $schema;
}

/**
 * Update to invalidate context registry and include the new registry
 */
function mobile_tools_update_6200() {
  content_flush_caches();
}

Functions

Namesort descending Description
mobile_tools_roles_install @file Mobile Tools Roles installation file
mobile_tools_roles_schema Installing the Mobile Tools roles schema
mobile_tools_roles_uninstall
mobile_tools_update_6200 Update to invalidate context registry and include the new registry