-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtagadelic.install
63 lines (52 loc) · 1.67 KB
/
tagadelic.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
60
61
62
63
<?php
/**
* @file
* Installation/updates for tagadelic.
*/
/**
* @defgroup updates-7.x-to-1.x Updates from 7.x to 1.x
* @{
* Update functions from Drupal 7.x to Backdrop CMS 1.x.
*/
/**
* Move settings from variables to config.
*/
function tagadelic_update_1000() {
// Migrate variables to config.
$config = config('tagadelic.settings');
$config->set('sort_order', update_variable_get('tagadelic_sort_order', 'title,asc'));
$config->set('page_amount', update_variable_get('tagadelic_page_amount', 60));
$config->set('levels', update_variable_get('tagadelic_levels', 6));
$config->save();
// Delete variables.
update_variable_del('tagadelic_sort_order');
update_variable_del('tagadelic_page_amount');
update_variable_del('tagadelic_levels');
// @todo convert block-instance variables to default layout config?
// Delete the block-instance variables. (These are now saved with layouts.)
foreach (taxonomy_get_vocabularies() as $machine_name => $vocab) {
update_variable_del('tagadelic_block_title_' . $machine_name);
update_variable_del('tagadelic_block_tags_' . $machine_name);
}
return t('Old Drupal 7 varaibles converted to Backdrop configuration.');
}
/**
* @} End of "defgroup updates-7.x-to-1.x"
*/
/**
* @defgroup updates-for-1.x Updates for Backdrop 1.x
* @{
* Update functions from Drupal 7.x to Backdrop CMS 1.x.
*/
/**
* Rebuild the theme registry.
*/
function tagadelic_update_1001() {
// Rebuild the theme registry for the new theme.inc file.
system_rebuild_theme_data();
return t('Theme registry rebuilt for Tagadelic module.');
}
/**
* @} End of "defgroup updates-for-1.x"
* The next series of updates should start at 2000.
*/