You are here

function biblio_ui_can_delete_bundle in Bibliography Module 7.3

Access callback which determine if the bundle can be deleted.

1 call to biblio_ui_can_delete_bundle()
biblio_ui_manage_bundles in modules/biblio_ui/biblio_ui.module
Display list of bundles the user can manage.
1 string reference to 'biblio_ui_can_delete_bundle'
biblio_ui_menu in modules/biblio_ui/biblio_ui.module
Implements hook_menu().

File

modules/biblio_ui/biblio_ui.module, line 256
Main functionality file for the biblio UI module.

Code

function biblio_ui_can_delete_bundle($bundle, $account = NULL) {
  global $user;
  if (empty($account)) {
    $account = user_load($user->uid);
  }
  $query = new entityFieldQuery();
  $number = $query
    ->entityCondition('entity_type', 'biblio')
    ->propertyCondition('type', $bundle)
    ->count()
    ->execute();
  return !($number && user_access('manage biblio structure', $account));
}