You are here

function page_manager_page_delete in Chaos Tool Suite (ctools) 6

Same name and namespace in other branches
  1. 7 page_manager/plugins/tasks/page.inc \page_manager_page_delete()

Remove a page subtask.

1 call to page_manager_page_delete()
page_manager_page_form_delete_submit in page_manager/plugins/tasks/page.admin.inc
Submit handler to delete a view.

File

page_manager/plugins/tasks/page.inc, line 446
Handle the 'page' task, which creates pages with arbitrary tasks and lets handlers decide how they will be rendered.

Code

function page_manager_page_delete($page) {
  $task = page_manager_get_task($page->task);
  if ($function = ctools_plugin_get_function($task, 'delete')) {
    $function($page);
  }
  if (!empty($task['uses handlers'])) {
    $handlers = page_manager_load_task_handlers($task, $page->name);
    foreach ($handlers as $handler) {
      page_manager_delete_task_handler($handler);
    }
  }
  db_query("DELETE FROM {page_manager_pages} WHERE name = '%s'", $page->name);

  // Make sure that the cache is reset so that the menu rebuild does not
  // rebuild this page again.
  ctools_include('export');
  ctools_export_load_object_reset('page_manager_pages');
  menu_rebuild();
}