You are here

function page_manager_blog_menu_alter in Chaos Tool Suite (ctools) 7

Same name and namespace in other branches
  1. 6 page_manager/plugins/tasks/blog.inc \page_manager_blog_menu_alter()

Callback defined by page_manager_blog_page_manager_tasks().

Alter the node edit input so that node edit comes to us rather than the normal node edit process.

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

File

page_manager/plugins/tasks/blog.inc, line 45

Code

function page_manager_blog_menu_alter(&$items, $task) {
  if (variable_get('page_manager_blog_disabled', TRUE)) {
    return;
  }
  $callback = $items['blog']['page callback'];

  // Override the node edit handler for our purpose.
  if ($callback == 'blog_page_last' || variable_get('page_manager_override_anyway', FALSE)) {
    $items['blog']['page callback'] = 'page_manager_blog';
    $items['blog']['file path'] = $task['path'];
    $items['blog']['file'] = $task['file'];
  }
  else {
    variable_set('page_manager_blog_disabled', TRUE);
    if (!empty($GLOBALS['page_manager_enabling_blog'])) {
      drupal_set_message(t('Page manager module is unable to enable blog because some other module already has overridden with %callback.', array(
        '%callback' => $callback,
      )), 'warning');
    }
    return;
  }
}