1 block.welcome.inc | private DashboardWelcomeBlock::filterAvailableLinks(array $links) |
Checks access to paths and returns an HTML list of links.
Parameters
array $links: An array with each key being a path and each value being a label.
Return value
array: An array of HTML anchor tags for items the user may access.
File
- core/
modules/ dashboard/ includes/ block.welcome.inc, line 157 - Dashboard block providing a welcome message, and links to get people started using Backdrop.
Class
- DashboardWelcomeBlock
- @file Dashboard block providing a welcome message, and links to get people started using Backdrop.
Code
private function filterAvailableLinks(array $links) {
$html_links = array();
foreach ($links as $path => $label) {
if (url_is_external($path) || $path === '<front>') {
if ($path !== '<front>') {
$label .= '<span class="dashboard-external"></span>';
}
$access = TRUE;
}
else {
$router_item = menu_get_item($path);
$access = $router_item && $router_item['access'];
}
if ($access) {
$html_links[] = l($label, $path, array('html' => TRUE));
}
}
return $html_links;
}