|
Revision 2, 0.6 kB
(checked in by nperriault, 8 months ago)
|
First commit of the extracted code from production, I hope no passwd has been forgotten :-)
|
| Line | |
|---|
| 1 |
<?php |
|---|
| 2 |
function breadcrumb($links, $options = array()) |
|---|
| 3 |
{ |
|---|
| 4 |
if (isset($options['class']) && strtolower(trim($options['class'])) != 'breadcrumb') |
|---|
| 5 |
{ |
|---|
| 6 |
$options['class'] = 'breadcrumb ' . trim($options['class']); |
|---|
| 7 |
} |
|---|
| 8 |
else |
|---|
| 9 |
{ |
|---|
| 10 |
$options['class'] = 'breadcrumb'; |
|---|
| 11 |
} |
|---|
| 12 |
$sep = isset($options['sep']) ? $options['sep'] : ' > '; |
|---|
| 13 |
$html = link_to(__('Home'), '@homepage'); |
|---|
| 14 |
foreach ($links as $link) |
|---|
| 15 |
{ |
|---|
| 16 |
if (is_string($link)) |
|---|
| 17 |
{ |
|---|
| 18 |
$html .= $sep . $link; |
|---|
| 19 |
} |
|---|
| 20 |
elseif (is_array($link)) |
|---|
| 21 |
{ |
|---|
| 22 |
$html .= $sep . link_to($link[0], $link[1]); |
|---|
| 23 |
} |
|---|
| 24 |
} |
|---|
| 25 |
return content_tag('p', $html, $options); |
|---|
| 26 |
} |
|---|