popup_message.install in Popup message 6
Same filename and directory in other branches
Install, update and uninstall functions for the Popup message module.
File
popup_message.installView source
<?php
/**
* @file
* Install, update and uninstall functions for the Popup message module.
*/
/**
* Implementation of hook_requirements().
*/
function popup_message_requirements($phase) {
$requirements = array();
if ($phase == 'runtime') {
$library_path = popup_message_get_jquerycookie_path();
if (!file_exists($library_path . '/jquery.cookie.js')) {
$requirements['popup_message_jquerycookie'] = array(
'title' => t('jQuery.cookie.js'),
'value' => t('jQuery.cookie.js plugin is missing'),
'severity' => REQUIREMENT_ERROR,
'description' => t('You need to download the !jquerycookie and extract file into the %path folder of your server.', array(
'!jquerycookie' => l(t('jquery.cookie.js file'), 'https://github.com/carhartl/jquery-cookie/'),
'%path' => $library_path,
)),
);
}
}
return $requirements;
}
/**
* Implementation of hook_uninstall().
*/
function popup_message_install() {
drupal_set_message(t('Popup message: Go to "Site configuration -> Popup message" and set popup message title and body'));
}
/**
* Implementation of hook_uninstall().
*/
function popup_message_uninstall() {
variable_del('popup_message_title');
variable_del('popup_message_body_text');
variable_del('popup_message_body_format');
variable_del('popup_message_enable');
variable_del('popup_message_check_cookie');
}
Functions
Name | Description |
---|---|
popup_message_install | Implementation of hook_uninstall(). |
popup_message_requirements | Implementation of hook_requirements(). |
popup_message_uninstall | Implementation of hook_uninstall(). |