Advertisement
Guest User

Untitled

a guest
Sep 24th, 2015
110
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.60 KB | None | 0 0
  1. /**
  2.  * Hierarchical breadcrumbs
  3.  *
  4.  * This code was suggested as replacement for the usual breadcrumbs.
  5.  * It only makes sense with a deep site structure.
  6.  *
  7.  * @author Andreas Gohr <andi@splitbrain.org>
  8.  * @author Nigel McNie <oracle.shinoda@gmail.com>
  9.  * @author Sean Coates <sean@caedmon.net>
  10.  * @author <fredrik@averpil.com>
  11.  * @todo   May behave strangely in RTL languages
  12.  *
  13.  * @param string $sep Separator between entries
  14.  * @return bool
  15.  */
  16. function tpl_youarehere($sep = ' ยป ') {
  17.     global $conf;
  18.     global $ID;
  19.     global $lang;
  20.  
  21.     // check if enabled
  22.     if(!$conf['youarehere']) return false;
  23.  
  24.     $parts = explode(':', $ID);
  25.     $count = count($parts);
  26.  
  27.     echo '<span class="bchead">'.$lang['youarehere'].' </span>';
  28.  
  29.     // always print the startpage
  30.     echo '<span class="home">';
  31. /*    tpl_pagelink(':'.$conf['start']); */
  32. /*    tpl_pagelink(':'.$conf['baseurl']); */
  33.     echo '<a href=http://lamp.dev:8080/dokuwiki/>home</a>';
  34.     echo '</span>';
  35.  
  36.     // print intermediate namespace links
  37.     $part = '';
  38.     for($i = 0; $i < $count - 1; $i++) {
  39.         $part .= $parts[$i].':';
  40.         $page = $part;
  41.         if($page == $conf['start']) continue; // Skip startpage
  42.  
  43.         // output
  44.         echo $sep;
  45.         tpl_pagelink($page);
  46.     }
  47.  
  48.     // print current page, skipping start page, skipping for namespace index
  49.     resolve_pageid('', $page, $exists);
  50.     if(isset($page) && $page == $part.$parts[$i]) return true;
  51.     $page = $part.$parts[$i];
  52.     if($page == $conf['start']) return true;
  53.     echo $sep;
  54.     tpl_pagelink($page);
  55.     return true;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement