forked from vejlebib/ding_tabroll
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ding_tabroll.install
63 lines (58 loc) · 1.53 KB
/
ding_tabroll.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
* Handles installation/un-installation of node queues used by the module.
*/
/**
* Implements hook_install().
*/
function ding_tabroll_install() {
ding_tabroll_install_frontpage_nodequeue();
}
/**
* Implements hook_uninstall().
*/
function ding_tabroll_uninstall() {
// Remove front page node queue.
$queue = nodequeue_load_queue_by_name('ding_tabroll_frontpage');
nodequeue_delete($queue->qid);
}
/**
* Helper function to create node queue used to order the tab-rolls.
*/
function ding_tabroll_install_frontpage_nodequeue() {
$nodequeue = new stdClass();
$nodequeue->name = 'ding_tabroll_frontpage';
$nodequeue->title = 'Front page tabroll';
$nodequeue->subqueue_title = '';
$nodequeue->owner = 'nodequeue';
$nodequeue->api_version = 2;
$nodequeue->link = 'Add to front page';
$nodequeue->link_remove = 'Remove from front page';
$nodequeue->show_in_ui = TRUE;
$nodequeue->show_in_tab = TRUE;
$nodequeue->show_in_links = FALSE;
$nodequeue->i18n = 0;
$nodequeue->roles = array();
$nodequeue->size = 5;
$nodequeue->reverse = 0;
$nodequeue->new = TRUE;
$nodequeue->types = array(
0 => 'ding_rolltab',
);
$nodequeue->subqueues = array();
$nodequeue->submit = 'Submit';
$nodequeue->reverse = 0;
$nodequeue->reference = 0;
$nodequeue->add_subqueue = array(
$nodequeue->title,
);
nodequeue_save($nodequeue);
}
/**
* Remove old library reference field.
*/
function ding_tabroll_update_7001() {
field_delete_field('field_ding_tabroll_library_ref');
field_purge_batch(1000);
}