function xmlsitemap_link_bundle_access in XML sitemap 7.2
Same name and namespace in other branches
- 8 xmlsitemap.module \xmlsitemap_link_bundle_access()
- 6.2 xmlsitemap.module \xmlsitemap_link_bundle_access()
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.
3 string references to 'xmlsitemap_link_bundle_access'
- drush_xmlsitemap_queue_rebuild in ./
xmlsitemap.drush.inc - Dump and queue all the sitemap links to be rebuilt in a queue process.
- xmlsitemap_menu in ./
xmlsitemap.module - Implements hook_menu().
- xmlsitemap_rebuild_batch_fetch in ./
xmlsitemap.generate.inc - Batch callback; fetch and add the sitemap links for a specific entity.
File
- ./
xmlsitemap.module, line 1224 - xmlsitemap XML sitemap
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;
}