-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathuc_out_of_stock.install
43 lines (38 loc) · 1.33 KB
/
uc_out_of_stock.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
<?php
/**
* @file
* (Un)Installation procedures.
*
* For now it basically removes the used variables.
*/
/**
* Implements hook_uninstall().
*/
function uc_out_of_stock_uninstall() {
config_clear('uc_out_of_stock.settings', 'uc_out_of_stock_text');
config_clear('uc_out_of_stock.settings', 'uc_out_of_stock_disable_js');
config_clear('uc_out_of_stock.settings', 'uc_out_of_stock_instock');
config_clear('uc_out_of_stock.settings', 'uc_out_of_stock_throbber');
}
/**
* Implements hook_update_N().
*/
function uc_out_of_stock_update_1000() {
$config = config('uc_out_of_stock.settings');
$config->set('uc_out_of_stock_disable_js', update_variable_get('uc_out_of_stock_disable_js', false));
$config->set('uc_out_of_stock_throbber', update_variable_get('uc_out_of_stock_throbber', true));
$config->set('uc_out_of_stock_instock', update_variable_get('uc_out_of_stock_instock', true));
$config->set('uc_out_of_stock_text', update_variable_get('uc_out_of_stock_text', array(
'value' => '<p>Out of stock.</p>\r\n',
'format' => 'filtered_html',
)));
update_variable_del('uc_out_of_stock_disable_js');
update_variable_del('uc_out_of_stock_throbber');
update_variable_del('uc_out_of_stock_instock');
update_variable_del('uc_out_of_stock_text');
}
/**
* Implements hook_install().
*/
function uc_out_of_stock_install() {
}