-
Notifications
You must be signed in to change notification settings - Fork 4
/
ubercoova.install
59 lines (53 loc) · 1.81 KB
/
ubercoova.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
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* Implementation of hook_install()
*
* Add a quota field to the product node type.
*/
function ubercoova_install() {
module_load_include('inc', 'content', 'includes/content.crud');
module_load_include('inc', 'ubercoova', 'includes/ubercoova.cck');
$field = _ubercoova_export();
$field['type_name'] = 'product';
content_field_instance_create($field);
}
/**
* Implementation of hook_uninstall()
*
* Remove the quota field from the product node type.
*/
function ubercoova_uninstall() {
module_load_include('inc', 'content', 'includes/content.crud');
module_load_include('inc', 'ubercoova', 'includes/ubercoova.cck');
$field = _ubercoova_export();
content_field_instance_delete($field['field_name'], 'product', FALSE);
// Flush caches
content_clear_type_cache(TRUE);
menu_rebuild();
// Remove variables.
variable_del('ubercoova_table');
variable_del('ubercoova_attribute_password');
variable_del('ubercoova_attribute_quota');
variable_del('ubercoova_table_accounting');
variable_del('ubercoova_field_accounting');
variable_del('ubercoova_table_usergroup');
variable_del('ubercoova_email_uname');
variable_del('ubercoova_email_domain');
variable_del('ubercoova_email_modify');
variable_del('ubercoova_rid');
variable_del('ubercoova_login_redirect');
variable_del('ubercoova_radclient');
variable_del('ubercoova_cleanup');
variable_del('ubercoova_cleanup_tables');
variable_del('ubercoova_topup_anonymous');
variable_del('ubercoova_topup_authenticated');
}
/**
* Implementation of hook_update_N()
*
* Remove used var from the database, if it was present.
*/
function ubercoova_update_6001() {
variable_del('ubercoova_attribute_username');
return array(array('success' => TRUE, 'query' => 'Removed unused ubercoova_attribute_username setting from the variables table.'));
}