Triggered before a page is deleted.
The event handler can throw an exception to prevent deletion of a specific page.
public function subscribeEvents()
{
Backend::$events->addEvent('cms:onDeletePage', $this, 'page_deletion_check');
}
public function page_deletion_check($page)
{
$in_use = Db_DbHelper::scalar(
'select count(*) from shop_categories where page_id=:id',
array('id'=>$page->id)
);
if ($in_use)
throw new Phpr_ApplicationException("Unable to delete page: it is used as a category landing page.");
}