function xmlsitemap_link_bundle_access in XML sitemap 6.2
Same name and namespace in other branches
- 8 xmlsitemap.module \xmlsitemap_link_bundle_access()
- 7.2 xmlsitemap.module \xmlsitemap_link_bundle_access()
1 call to xmlsitemap_link_bundle_access()
- xmlsitemap_add_form_link_options in ./
xmlsitemap.admin.inc - Add a link's XML sitemap options to the link's form.
1 string reference to 'xmlsitemap_link_bundle_access'
- xmlsitemap_menu in ./
xmlsitemap.module - Implements hook_menu().
File
- ./
xmlsitemap.module, line 1045 - Main file for the xmlsitemap module.
Code
function xmlsitemap_link_bundle_access($entity, $bundle = NULL) {
if (is_array($entity) && !isset($bundle)) {
$bundle = $entity;
}
else {
$bundle = xmlsitemap_link_bundle_load($entity, $bundle);
}
if (isset($bundle['info']['admin'])) {
$admin = $bundle['info']['admin'];
$admin += array(
'access arguments' => array(),
);
if (!isset($admin['access callback']) && count($admin['access arguments']) == 1) {
$admin['access callback'] = 'user_access';
}
if (!empty($admin['access callback'])) {
return call_user_func_array($admin['access callback'], $admin['access arguments']);
}
}
return FALSE;
}