function workbench_moderation_noderevision_menu_alter in Workbench Moderation 7.3
Same name and namespace in other branches
- 7 plugins/page_manager/tasks/noderevision.inc \workbench_moderation_noderevision_menu_alter()
Callback defined by workbench_moderation_noderevision_page_manager_tasks().
Alter menu item so that admin/workbench comes here.
1 string reference to 'workbench_moderation_noderevision_menu_alter'
- workbench_moderation_noderevision_page_manager_tasks in plugins/
page_manager/ tasks/ noderevision.inc - Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for more information.
File
- plugins/
page_manager/ tasks/ noderevision.inc, line 38
Code
function workbench_moderation_noderevision_menu_alter(&$items, $task) {
if (variable_get('workbench_moderation_noderevision_disabled', TRUE)) {
return;
}
$callback = $items['node/%node/revisions/%/view']['page callback'];
// Override the node edit handler for our purpose.
if ($callback == 'workbench_moderation_node_view_revision' || variable_get('page_manager_override_anyway', FALSE)) {
$items['node/%node/revisions/%/view']['page callback'] = 'workbench_moderation_noderevision';
$items['node/%node/revisions/%/view']['file path'] = $task['path'];
$items['node/%node/revisions/%/view']['file'] = $task['file'];
}
else {
variable_set('workbench_moderation_noderevision_disabled', TRUE);
if (!empty($GLOBALS['page_manager_enabling_workbench_noderevision'])) {
drupal_set_message(t('Page manager module is unable to enable Workbench Moderation Revision Node because some other module already has overridden with %callback.', array(
'%callback' => $callback,
)), 'warning');
}
return;
}
}