Guest User

Untitled

a guest
Jun 20th, 2018
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.70 KB | None | 0 0
  1. function phptemplate_menu_item_link($link) {
  2. if (empty($link['options'])) {
  3. $link['options'] = array();
  4. }
  5.  
  6. // If an item is a LOCAL TASK, render it as a tab
  7. if ($link['type'] & MENU_IS_LOCAL_TASK) {
  8. $link['title'] = '<span class="tab">'. check_plain($link['title']) .'</span>';
  9. $link['options']['html'] = TRUE;
  10. }
  11.  
  12. if (empty($link['type'])) {
  13. $true = TRUE;
  14. }
  15.  
  16. //get unique id from menu item title
  17. $css_id = phptemplate_id_safe(str_replace(' ', '_', strip_tags($link['title'])));
  18.  
  19. //set unique id for link
  20. if ($link['menu_name'] == 'primary-links') {
  21. $link['options']['attributes']['id'] = 'id-' . $css_id;
  22. }
  23.  
  24. return l($link['title'], $link['href'], $link['options']);
  25. }
Add Comment
Please, Sign In to add comment