1<?php
2
3/**
4 * Template header, included in the main and detail files
5 */
6
7// must be run from within DokuWiki
8if (!defined('DOKU_INC')) die();
9?>
10
11<!-- 小屏幕才显示的导航菜单 -->
12<div id="app-navigation" class="app-navigation">
13    <div class="navigation app-backControl">
14        <button class="btn btn-icon navigation-drawer has-icon" type="button" title="" data-trigger="#drawer">
15            <svg t="1610551510682" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="7066" width="24" height="24">
16                <path d="M840.544 716.8c7.04 0 12.8 5.76 12.8 12.8v42.656a12.8 12.8 0 0 1-12.8 12.8H183.456a12.8 12.8 0 0 1-12.8-12.8V729.6c0-7.04 5.76-12.8 12.8-12.8h657.088z m0-238.944c7.04 0 12.8 5.76 12.8 12.8v42.688a12.8 12.8 0 0 1-12.8 12.8H183.456a12.8 12.8 0 0 1-12.8-12.8v-42.688c0-7.04 5.76-12.8 12.8-12.8h657.088z m0-238.912c7.04 0 12.8 5.728 12.8 12.8V294.4a12.8 12.8 0 0 1-12.8 12.8H183.456a12.8 12.8 0 0 1-12.8-12.8V251.744c0-7.072 5.76-12.8 12.8-12.8h657.088z" p-id="7067" fill="#515151"></path>
17            </svg>
18        </button>
19    </div>
20</div>
21
22<!-- ********** HEADER ********** -->
23<div class="drawer-backdrop"></div>
24<!-- 小屏幕时弹出的侧边栏 -->
25<div id="drawer" class="app-drawer">
26    <header class="app-header navbar-fixed-top">
27        <div class="container">
28            <h1 class="header-title" title="<?= $conf['title']; ?>">
29                <?php
30                tpl_link(
31                    wl(),
32                    $conf['title'],
33                    'accesskey="h" title="[H]"'
34                );
35                ?>
36            </h1>
37            <!-- <div id="header-primary" class="header-primary">
38                <ul class="header-controls">
39                    <li>
40                        <a class="btn btn-link" title="demo" href="###">demo</a>
41                    </li>
42                </ul>
43            </div> -->
44            <div id="header-secondary" class="header-secondary">
45                <ul class="header-controls">
46                    <li class="item-search">
47                        <div class="search">
48                            <?php tpl_searchform(); ?>
49                        </div>
50                    </li>
51                    <?php if ($conf['useacl']) : ?>
52                        <?php if (!empty($_SERVER['REMOTE_USER'])) : ?>
53                            <li>
54                                <div class="dropdown">
55                                    <a class="btn btn-link dropdown-toggle" id="userTools" href="javascript:;" role="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
56                                        <span class="username"><?php echo htmlentities($_SERVER['REMOTE_USER']); ?></span>
57                                    </a>
58                                    <ul class="dropdown-menu dropdown-menu-right" aria-labelledby="userTools">
59                                        <?php echo (new \dokuwiki\Menu\SiteMenu())->getListItems('', false); ?>
60                                        <li class="dropdown-separator"></li>
61                                        <?php
62                                        $items = (new \dokuwiki\Menu\UserMenu())->getItems();
63                                        foreach ($items as $item) {
64                                        ?>
65                                            <li><a href="<?= $item->getLink(); ?>" title="<?= $item->getTitle(); ?>"><?= $item->getLabel(); ?></a></li>
66                                        <?php } ?>
67                                    </ul>
68                                </div>
69                            </li>
70                        <?php else : ?>
71                            <li>
72                                <a class="btn btn-link" href="/?do=register">
73                                    <?php
74                                        global $lang;
75                                        echo $lang['btn_register'];
76                                    ?>
77                                </a>
78                            </li>
79                            <li>
80                                <a class="btn btn-link" href="/?do=login&sectok="><?php echo $lang['btn_login']; ?></a>
81                            </li>
82                        <?php endif ?>
83                    <?php endif ?>
84                </ul>
85            </div>
86        </div>
87    </header>
88</div>
89