aboutsummaryrefslogtreecommitdiff
path: root/Html/includes/ariane.php
blob: d63374a1d70d9acba26daeb55c2a838b0a5b6e8f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<?php
$def = "index";
$dPath = $_SERVER['REQUEST_URI'];
$dChunks = explode("/", $dPath);

echo '<p class="ariane">';

	echo '<a href="/">Accueil</a><span> &rsaquo; </span>';

	for($i=1; $i<count($dChunks); $i++ ) {
        	echo '<a href="/';
        	for($j=1; $j<=$i; $j++ ) {
               		echo $dChunks[$j];
               		if ($j!=count($dChunks)-1) {
				echo("/");
			}
        	}	

        	if ($i==count($dChunks)-1) {
        		$prChunks = explode(".", $dChunks[$i]);
                	if ($prChunks[0] == $def) $prChunks[0] = "";
                		$prChunks[0] = $prChunks[0] . "</a>";
        	}
        	else {
			$prChunks[0]=$dChunks[$i] . '</a><span> &rsaquo;&rsaquo; </span>';
		}
        	echo '">';
        	echo str_replace("_" , " " , $prChunks[0]);
	}

echo '</p>';
?>