| 5 menu.inc | theme_menu_local_tasks() |
| 6 menu.inc | theme_menu_local_tasks() |
| 7 menu.inc | theme_menu_local_tasks(&$variables) |
| 8 menu.inc | theme_menu_local_tasks(&$variables) |
Returns HTML for primary and secondary local tasks.
Related topics
File
- includes/
menu.inc, line 2263 - API for the Drupal menu system.
Code
function theme_menu_local_tasks(&$variables) {
$output = '';
if (!empty($variables['primary'])) {
$variables['primary']['#prefix'] = '<h2 class="element-invisible">' . t('Primary tabs') . '</h2>';
$variables['primary']['#prefix'] .= '<ul class="tabs primary">';
$variables['primary']['#suffix'] = '</ul>';
$output .= drupal_render($variables['primary']);
}
if (!empty($variables['secondary'])) {
$variables['secondary']['#prefix'] = '<h2 class="element-invisible">' . t('Secondary tabs') . '</h2>';
$variables['secondary']['#prefix'] .= '<ul class="tabs secondary">';
$variables['secondary']['#suffix'] = '</ul>';
$output .= drupal_render($variables['secondary']);
}
return $output;
}
Login or register to post comments
Comments
Why aren't primary and
Why aren't primary and secondary broken out into separate functions normally? This seems a bit counter-intuitive to the rest of the theme layer.
How to add the colorbox class to the primary tab items
<?php
function MYTHEME_menu_local_tasks(&$variables) {
if (isset($variables['primary'])) {
foreach($variables['primary'] as $menu_item_key => $menu_attributes) {
$variables['primary'][$menu_item_key]['#link']['localized_options'] = array(
'attributes' => array('class' => array('colorbox-load')),
);
}
}
return theme_menu_local_tasks($variables);
}
?>