function theme_opigno_simple_ui_local_task in Opigno 7
Alter the way tabs are rendered to add custom classes.
Parameters
array $vars:
Return value
string
1 string reference to 'theme_opigno_simple_ui_local_task'
- opigno_simple_ui_theme_registry_alter in modules/
simple_ui/ opigno_simple_ui.module - Implements hook_theme_registry_alter().
File
- modules/
simple_ui/ opigno_simple_ui.module, line 389
Code
function theme_opigno_simple_ui_local_task(&$vars) {
$class = 'node-tab';
if (isset($vars['element']['#link']['path'])) {
switch ($vars['element']['#link']['path']) {
case 'node/%/view':
$class .= ' node-view-tab';
break;
case 'node/%/edit':
$class .= ' node-edit-tab';
break;
case 'node/%/tools':
$class .= ' node-tools-tab';
break;
case 'node/%/group':
$class .= ' node-group-tab';
break;
case 'node/%/certificate':
$class .= ' node-certificate-tab';
break;
}
}
$vars['element']['#link']['localized_options']['attributes']['class'][] = $class;
return theme_menu_local_task($vars);
}