-
Notifications
You must be signed in to change notification settings - Fork 7
/
islandora_workflow.install
116 lines (108 loc) · 3.28 KB
/
islandora_workflow.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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
<?php
/**
* @file
* @author: William Panting
* @date: 31/05/2011
* This file handles setting up the database for the islandora_workflow module
*/
/**
* Set up the islandora_workflow module's database schema.
*
* @return array
* $workflow_schema an array of database table(s) for islandora_workflow.
*/
function islandora_workflow_schema() {
$workflow_schema = array();
$workflow_schema['islandora_workflow_role_permissions'] = array(
'description' => 'The collection level role based permissions for workflow users.',
'fields' => array(
'uid' => array(
'description' => 'The primary identifier for an instance of a permision.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'role' => array(
'description' => 'The drupal user role associated with the permission instance.',
'type' => 'varchar',
'length' => 100,
'not null' => TRUE,
'default' => '',
),
'permission' => array(
'description' => 'The drupal permission type associated with the permission instance.',
'type' => 'varchar',
'length' => 50,
'not null' => TRUE,
'default' => '',
),
'collection' => array(
'description' => 'The Fedora collection associated with the permission instance.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
),
'primary key' => array('uid'),
);
$workflow_schema['islandora_workflow_user_permissions'] = array(
'description' => 'The collection level user based permissions for workflow users.',
'fields' => array(
'uid' => array(
'description' => 'The primary identifier for an instance of a permision.',
'type' => 'serial',
'unsigned' => TRUE,
'not null' => TRUE,
),
'user' => array(
'description' => 'The drupal user associated with the permission instance.',
'type' => 'varchar',
'length' => 100,
'not null' => TRUE,
'default' => '',
),
'permission' => array(
'description' => 'The drupal permission type associated with the permission instance.',
'type' => 'varchar',
'length' => 50,
'not null' => TRUE,
'default' => '',
),
'collection' => array(
'description' => 'The Fedora collection associated with the permission instance.',
'type' => 'varchar',
'length' => 255,
'not null' => TRUE,
'default' => '',
),
),
'primary key' => array('uid'),
);
return $workflow_schema;
}
/**
* Implements hook_install().
*
* This function handles the installation of islandora_workflow
* [just adds the schema and variables]
*/
function islandora_workflow_install() {
drupal_install_schema('islandora_workflow');
}
/**
* Implements hook_uninstall().
*
* This function handles removing the islandora_workflow module's
* database schema and variables
*/
function islandora_workflow_uninstall() {
drupal_uninstall_schema('islandora_workflow');
// Remove all variables prefixed with the module's name.
global $conf;
foreach (array_keys($conf) as $var_name) {
if (strpos($var_name, 'islandora_workflow_') === 0) {
variable_del($var_name);
}
}
}