1<?php
2function icke_header() {
3    global $conf;
4?>
5<body>
6    <div id="icke__header">
7        <a class="logo" href="<?php echo wl()?>">
8          <?php if (tpl_getConf('logo') && file_exists(mediaFN(tpl_getConf('logo')))) {?>
9            <img src="<?php echo ml(tpl_getConf('logo'),array('w'=>95,'h'=>95))?>" alt="" />
10          <?php } ?>
11        </a>
12        <h5>
13            <?php echo $conf['title']?><br />
14            <span><?php echo $conf['tagline']?></span>
15        </h5>
16        <a class="branding" href="http://www.ickewiki.de">ICKE - Integrated Collaboration &amp; Knowledge Environment</a>
17    </div><!-- END icke__header -->
18
19    <div id="icke__toolbar">
20        <?php echo (new \dokuwiki\Menu\MobileMenu())->getDropdown(); ?>
21        <?php /* tpl_searchform()  FIXME this breaks the other search*/ ?>
22    </div>
23<?php
24}
25
26function icke_sidebar() {
27    global $USERINFO;
28    global $ACT;
29?>
30    <div id="icke__wrapper" class="dokuwiki act_<?php echo act_clean($ACT) ?>">
31        <ul id="icke__quicknav">
32        <?php icke_tplSidebar(); ?>
33        </ul><!-- END icke__quicknav -->
34        <div class="wrap">
35            <ul id="icke__sidebar">
36                <li class="logon">
37                    <?php
38                        if (!empty($_SERVER['REMOTE_USER'])) {
39                            echo '<a class="profile" href="'.wl(tpl_getConf('user_ns').$_SERVER['REMOTE_USER'].':') . '">'.hsc($USERINFO['name']).'</a>';
40                        }
41                        echo (new dokuwiki\Menu\Item\Login())->asHtmlLink(null, false);
42
43                        /** @var helper_plugin_do $doplugin */
44                        $doplugin = plugin_load('helper','do');
45                        if ($doplugin !== null && isset($_SERVER['REMOTE_USER'])) {
46                            $tasks = $doplugin->loadTasks(array('status' => array('undone'),
47                                                                'user'   => $_SERVER['REMOTE_USER']));
48                            switch (count($tasks)) {
49                                case 0:  $class = 'noopentasks'; break;
50                                case 1:  $class = 'opentask'; break;
51                                default: $class = 'opentasks'; break;
52                            }
53                            $ignoreme = array();
54                            $linktarget = tpl_getConf('tasks_page');
55                            if (substr($linktarget, 0, 1) !== ':') {
56                                $linktarget = tpl_getConf('user_ns'). $_SERVER['REMOTE_USER'] .
57                                              ':' . $linktarget;
58                            }
59                            echo '<a class="icke__' . $class . '"' .
60                                   ' href="' . wl($linktarget) . '">' .
61                                 sprintf(tpl_getLang($class), count($tasks)) . '</a>';
62                        }
63                    ?>
64                </li>
65                <li class="search">
66                    <?php icke_tplSearch(); ?>
67                </li>
68                <?php
69                $toc = tpl_toc(true);
70                global $ACT;
71                if ($toc || $ACT == 'show') {
72                ?>
73                <li class="table_of_contents sideclip">
74                    <?php
75                    echo $toc;
76                    if ($ACT == 'show') {
77                        /** @var helper_plugin_labeled $labeled */
78                        $labeled = plugin_load('helper','labeled');
79                        if ($labeled !== null) {
80                            $labels = $labeled->tpl_labels();
81                            if ($labels) {
82                                echo '<h3 class="labeled">'.tpl_getLang('labeled').'</h3>';
83                                echo $labels;
84                            }
85
86                        }
87
88                        /** @var helper_plugin_tagging $tags */
89                        $tags = plugin_load('helper','tagging');
90                        if ($tags !== null) {
91                            echo '<h3>'.tpl_getLang('tagging').'</h3>';
92                            $tags->tpl_tags();
93                        }
94                    }
95                    ?>
96                </li>
97                <?php } ?>
98
99                <?php icke_tplProjectSteps(); ?>
100
101            </ul><!-- END icke__sidebar -->
102<?php
103}
104