function 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 434

Code

function page_manager_page_delete($page, $skip_menu_rebuild = FALSE) {
    $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_delete('page_manager_pages')->condition('name', $page->name)
        ->execute();
    // 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');
    // Allow menu rebuild to be skipped when calling code is deleting multiple
    // pages.
    if (!$skip_menu_rebuild) {
        menu_rebuild();
    }
}