reveal full hierarchy in sidebar
authorMichael Wallner <mike@php.net>
Wed, 13 Mar 2019 08:12:46 +0000 (09:12 +0100)
committerMichael Wallner <mike@php.net>
Wed, 13 Mar 2019 08:12:59 +0000 (09:12 +0100)
views/sidebar-rec.phtml [new file with mode: 0644]
views/sidebar.phtml

diff --git a/views/sidebar-rec.phtml b/views/sidebar-rec.phtml
new file mode 100644 (file)
index 0000000..7411448
--- /dev/null
@@ -0,0 +1,19 @@
+<?php if ($sub->hasNsClasses()) : ?>
+       <?= $indent ?><ul>
+               <?php foreach ($sub as $subentry) : ?>
+                       <?php
+                       array_push($indents, $indent);
+                       $indent .= "\t";
+                       ?>
+                       <?php if ($subentry->isNsClass()) : ?>
+                               <?=$indent?><li>&rdsh; <a href="<?= $up.$esc($subentry->getName()) ?>"><?= $esc($subentry) ?></a><?php
+                                       $tmp = $sub;
+                                       $sub = $subentry;
+                                       include __FILE__;
+                                       $sub = $tmp;
+                                       ?><?= $indent ?></li>
+                       <?php endif; ?>
+               <?php $indent = array_pop($indents); ?>
+               <?php endforeach; ?>
+       <?= $indent ?></ul>
+<?php endif; ?>
index 2c16424c3f311ec5c55b1659fb3fb2dbad53bd80..0e49dca38da2855a060c53967eac7a87859cfb55 100644 (file)
@@ -33,8 +33,7 @@
                                                <?php endif; ?>
                                        <?php endforeach; ?>
 
-                                                       &circlearrowright; <strong><a href="<?= $up.$esc($entry->getName()) ?>"
-                                                       ><?= $esc($entry) ?></a></strong>
+                                                       &circlearrowright; <strong><a href="<?= $up.$esc($entry->getName()) ?>"><?= $esc($entry) ?></a></strong>
 
                                                        <?php if ($entry->hasIterator()): ?>
 
                                                                <?php foreach ($entry as $sub) : /* @var \mdref\Entry $sub */ ?>
 
                                                                <li>
-                                                                       &rdsh; <a href="<?= $up.$esc($sub->getName()) ?>"
-                                                                       ><?= $esc($sub) ?></a>
+                                                                       &rdsh; <a href="<?= $up.$esc($sub->getName()) ?>"><?= $esc($sub) ?></a>
+                                                                       <?php $indents= [] ; $indent = "
+                                                                       ";
+                                                                       include __DIR__ . "/sidebar-rec.phtml"; ?>
+
                                                                </li>
                                                                <?php endforeach; ?>