You are here

twitter_post.install in Twitter 6.5

Install, update and uninstall functions for the twitter module.

File

twitter_post/twitter_post.install
View source
<?php

/**
 * @file
 * Install, update and uninstall functions for the twitter module.
 *
 */

/**
 * Implements hook_uninstall().
 */
function twitter_post_uninstall() {
  variable_del('twitter_post_types');
  variable_del('twitter_post_default_format');
  variable_del('twitter_post_default_value');
  variable_del('twitter_post_on_update');
}

/**
 * Implementations of hook_update_N().
 */

/**
 * Add the new "post to twitter with global account" permission to all roles
 * that have the "post to twitter" permission.
 */
function twitter_post_update_6200() {
  $result = db_query("SELECT rid\n    FROM {permission}\n    WHERE perm = 'post to twitter'");
  while ($row = db_fetch_object($result)) {
    $record = new StdClass();
    $record->rid = $row->rid;
    $record->perm = 'post to twitter with global account';
    $record->tid = 0;
    drupal_write_record('permission', $record);
  }
  drupal_set_message(t('A new permission "Post a message to Twitter using a global account" as been added to all roles that already had the "Post a message to Twitter" permission. It is recommended to <a href="@url">review the permissions</a> to ensure they are appropriate for this site\'s needs.', array(
    '@url' => url('admin/people/permissions'),
  )));
  return array();
}

Functions

Namesort descending Description
twitter_post_uninstall Implements hook_uninstall().
twitter_post_update_6200 Add the new "post to twitter with global account" permission to all roles that have the "post to twitter" permission.