xref: /template/kiwiki/partial/sidebar_toc.php (revision ced2e461afa984ef80ee8230228ddac6325a1cad)
1<?php
2/* disable sidemenu on login and some pages */
3
4    //var_dump($ACT);
5    if ((page_exists($sidebar) && $ACT == 'show' && $sidebar_right == $right) || ($toc!="" && $toc_right == $right)){
6    ?>
7    <div class="kiwiki_aside <?php echo ($right == 1) ? 'right' : 'left'; ?>">
8            <div class="dokuwiki__aside_wrapper">
9            <?php
10            /* sidebar */
11            if ($ACT == 'show' && page_exists($sidebar) && $sidebar_right == $right) {
12
13                ?>
14                <div class="kiwiki-sidebar">
15                    <div class="sidebar-content">
16                    <?php
17                    tpl_include_page($sidebar, true, true);
18                    echo Kiwiki_Functions::_edit_icon($sidebar);
19                    ?>
20                    </div>
21                </div>
22
23            <?php
24            }
25            /*toc*/
26            if ($toc!="" && $toc_right == $right){
27                // Capture the TOC output
28                ob_start();
29                echo tpl_toc();
30                $toc_html = ob_get_clean();
31
32                // Add role="button" to the first <h3> tag
33                $toc_html = preg_replace('/<h3([^>]*)>/', '<h3$1 role="button">', $toc_html, 1);
34
35                echo $toc_html;
36            }
37            ?>
38            </div>
39    </div>
40    <?php
41    }
42    ?>