\n"; for($i=0; $i 0){ // Nom du lien $firstHeading = p_get_first_heading($dataList[$i]["id"]); if($conf['useheading'] && $dataList[$i]["type"] == "f" && !empty($firstHeading)){ $linkName = $firstHeading; }else{ $linkName = split(":", $dataList[$i]["id"]); $linkName = $linkName[count($linkName) - 1]; $linkName = str_replace("_", " ", $linkName); } // On vérifie qu'on est dans le bon level if($currentLevel > $dataList[$i]["level"]){ echo str_repeat("\n", $currentLevel - $dataList[$i]["level"]); $currentLevel = $dataList[$i]["level"]; } // Affichage if($dataList[$i]["type"] == "d"){ // dossier if($dataList[$i]["open"]){ echo "
  • "; }else{ echo "
  • "; } if($_REQUEST["do"] == "admin" && $_REQUEST["page"] == "acl"){ $path = wl($dataList[$i]["id"].":".$conf['start'], "do=admin&page=acl"); }else{ $path = wl($dataList[$i]["id"].":".$conf['start']); } tpl_link($path,$linkName); }else{ // fichier echo "
  • "; if($dataList[$i]["id"] == $ID){ // Page affichée echo ""; } if($_REQUEST["do"] == "admin" && $_REQUEST["page"] == "acl"){ $path = wl($dataList[$i]["id"], "do=admin&page=acl"); }else{ $path = wl($dataList[$i]["id"]); } tpl_link($path,$linkName); if($dataList[$i]["id"] == $ID){ // Page affichée echo ""; } } if($dataList[$i+1]["level"] == $currentLevel){ // dossier courant echo "
  • \n"; }else if($dataList[$i+1]["level"] > $currentLevel){ // Nouveau sous dossier echo "\n", $currentLevel - $dataList[$i+1]["level"]); } } $currentLevel = $dataList[$i+1]["level"]; } } echo "\n"; } /** * Afficher le plan du site */ function tpl_sitemap() { global $ID; global $ACT; global $conf; $folder = getNS($ID); require_once(DOKU_INC.'inc/search.php'); require_once(DOKU_INC.'inc/html.php'); $ns = cleanID($ID); if(empty($ns)){ $ns = dirname(str_replace(':','/',$ID)); if($ns == '.') $ns =''; } $ns = utf8_encodeFN(str_replace(':','/',$ns)); $list = array(); search($list,$conf['datadir'],'search_index',array('ns' => $ns)); tpl_list_folder($list); } /** * Afficher le plan de la page */ function getToc(){ global $ID; $except = array('admin', 'revisions', 'diff'); if(in_array($_REQUEST["do"], $except) || auth_quickaclcheck($ID) < 1) return false; require_once(DOKU_INC.'inc/parserutils.php'); $content = p_wiki_xhtml($ID); $pattern = '@
    .*?
    \n@s'; preg_match($pattern, $content, $matches); return substr($matches[0], 22, -14); } ?>