Skip to content

Commit

Permalink
Merge pull request #194 from splitbrain/loggedin-class
Browse files Browse the repository at this point in the history
added loggedIn class to main tpl container
  • Loading branch information
Chris--S committed Aug 1, 2013
2 parents 5dba76f + 39f0062 commit 806bda3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 5 deletions.
18 changes: 18 additions & 0 deletions inc/template.php
Expand Up @@ -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 :

4 changes: 2 additions & 2 deletions lib/tpl/dokuwiki/detail.php
Expand Up @@ -28,8 +28,8 @@

<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') ?>

Expand Down
5 changes: 2 additions & 3 deletions lib/tpl/dokuwiki/main.php
Expand Up @@ -27,9 +27,8 @@

<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') ?>

Expand Down

0 comments on commit 806bda3

Please sign in to comment.