Advertisement
Guest User

Untitled

a guest
Jun 19th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. // Navigation link location
  2. $cache->setCache('vote_module_cache');
  3. if(!$cache->isCached('link_location')){
  4. $link_location = 1;
  5. $cache->store('link_location', '1');
  6. } else {
  7. $link_location = $cache->retrieve('link_location');
  8. }
  9.  
  10. // Navigation icon
  11. $cache->setCache('navbar_icons');
  12. if(!$cache->isCached('forum_icon')) {
  13. $icon = '';
  14. } else {
  15. $icon = $cache->retrieve('forum_icon');
  16. }
  17.  
  18.  
  19. switch($link_location){
  20. case 1:
  21. // Navbar
  22. // Check cache for navbar link order
  23. $cache->setCache('navbar_order');
  24. if(!$cache->isCached('vote_order')){
  25. $vote_order = 4;
  26. $cache->store('vote_order', 4);
  27. } else {
  28. $vote_order = $cache->retrieve('vote_order');
  29. }
  30. $navigation->add('vote', $vote_language->get('vote', 'vote'), URL::build('/vote'), 'top', null, $vote_order, $icon);
  31. break;
  32. case 2:
  33. // "More" dropdown
  34. $navigation->addItemToDropdown('more_dropdown', 'vote', $icon . ' ' . $vote_language->get('vote', 'vote'), URL::build('/vote'), 'top', null);
  35. break;
  36. case 3:
  37. // Footer
  38. $navigation->add('vote', $icon . $vote_language->get('vote', 'vote'), URL::build('/vote'), 'footer', null);
  39. break;
  40. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement