function panels_page_delete in Panels 5.2
Same name and namespace in other branches
- 6.2 panels_page/panels_page.write.inc \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.module, line 1034 - panels_page.module
Code
function panels_page_delete($panel_page) {
// Delete the panel page.
db_query("DELETE FROM {panels_page} WHERE pid = %d", $panel_page->pid);
menu_rebuild();
// 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']);
}
}
}
}