You are here

clients_flickr.install in Web Service Clients 6

Same filename and directory in other branches
  1. 7 backends/clients_flickr/clients_flickr.install

Sets variables and deletes connections on uninstall @todo delete resources on uninstall

@author Django Beatty - adub

File

backends/clients_flickr/clients_flickr.install
View source
<?php

/**
 * @file
 * Sets variables and deletes connections on uninstall
 * @todo delete resources on uninstall 
 * 
 * @author Django Beatty - adub
 */

/**
 * Implementation of hook_install().
 */
function clients_flickr_install() {
  $weight = (int) db_result(db_query("SELECT weight FROM {system} WHERE name = 'clients'"));
  db_query("UPDATE {system} SET weight = %d WHERE name = 'clients_flickr'", $weight + 1);
  variable_set('clients_flickr_type', 'Flickr');
  drupal_set_message(t('Clients Flickr backend installed'));
}

/**
 * Implementation of hook_uninstall().
 */
function clients_flickr_uninstall() {

  // remove any drupal services from connections table
  db_query("DELETE {clients_connections} FROM {clients_connections} \n      WHERE {clients_connections}.type = '%s'", variable_get('clients_flickr_type', 'Flickr'));

  // clean up any variables created by module
  $module_variables = array(
    'clients_flickr_type',
  );
  foreach ($module_variables as $module_variable) {
    variable_del($module_variable);
  }
}

Functions

Namesort descending Description
clients_flickr_install Implementation of hook_install().
clients_flickr_uninstall Implementation of hook_uninstall().