function _block_revisions_access in Block Revisions 6
Same name and namespace in other branches
- 7 block_revisions.module \_block_revisions_access()
Access callback for the revisions tab.
Revisions are only supported for custom blocks ($module = 'block'), so deny access to hide the tab for other types of blocks.
@todo: only show the revisions tab when there is more than one revision, similar to node.module revisions.
1 string reference to '_block_revisions_access'
- block_revisions_menu in ./
block_revisions.module - Implementation of hook_menu().
File
- ./
block_revisions.module, line 91
Code
function _block_revisions_access($module, $delta) {
$revision_count = db_result(db_query('SELECT count(vid) FROM {boxes_revisions} WHERE bid = %d', $delta));
return user_access('administer blocks') && $module === 'block' && $revision_count >= 1;
}