function custom_breadcrumbsapi_breadcrumb_alter in Custom Breadcrumbs 7.2
Same name and namespace in other branches
- 6.2 custom_breadcrumbsapi/custom_breadcrumbsapi.module \custom_breadcrumbsapi_breadcrumb_alter()
Implements hook_breadcrumb_alter().
@codingStandardsIgnoreStart
Provide a function for module developers to provide custom breadcrumbs for module pages. Modules wishing to provide custom breadcrumbs access to specific pages should include drupal_alter('breadcrumb', $breadcrumb, $modulepage, $objs); at the end of the function providing the page.
Parameters
$breadcrumb: The breadcrumb array to be altered
$modulepage: a string identifying the module page. This name will be displayed on the customb breadcrumb list.
array $objs: An array of objects that can be used in token replacement with array keys indicating the type of object.
File
- custom_breadcrumbsapi/
custom_breadcrumbsapi.module, line 101
Code
function custom_breadcrumbsapi_breadcrumb_alter($breadcrumb, $modulepage, $objs = array()) {
// @codingStandardsIgnoreEnd
global $language;
$languages = array(
'language' => $language->language,
'all' => '',
);
$breadcrumbs = custom_breadcrumbs_load_breadcrumbs('custom_breadcrumbsapi', NULL, array(
'module_page' => $modulepage,
), $languages);
if (!empty($breadcrumbs)) {
if ($breadcrumb = custom_breadcrumbs_select_breadcrumb($breadcrumbs, $objs)) {
custom_breadcrumbs_set_breadcrumb($breadcrumb, $objs);
// Return the modified breadcrumb which has now been set.
$breadcrumb = drupal_get_breadcrumb();
}
}
}