You are here

sharerich.install in Sharerich 7

Same filename and directory in other branches
  1. 8 sharerich.install
  2. 7.3 sharerich.install
  3. 7.2 sharerich.install

Install hooks for Sharerich project.

File

sharerich.install
View source
<?php

/**
 * @file
 * Install hooks for Sharerich project.
 */

/**
 * Implements hook_install().
 */
function sharerich_install() {
  if (libraries_load('rrssb')) {
    variable_set('sharerich_add_js', libraries_get_path('rrssb') . '/js/rrssb.min.js');
    variable_set('sharerich_add_css', libraries_get_path('rrssb') . '/css/rrssb.css' . PHP_EOL . drupal_get_path('module', 'sharerich') . '/css/sharerich.css');
  }
}

/**
 * Implements hook_uninstall().
 */
function sharerich_uninstall() {
  module_load_include('module', 'sharerich');

  // Clean entity configurations.
  foreach (node_type_get_types() as $node) {
    variable_del('sharerich_node_' . $node->type);
  }

  // Clean service configurations.
  foreach (sharerich_get_services() as $service_name) {
    variable_del('sharerich_node_' . $service_name);
  }

  // Clean all the rest.
  variable_del('sharerich_services');
  variable_del('sharerich_youtube_username');
  variable_del('sharerich_github_username');
  variable_del('sharerich_facebook_app_id');
  variable_del('sharerich_facebook_site_url');
  variable_del('sharerich_add_js');
  variable_del('sharerich_add_css');
}

Functions

Namesort descending Description
sharerich_install Implements hook_install().
sharerich_uninstall Implements hook_uninstall().