sharerich.install in Sharerich 7
Same filename and directory in other branches
Install hooks for Sharerich project.
File
sharerich.installView 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
Name | Description |
---|---|
sharerich_install | Implements hook_install(). |
sharerich_uninstall | Implements hook_uninstall(). |