Guest User

Untitled

a guest
Jul 18th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.84 KB | None | 0 0
  1. <?php
  2.  
  3. function boost_helper_theme() {
  4. return array(
  5. 'boost_helper_backlink' => array(
  6. 'arguments' => array('title' => NULL, 'path' => NULL),
  7. ),
  8. );
  9. }
  10.  
  11. function boost_helper_nodeapi(&$node, $op, $a3 = null, $a4 = null) {
  12. if ($op == 'view' && $node->type == 'page') {
  13.  
  14. $mat = menu_get_active_trail();
  15. $level = count($mat) - 1;
  16. $menu_item = $mat[$level];
  17.  
  18. if ($level > 3)
  19. {
  20. $section_menu_item = $mat[3];
  21. }
  22.  
  23. $body = $node->content['body']['#value'];
  24. print "*".theme('boost_helper_backlink', 'test', 'test')."*";
  25. // $body = theme('back_link', $section_menu_item['title'], $section_menu_item['path']) . $body;
  26. print_r($body);
  27. die();
  28.  
  29.  
  30. }
  31. }
  32.  
  33. function theme_boost_helper_backlink($title, $path) {
  34. print $title;
  35. return '<p class="backlink-to-parent">Back to ' . l($title, $path) . '</p>';
  36. }
Add Comment
Please, Sign In to add comment