xref: /template/writr/main.php (revision 9116ecf3dfcfbcdcf4b5c7858dc0a9b36972bfd1)
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                        <h3 class="menu-toggle genericon genericon-menu" title="<?php echo tpl_getLang('menu') ?>">
63                            <span class="a11y"><?php echo tpl_getLang('menu') ?></span>
64                        </h3>
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                <?php if ($conf['sidebar']): ?>
75                    <div class="widget">
76                        <?php tpl_includeFile('sidebarheader.html') ?>
77                        <?php tpl_include_page($conf['sidebar'], 1, 1) ?>
78                        <?php tpl_includeFile('sidebarfooter.html') ?>
79                    </div>
80                <?php endif ?>
81
82                <div class="tools widget_links widget">
83                    <!-- SITE TOOLS -->
84                    <div class="site-tools">
85                        <h3><?php echo $lang['site_tools'] ?></h3>
86                        <ul>
87                            <?php _tpl_toolsevent('sitetools', array(
88                                'recent'    => tpl_action('recent', 1, 'li', 1),
89                                'media'     => tpl_action('media', 1, 'li', 1),
90                                'index'     => tpl_action('index', 1, 'li', 1),
91                            )); ?>
92                        </ul>
93                    </div>
94
95                    <!-- PAGE TOOLS -->
96                    <div class="page-tools">
97                        <h3 class="a11y"><?php echo $lang['page_tools'] ?></h3>
98                        <ul>
99                            <?php _tpl_toolsevent('pagetools', array(
100                                'edit'      => tpl_action('edit', 1, 'li', 1, '<span></span> <span class="a11y">', '</span>'),
101                                'revisions' => tpl_action('revisions', 1, 'li', 1, '<span></span> <span class="a11y">', '</span>'),
102                                'backlink'  => tpl_action('backlink', 1, 'li', 1, '<span></span> <span class="a11y">', '</span>'),
103                                'subscribe' => tpl_action('subscribe', 1, 'li', 1, '<span></span> <span class="a11y">', '</span>'),
104                                'revert'    => tpl_action('revert', 1, 'li', 1, '<span></span> <span class="a11y">', '</span>'),
105                                'top'       => tpl_action('top', 1, 'li', 1, '<span></span> <span class="a11y">', '</span>'),
106                            )); ?>
107                        </ul>
108                    </div>
109
110                    <?php if ($conf['useacl']): ?>
111                        <!-- USER TOOLS -->
112                        <div class="user-tools">
113                            <h3><?php echo $lang['user_tools'] ?></h3>
114                            <ul>
115                                <?php _tpl_toolsevent('usertools', array(
116                                    'admin'     => tpl_action('admin', 1, 'li', 1),
117                                    'profile'   => tpl_action('profile', 1, 'li', 1),
118                                    'register'  => tpl_action('register', 1, 'li', 1),
119                                    'login'     => tpl_action('login', 1, 'li', 1),
120                                )); ?>
121                            </ul>
122                        </div>
123
124                        <?php
125                            if (!empty($_SERVER['REMOTE_USER'])) {
126                                echo '<p class="user">';
127                                tpl_userinfo();
128                                echo '</p>';
129                            }
130                        ?>
131                    <?php endif ?>
132                </div>
133
134                <footer id="writr__colophon" class="site-footer" role="contentinfo">
135                    <div class="site-info">
136                        <?php tpl_license('button') ?>
137                        <?php tpl_includeFile('footer.html') ?>
138                    </div><!-- .site-info -->
139                </footer><!-- #writr__colophon -->
140
141            </div>
142        </div>
143
144        <div id="writr__content" class="site-content">
145            <div id="writr__primary" class="content-area">
146
147                <!-- BREADCRUMBS -->
148                <?php if($conf['breadcrumbs']){ ?>
149                    <div class="breadcrumbs"><?php tpl_breadcrumbs() ?></div>
150                <?php } ?>
151                <?php if($conf['youarehere']){ ?>
152                    <div class="breadcrumbs"><?php tpl_youarehere() ?></div>
153                <?php } ?>
154
155                <main id="writr__main" class="site-main" role="main">
156
157                    <?php tpl_flush() ?>
158                    <?php tpl_includeFile('pageheader.html') ?>
159
160                    <?php html_msgarea() ?>
161                    <!-- wikipage start -->
162                    <?php tpl_content() ?>
163                    <!-- wikipage stop -->
164
165                    <?php tpl_flush() ?>
166                    <?php tpl_includeFile('pagefooter.html') ?>
167                </main><!-- #writr__main -->
168
169                <p class="page-footer"><?php tpl_pageinfo() ?></p>
170            </div><!-- #writr__primary -->
171        </div><!-- #writr__content -->
172    </div><!-- #writr__page -->
173
174    <div class="no"><?php tpl_indexerWebBug() /* provide DokuWiki housekeeping, required in all templates */ ?></div>
175</body>
176</html>
177