You are here

yashare.install in Yandex.Share 7.2

Same filename and directory in other branches
  1. 7 yashare.install

Install, update, and uninstall functions for the Yandex.Share module.

File

yashare.install
View source
<?php

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

/**
 * Implements hook_uninstall().
 */
function yashare_uninstall() {
  variable_del('yashare_type');
  variable_del('yashare_border');
  variable_del('yashare_linkunderline');
  variable_del('yashare_linkicon');
  variable_del('yashare_image');
  variable_del('yashare_block_title');
  variable_del('yashare_block_services');
  variable_del('yashare_popup_services');
  variable_del('yashare_l10n');
  variable_del('yashare_popup_title');
  variable_del('yashare_popup_link');
  variable_del('yashare_popup_codeforblog');
  variable_del('yashare_popup_vdirection');
  variable_del('yashare_theme');
  variable_del('yashare_init_type');
  foreach (entity_get_info() as $entity_name => $entity) {
    foreach (array_keys($entity['bundles']) as $bundle) {
      $field_bundle_setting = field_bundle_settings($entity_name, $bundle);
      if (!empty($field_bundle_setting['extra_fields']['display']['yashare'])) {
        unset($field_bundle_setting['extra_fields']['display']['yashare']);
        field_bundle_settings($entity_name, $bundle, $field_bundle_setting);
      }
    }
  }
}

/**
 * Force widget initialization type to "standard" for users of previous version
 * as there was no "automatic" initialization type and we want "automatic" to
 * be default for new installations.
 */
function yashare_update_7200() {
  variable_set('yashare_init_type', 'standard');
}

Functions

Namesort descending Description
yashare_uninstall Implements hook_uninstall().
yashare_update_7200 Force widget initialization type to "standard" for users of previous version as there was no "automatic" initialization type and we want "automatic" to be default for new installations.