-
Notifications
You must be signed in to change notification settings - Fork 74
/
wetkit.install_callbacks.inc
46 lines (40 loc) · 1.14 KB
/
wetkit.install_callbacks.inc
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
<?php
/**
* @file
* Contains Batch API callbacks used during installation of Drupal WxT.
*/
/**
* BatchAPI callback.
*
* @see wetkit_import_content()
*/
function _wetkit_import($operation, $type, &$context) {
$context['message'] = t('@operation', array('@operation' => $type));
$migration = Migration::getInstance($operation);
$migration->processImport();
}
/**
* BatchAPI callback.
*
* @see wetkit_import_content()
*/
function _wetkit_panels_fix($operation, &$context) {
$context['message'] = t('@operation', array('@operation' => $operation));
// Fix Panels Edit Page on Browser Install.
variable_set('page_manager_node_edit_disabled', 0);
menu_rebuild();
}
/**
* BatchAPI callback.
*
* @see wetkit_import_content()
*/
function _wetkit_permissions_fix($operation, &$context) {
$context['message'] = t('@operation', array('@operation' => $operation));
// Ensure Administrator has all permissions
// checked by default.
if ($administrator = user_role_load_by_name('administrator')) {
$permissions = module_invoke_all('permission');
user_role_grant_permissions($administrator->rid, array_keys($permissions));
}
}