| 1 |
<?php
|
| 2 |
// $Id$
|
| 3 |
/**
|
| 4 |
* @file
|
| 5 |
* Install file for the Image Mapper Module
|
| 6 |
*
|
| 7 |
* @notes
|
| 8 |
*
|
| 9 |
* @todo
|
| 10 |
*/
|
| 11 |
|
| 12 |
/**
|
| 13 |
* Implementation of hook_enable().
|
| 14 |
*/
|
| 15 |
function gmapfield_enable() {
|
| 16 |
// CCK prep
|
| 17 |
drupal_load('module', 'content');
|
| 18 |
content_notify('enable', 'gmapfield');
|
| 19 |
// Set a message to the user
|
| 20 |
$t_array = array(
|
| 21 |
'@module' => 'GMap Field',
|
| 22 |
);
|
| 23 |
drupal_set_message(t('@module enabled;', $t_array));
|
| 24 |
}
|
| 25 |
|
| 26 |
|
| 27 |
/**
|
| 28 |
* Implementation of hook_disable().
|
| 29 |
*/
|
| 30 |
function gmapfield_disable() {
|
| 31 |
// CCK prep
|
| 32 |
drupal_load('module', 'content');
|
| 33 |
content_notify('disable', 'gmapfield');
|
| 34 |
// Set message
|
| 35 |
drupal_set_message(t('@module disabled.', array('@module' => 'GMap Field')));
|
| 36 |
}
|
| 37 |
|
| 38 |
/**
|
| 39 |
* Implementation of hook_install().
|
| 40 |
*/
|
| 41 |
function gmapfield_install() {
|
| 42 |
// CCK prep
|
| 43 |
drupal_load('module', 'content');
|
| 44 |
content_notify('install', 'gmapfield');
|
| 45 |
// Set message
|
| 46 |
drupal_set_message(t('@module installed.', array('@module' => 'GMap Field')));
|
| 47 |
}
|
| 48 |
|
| 49 |
|
| 50 |
/**
|
| 51 |
* Implementation of hook_uninstall().
|
| 52 |
*/
|
| 53 |
function gmapfield_uninstall() {
|
| 54 |
// CCK prep
|
| 55 |
drupal_load('module', 'content');
|
| 56 |
content_notify('uninstall', 'gmapfield');
|
| 57 |
// Get module variables
|
| 58 |
$results = db_query("select v.name from {variable} as v where name like '%s%%'", 'gmapfield');
|
| 59 |
// Remove variables
|
| 60 |
while($row = db_fetch_array($results)) {
|
| 61 |
variable_del($row['name']);
|
| 62 |
}
|
| 63 |
// Set message
|
| 64 |
drupal_set_message(t('@module uninstalled; Variables removed.', array('@module' => 'GMap Field')));
|
| 65 |
}
|