function homebox_delete_page in Homebox 7.2
Same name and namespace in other branches
- 6.3 homebox.module \homebox_delete_page()
- 6.2 homebox.module \homebox_delete_page()
- 7.3 homebox.module \homebox_delete_page()
Helper function to delete a page
Parameters
$name: The machine name of the page to delete
Return value
Boolean status of the operation
2 calls to homebox_delete_page()
- homebox_admin_page_delete_confirm_submit in ./
homebox.admin.inc - Submission of the delete/revert confirmation form
- homebox_features_revert in ./
homebox.features.inc - Implements hook_features_revert().
File
- ./
homebox.module, line 958 - Homebox main file, takes care of global functions settings constants, etc.
Code
function homebox_delete_page($name) {
// Delete the page and corresponding user settings
$delete_page = db_delete('homebox_pages')
->condition('name', $name)
->execute();
$delete_users = db_delete('homebox_users')
->condition('name', $name)
->execute();
// Clear cached value.
drupal_static('homebox_get_page', array(), TRUE);
return (bool) $delete_page && (bool) $delete_users;
}