Conditions | 6 |
Paths | 8 |
Total Lines | 26 |
Code Lines | 24 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
5 | function renderDocumentBreadcrumb($path) |
||
6 | { |
||
7 | ?> |
||
8 | <th colspan="4"> |
||
9 | <?php |
||
10 | $pathParts = explode('/', $path); |
||
11 | array_shift($pathParts); |
||
12 | $pathPartsReconstruction = ''; |
||
13 | $parentPath = substr($path, 0, strrpos( $path, '/')); |
||
|
|||
14 | if ($path !== '/' && substr_count($path, '/') === 1) { |
||
15 | $parentPath = '/'; |
||
16 | } |
||
17 | ?> |
||
18 | <a href="?path=/"> |
||
19 | Documents |
||
20 | </a> |
||
21 | <?php foreach ($pathParts as $part) : ?> |
||
22 | <?php if (!empty($part)) : ?> |
||
23 | <?php $pathPartsReconstruction .= (substr($pathPartsReconstruction, -1) === '/' ? '' : '/') . $part ?> |
||
24 | » |
||
25 | <a href="?path=<?= $pathPartsReconstruction ?>"> |
||
26 | <?= $part ?> |
||
27 | </a> |
||
28 | <?php endif ?> |
||
29 | <?php endforeach ?> |
||
30 | </th> |
||
31 | <?php |
||
34 | ?> |