Skip to content
Snippets Groups Projects
Commit 806bda37 authored by Christopher Smith's avatar Christopher Smith
Browse files

Merge pull request #194 from splitbrain/loggedin-class

added loggedIn class to main tpl container
parents 5dba76ff 39f00629
No related branches found
No related tags found
No related merge requests found
......@@ -1746,5 +1746,23 @@ function tpl_media() {
echo '</div>'.NL;
}
/**
* Return useful layout classes
*
* @author Anika Henke <anika@selfthinker.org>
*/
function tpl_classes() {
global $ACT, $conf, $ID, $INFO;
$classes = array(
'dokuwiki',
'mode_'.$ACT,
'tpl_'.$conf['template'],
$_SERVER['REMOTE_USER'] ? 'loggedIn' : '',
$INFO['exists'] ? '' : 'notFound',
($ID == $conf['start']) ? 'home' : '',
);
return join(' ', $classes);
}
//Setup VIM: ex: et ts=4 :
......@@ -28,8 +28,8 @@ header('X-UA-Compatible: IE=edge,chrome=1');
<body>
<!--[if lte IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]-->
<div id="dokuwiki__site"><div id="dokuwiki__top"
class="dokuwiki site mode_<?php echo $ACT ?>">
<div id="dokuwiki__site"><div id="dokuwiki__top" class="site <?php echo tpl_classes(); ?> <?php
echo ($showSidebar) ? 'showSidebar' : ''; ?> <?php echo ($hasSidebar) ? 'hasSidebar' : ''; ?>">
<?php include('tpl_header.php') ?>
......
......@@ -27,9 +27,8 @@ $showSidebar = $hasSidebar && ($ACT=='show');
<body>
<!--[if lte IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]-->
<div id="dokuwiki__site"><div id="dokuwiki__top"
class="dokuwiki site mode_<?php echo $ACT ?> <?php echo ($showSidebar) ? 'showSidebar' : '';
?> <?php echo ($hasSidebar) ? 'hasSidebar' : ''; ?>">
<div id="dokuwiki__site"><div id="dokuwiki__top" class="site <?php echo tpl_classes(); ?> <?php
echo ($showSidebar) ? 'showSidebar' : ''; ?> <?php echo ($hasSidebar) ? 'hasSidebar' : ''; ?>">
<?php include('tpl_header.php') ?>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment