You are here

function panels_page_delete in Panels 6.2

Same name and namespace in other branches
  1. 5.2 panels_page/panels_page.module \panels_page_delete()

Delete a panel page and its associated displays.

1 call to panels_page_delete()
panels_page_delete_confirm_submit in panels_page/panels_page.admin.inc
Handle the submit button to delete a panel page.

File

panels_page/panels_page.write.inc, line 151
panels_page.write.inc

Code

function panels_page_delete($panel_page) {

  // Delete the panel page.
  db_query("DELETE FROM {panels_page} WHERE pid = %d", $panel_page->pid);

  // Delete the primary display.
  panels_delete_display($panel_page->did);

  // Delete all secondary displays.
  if (!empty($panel_page->displays)) {
    foreach ($panel_page->displays as $info) {
      if ($info['did'] !== 'new') {
        panels_delete_display($info['did']);
      }
    }
  }
  menu_rebuild();
}