xref: /template/writr/main.php (revision 9e642b38b0c8b5f46214462a9c2fcbab40c6f025)
1<?php
2/**
3 * DokuWiki Writr Template
4 *
5 * @link     http://dokuwiki.org/template:writr
6 * @author   Anika Henke <anika@selfthinker.org>
7 * @license  GPL 2 (http://www.gnu.org/licenses/gpl.html)
8 */
9
10if (!defined('DOKU_INC')) die();
11@require_once(dirname(__FILE__).'/tpl_functions.php');
12header('X-UA-Compatible: IE=edge,chrome=1');
13$showSidebar = page_findnearest($conf['sidebar']);
14?><!DOCTYPE html>
15<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang'] ?>"
16  lang="<?php echo $conf['lang'] ?>" dir="<?php echo $lang['direction'] ?>" class="no-js">
17<head>
18    <meta charset="UTF-8" />
19    <title><?php tpl_pagetitle() ?> [<?php echo strip_tags($conf['title']) ?>]</title>
20    <script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script>
21    <?php tpl_metaheaders() ?>
22    <meta name="viewport" content="width=device-width,initial-scale=1" />
23    <?php echo tpl_favicon(array('favicon', 'mobile')) ?>
24    <?php tpl_includeFile('meta.html') ?>
25    <link href='http://fonts.googleapis.com/css?family=Montserrat:400,700' rel='stylesheet' type='text/css' />
26</head>
27
28<body id="dokuwiki__top" class="sidebar-closed <?php echo tpl_classes(); ?>">
29    <div id="writr__page" class="hfeed <?php echo ($showSidebar) ? 'hasSidebar' : ''; ?>">
30        <?php tpl_includeFile('header.html') ?>
31
32        <div class="sidebar-area group" id="writr__sidebar">
33            <a id="writr__sidebar-toggle" href="#writr__secondary" title="<?php echo $lang['sidebar'] ?>">
34                <span class="genericon genericon-close"></span>
35                <span class="a11y"><?php echo $lang['sidebar'] ?></span>
36            </a>
37
38            <!-- ********** HEADER ********** -->
39            <header id="writr__masthead" class="site-header" role="banner">
40                <?php
41                    $logoSize = array();
42                    $logo = tpl_getMediaFile(array(':wiki:logo.png', ':logo.png', 'images/logo.png'), false, $logoSize);
43                ?>
44
45                <a class="site-logo"  href="<?php echo wl(); ?>" title="<?php echo $conf['title']; ?>" rel="home" accesskey="h" title="[H]">
46                    <img src="<?php echo $logo; ?>" <?php echo $logoSize[3]; ?> alt="" class="no-grav header-image" />
47                </a>
48
49                <div class="site-branding">
50                    <h1 class="site-title"><a href="<?php echo wl(); ?>" rel="home" accesskey="h" title="[H]"><?php echo $conf['title']; ?></a></h1>
51                    <?php if ($conf['tagline']): ?>
52                        <h2 class="site-description"><?php echo $conf['tagline'] ?></h2>
53                    <?php endif ?>
54                </div>
55
56                <div class="search-form widget">
57                    <?php tpl_searchform() ?>
58                </div>
59
60                <?php if (page_findnearest('topnav')): ?>
61                    <nav id="writr__site-navigation" class="main-navigation" role="navigation">
62                        <h1 class="menu-toggle genericon genericon-menu">
63                            <span class="a11y"><?php /* TODO: _e( 'Menu', 'writr' );*/ ?>Menu</span>
64                        </h1>
65                        <div class="a11y skip-link">
66                            <a href="#writr__content"><?php echo $lang['skip_to_content'] ?></a>
67                        </div>
68                        <?php tpl_include_page('topnav', 1, 1) ?>
69                    </nav><!-- #writr__site-navigation -->
70                <?php endif; ?>
71            </header><!-- #writr__masthead -->
72
73            <div id="writr__secondary" class="widget-area" role="complementary">
74                <div class="widget">
75                    <?php tpl_includeFile('sidebarheader.html') ?>
76                    <?php tpl_include_page($conf['sidebar'], 1, 1) ?>
77                    <?php tpl_includeFile('sidebarfooter.html') ?>
78                </div>
79
80                <div class="tools widget_links widget">
81                    <!-- SITE TOOLS -->
82                    <div class="site-tools">
83                        <h3><?php echo $lang['site_tools'] ?></h3>
84                        <ul>
85                            <?php _tpl_toolsevent('sitetools', array(
86                                'recent'    => tpl_action('recent', 1, 'li', 1),
87                                'media'     => tpl_action('media', 1, 'li', 1),
88                                'index'     => tpl_action('index', 1, 'li', 1),
89                            )); ?>
90                        </ul>
91                    </div>
92
93                    <!-- PAGE TOOLS -->
94                    <div class="page-tools">
95                        <h3 class="a11y"><?php echo $lang['page_tools'] ?></h3>
96                        <ul>
97                            <?php _tpl_toolsevent('pagetools', array(
98                                'edit'      => tpl_action('edit', 1, 'li', 1, '<span></span> <span class="a11y">', '</span>'),
99                                'revisions' => tpl_action('revisions', 1, 'li', 1, '<span></span> <span class="a11y">', '</span>'),
100                                'backlink'  => tpl_action('backlink', 1, 'li', 1, '<span></span> <span class="a11y">', '</span>'),
101                                'subscribe' => tpl_action('subscribe', 1, 'li', 1, '<span></span> <span class="a11y">', '</span>'),
102                                'revert'    => tpl_action('revert', 1, 'li', 1, '<span></span> <span class="a11y">', '</span>'),
103                                'top'       => tpl_action('top', 1, 'li', 1, '<span></span> <span class="a11y">', '</span>'),
104                            )); ?>
105                        </ul>
106                    </div>
107
108                    <?php if ($conf['useacl']): ?>
109                        <!-- USER TOOLS -->
110                        <div class="user-tools">
111                            <h3><?php echo $lang['user_tools'] ?></h3>
112                            <ul>
113                                <?php _tpl_toolsevent('usertools', array(
114                                    'admin'     => tpl_action('admin', 1, 'li', 1),
115                                    'profile'   => tpl_action('profile', 1, 'li', 1),
116                                    'register'  => tpl_action('register', 1, 'li', 1),
117                                    'login'     => tpl_action('login', 1, 'li', 1),
118                                )); ?>
119                            </ul>
120                        </div>
121
122                        <?php
123                            if (!empty($_SERVER['REMOTE_USER'])) {
124                                echo '<p class="user">';
125                                tpl_userinfo();
126                                echo '</p>';
127                            }
128                        ?>
129                    <?php endif ?>
130                </div>
131
132                <footer id="writr__colophon" class="site-footer" role="contentinfo">
133                    <div class="site-info">
134                        <?php tpl_license('button') ?>
135                        <?php tpl_includeFile('footer.html') ?>
136                    </div><!-- .site-info -->
137                </footer><!-- #writr__colophon -->
138
139            </div>
140        </div>
141
142        <div id="writr__content" class="site-content">
143            <div id="writr__primary" class="content-area">
144
145                <!-- BREADCRUMBS -->
146                <?php if($conf['breadcrumbs']){ ?>
147                    <div class="breadcrumbs"><?php tpl_breadcrumbs() ?></div>
148                <?php } ?>
149                <?php if($conf['youarehere']){ ?>
150                    <div class="breadcrumbs"><?php tpl_youarehere() ?></div>
151                <?php } ?>
152
153                <main id="writr__main" class="site-main" role="main">
154
155                    <?php tpl_flush() ?>
156                    <?php tpl_includeFile('pageheader.html') ?>
157
158                    <?php html_msgarea() ?>
159                    <!-- wikipage start -->
160                    <?php tpl_content() ?>
161                    <!-- wikipage stop -->
162
163                    <?php tpl_flush() ?>
164                    <?php tpl_includeFile('pagefooter.html') ?>
165                </main><!-- #writr__main -->
166
167                <p class="page-footer"><?php tpl_pageinfo() ?></p>
168            </div><!-- #writr__primary -->
169        </div><!-- #writr__content -->
170    </div><!-- #writr__page -->
171
172    <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
173</body>
174</html>
175