xref: /template/sprintdoc/tpl/main-sidebar-nav.php (revision 95823334d443d78b26b2aba8490b427072d430b7)
1
2<?php
3echo \dokuwiki\template\sprintdoc\Template::getInstance()->getNavigation();
4?>
5
6<nav class="nav-sitetools">
7    <div class="nav"><a href="#sidebar-site-tools" role="heading" aria-level="2">
8        <span class="ico"><?php echo inlineSVG(__DIR__ . '/../img/sitemap.svg') ?></span>
9        <span class="lbl"><?php echo $lang['site_tools']; ?></span>
10    </a></div>
11    <div class="nav-panel level1">
12        <ul id="sidebar-site-tools" class="toollist">
13            <?php
14            if (file_exists(DOKU_INC . 'inc/Menu/SiteMenu.php')) {
15                echo (new \dokuwiki\Menu\SiteMenu())->getListItems('toollist__listitem ');
16            } else {
17                //Pre-Greebo Backwards compatibility
18                tpl_toolsevent(
19                    'sitetools',
20                    array(
21                        'recent' => tpl_action('recent', 1, 'li', 1),
22                        'media' => tpl_action('media', 1, 'li', 1),
23                        'index' => tpl_action('index', 1, 'li', 1),
24                    )
25                );
26            }
27            ?>
28        </ul>
29    </div>
30</nav>
31
32
33<nav class="nav-usermenu">
34    <div class="nav"><a href="#sidebar-user-tools" role="heading" aria-level="2">
35        <span class="ico"><?php echo inlineSVG(__DIR__ . '/../img/account-settings.svg') ?></span>
36        <span class="lbl"><?php echo $lang['user_tools']; ?></span>
37    </a></div>
38    <div class="nav-panel level1">
39        <ul id="sidebar-user-tools" class="toollist">
40            <?php /* dokuwiki user tools */
41            if (file_exists(DOKU_INC . 'inc/Menu/UserMenu.php')) {
42                echo (new \dokuwiki\Menu\UserMenu())->getListItems('toollist__listitem ');
43            } else {
44                //Pre-Greebo Backwards compatibility
45                tpl_toolsevent(
46                    'usertools',
47                    array(
48                        'login' => tpl_action('login', 1, 'li', 1),
49                        'profile' => tpl_action('profile', 1, 'li', 1),
50                        'admin' => tpl_action('admin', 1, 'li', 1),
51                        'register' => tpl_action('register', 1, 'li', 1),
52                    )
53                );
54            }
55            ?>
56        </ul>
57    </div>
58</nav>
59
60<?php
61/** @var helper_plugin_starred $plugin_starred */
62$plugin_starred = plugin_load('helper', 'starred');
63$stars = array();
64if($plugin_starred) $stars = $plugin_starred->loadStars();
65if($stars):
66    ?>
67    <nav class="nav-starred">
68        <div class="nav"><a href="#sidebar-menu-starred" role="heading" aria-level="2">
69            <span class="ico"><?php echo inlineSVG(__DIR__ . '/../img/star-circle.svg') ?></span>
70            <span class="lbl"><?php echo tpl_getLang('head_menu_starred'); ?></span>
71        </a></div>
72        <div class="nav-panel level1 plugin_starred">
73            <ul id="sidebar-menu-starred">
74                <?php
75                foreach($stars as $pid => $time) {
76                    echo '<li>';
77                    echo $plugin_starred->starHtml($ID, $pid);
78                    echo '&nbsp;';
79                    echo html_wikilink(":$pid");
80                    echo '</li>';
81                }
82                ?>
83            </ul>
84        </div>
85    </nav>
86<?php endif; ?>
87
88
89
90<?php if($conf['breadcrumbs']): ?>
91    <nav class="nav-trace">
92        <div class="nav"><a href="#sidebar-menu_trace" role="heading" aria-level="2">
93            <span class="ico"><?php echo inlineSVG(__DIR__ . '/../img/apple-safari.svg') ?></span>
94            <span class="lbl"><?php echo tpl_getLang('head_menu_trace'); ?></span>
95        </a></div>
96        <div class="nav-panel level1">
97            <ul id="sidebar-menu_trace">
98                <?php /* trace breadcrumbs as list */
99                // FIXME move to helper class
100                $crumbs = breadcrumbs();
101                $crumbs = array_reverse($crumbs, true);
102                foreach($crumbs as $id => $name) {
103                    echo '<li>';
104                    tpl_link(wl($id), hsc($name), 'title="' . $id . '"');
105                    echo '</li>';
106                }
107                ?>
108            </ul>
109        </div>
110    </nav>
111<?php endif ?>
112