You are here

function workbench_myworkbench_menu_alter in Workbench 7

Callback defined by workbench_myworkbench_page_manager_tasks().

Alter menu item so that admin/workbench comes here.

1 string reference to 'workbench_myworkbench_menu_alter'
workbench_myworkbench_page_manager_tasks in plugins/page_manager/tasks/myworkbench.inc
Specialized implementation of hook_page_manager_task_tasks(). See api-task.html for more information.

File

plugins/page_manager/tasks/myworkbench.inc, line 36

Code

function workbench_myworkbench_menu_alter(&$items, $task) {
  if (variable_get('workbench_myworkbench_disabled', TRUE)) {
    return;
  }
  $callback = $items['admin/workbench']['page callback'];

  // Override the node edit handler for our purpose.
  if ($callback == 'workbench_content' || variable_get('page_manager_override_anyway', FALSE)) {
    $items['admin/workbench']['page callback'] = 'workbench_myworkbench';
    $items['admin/workbench']['file path'] = $task['path'];
    $items['admin/workbench']['file'] = $task['file'];
  }
  else {

    //variable_set('workbench_myworkbench_disabled', TRUE);
    if (!empty($GLOBALS['page_manager_enabling_workbench'])) {
      drupal_set_message(t('Page manager module is unable to enable Workbench because some other module already has overridden with %callback.', array(
        '%callback' => $callback,
      )), 'warning');
    }
    return;
  }
}