| 1 |
<?php
|
| 2 |
// $Id: shadowbox.install,v 1.4 2008/05/12 20:00:53 psynaptic Exp $
|
| 3 |
|
| 4 |
|
| 5 |
/**
|
| 6 |
* Implementation of hook_install()
|
| 7 |
*/
|
| 8 |
function shadowbox_install() {
|
| 9 |
// log the installation in watchdog
|
| 10 |
watchdog('shadowbox', 'Shadowbox module was installed');
|
| 11 |
}
|
| 12 |
|
| 13 |
/**
|
| 14 |
* Implementation of hook_uninstall()
|
| 15 |
*/
|
| 16 |
function shadowbox_uninstall() {
|
| 17 |
// delete the variables we created
|
| 18 |
global $conf;
|
| 19 |
$variables = db_query('SELECT name FROM {variable} WHERE name LIKE "%s"', 'shadowbox_%');
|
| 20 |
while ($name = db_result($variables)) {
|
| 21 |
db_query("DELETE FROM {variable} WHERE name = '%s'", $name);
|
| 22 |
unset($conf[$name]);
|
| 23 |
}
|
| 24 |
cache_clear_all('variables', 'cache');
|
| 25 |
// log the uninstallation in watchdog
|
| 26 |
watchdog('shadowbox', 'Shadowbox module was uninstalled');
|
| 27 |
}
|
| 28 |
|