-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvoyeur.install
47 lines (44 loc) · 1.29 KB
/
voyeur.install
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
// $Id$
/**
* @file
* Provides install and uninstall functions for the Voyeur module.
*
* The Voyeur module implements many concepts and methods derived from
* the CommentRSS module found here: http://drupal.org/project/commentrss.
* Thank you Gábor Hojtsy for your hard work.
*/
/**
* Implementation of hook_install().
* Sets Voyeur module weight to -1 in the database.
*/
function voyeur_install() {
// Set module weight to run before others.
db_query("UPDATE {system} SET weight = -1 WHERE type = 'module' AND name = 'voyeur'");
// Set message to fresh install users.
drupal_set_message(st("Voyeur installed successfully! Settings are available under !link",
array( '!link' => l(st('Administer') . ' > ' . st('Site configuration') . '>' . 'Voyeur ' . st('module settings'), 'admin/settings/voyeur/settings' ) . '.')
));
}
/**
* Implementation of hook_uninstall().
* Deletes Voyeur specific variables from the database.
*/
function voyeur_uninstall() {
// Remove variables.
$variables = array(
'voyeur_by_user',
'voyeur_tool',
'voyeur_height',
'voyeur_width',
'voyeur_filters',
'voyeur_terms',
'voyeur_time',
'voyeur_max',
'voyeur_limit',
'voyeur_query'
);
foreach ($variables as $variable) {
variable_del($variable);
}
}