You are here

responsive_share_buttons.install in Responsive Share Buttons 7

Install and update hooks.

File

responsive_share_buttons.install
View source
<?php

/**
 * @file
 * Install and update hooks.
 */

/**
 * Implements hook_install().
 */
function responsive_share_buttons_install() {
  variable_set('responsive_share_buttons', _responsive_share_buttons_defaults());
}

/**
 * Provide default settings.
 */
function _responsive_share_buttons_defaults() {
  $networks = array(
    'facebook',
    'twitter',
    'digg',
    'stumbleupon',
    'delicious',
    'google',
    'linkedin',
    'pinterest',
  );
  foreach ($networks as $network) {
    $defaults[$network] = array(
      'active' => TRUE,
      'weight' => 0,
    );
  }
  return $defaults;
}

/**
 * Implements hook_uninstall().
 */
function responsive_share_buttons_uninstall() {
  variable_del('responsive_share_buttons');
}

/**
 * Set default social networks.
 */
function responsive_share_buttons_update_7100() {
  variable_set('responsive_share_buttons', _responsive_share_buttons_defaults());
}

Functions