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