-
Notifications
You must be signed in to change notification settings - Fork 1
/
ding_oc_latto_frontend.module
executable file
·42 lines (36 loc) · 1.4 KB
/
ding_oc_latto_frontend.module
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
<?php
/**
* @file
* Code for the Ding Latto Frontend feature.
*/
include_once 'ding_oc_latto_frontend.features.inc';
/**
* Implements hook_page_manager_load_task_handlers_alter().
*
* When page manager loads task handlers for pages we remove the page handlers
* that are handled by features in this module.
*
* Requires a patch to ctools/page_manager.module (call drupal_alter).
*/
function ding_oc_latto_frontend_page_manager_load_task_handlers_alter(&$handlers, $task, $subtask_id = NULL) {
// If we are on an admin/structure/features* page or we are being called
// through drush features we will filter out page handlers.
$in_drush_features = FALSE;
if (function_exists('drush_get_command')) {
$command = drush_get_command();
if (isset($command['drupal dependencies']) && in_array('features', $command['drupal dependencies'])) {
$in_drush_features = TRUE;
}
};
if (preg_match('/admin\/structure\/features/', $_GET['q']) || $in_drush_features) {
// Load the page handlers handled by this feature module.
$ding_oc_latto_frontend_handlers = array_keys(ding_oc_latto_frontend_default_page_manager_handlers());
if ($task['name'] == 'page') {
foreach ($handlers as $handler) {
if (in_array($handler->name, $ding_oc_latto_frontend_handlers)) {
unset($handlers[$handler->name]);
}
}
}
}
}