summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnika Henke <anika@selfthinker.org>2012-01-05 00:07:59 +0000
committerAndreas Gohr <andi@splitbrain.org>2012-01-08 12:50:28 +0100
commit3d7fb39fd124400143b9fd776ad009233e42101b (patch)
tree5efa8d7645b5ad7bb90a5b7783d662948dc9e55e
parentb87a370164b2bce9dd27c90713ac92b14ef194dd (diff)
downloadrpg-3d7fb39fd124400143b9fd776ad009233e42101b.tar.gz
rpg-3d7fb39fd124400143b9fd776ad009233e42101b.tar.bz2
show sidebar only when it exists and in show mode (fixes #3 and #4)
-rwxr-xr-xcss/structure.css18
-rwxr-xr-xmain.php13
2 files changed, 10 insertions, 21 deletions
diff --git a/css/structure.css b/css/structure.css
index 19f351620..4e3a14be8 100755
--- a/css/structure.css
+++ b/css/structure.css
@@ -42,29 +42,15 @@ body {
margin: 0 1.5em 0 0;
}
- #dokuwiki__content {
+ .hasSidebar #dokuwiki__content {
float: right;
margin-left: -__sidebar_width__;
width: 100%;
}
- #dokuwiki__content .pad {
+ .hasSidebar #dokuwiki__content .pad {
margin-left: __sidebar_width__;
}
- /* don't show sidebar with fullscreen media manager or in the admin */
- .mode_media #dokuwiki__aside,
- .mode_admin #dokuwiki__aside {
- display: none;
- }
- .mode_media #dokuwiki__content,
- .mode_media #dokuwiki__content .pad,
- .mode_admin #dokuwiki__content,
- .mode_admin #dokuwiki__content .pad {
- float: none;
- margin-left: 0;
- margin-right: 0;
- }
-
#dokuwiki__footer {
clear: both;
}
diff --git a/main.php b/main.php
index 0a0765065..e5552215d 100755
--- a/main.php
+++ b/main.php
@@ -12,6 +12,7 @@ if (!defined('DOKU_INC')) die(); /* must be run from within DokuWiki */
@require_once(dirname(__FILE__).'/tpl_functions.php'); /* include hook for template functions */
$showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER['REMOTE_USER'] );
+$showSidebar = tpl_getConf('sidebarID') && page_exists(tpl_getConf('sidebarID')) && ($ACT=='show');
?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $conf['lang'] ?>"
@@ -33,7 +34,7 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER
<?php /* classes mode_<action> are added to make it possible to e.g. style a page differently if it's in edit mode,
see http://www.dokuwiki.org/devel:action_modes for a list of action modes */ ?>
<?php /* .dokuwiki should always be in one of the surrounding elements (e.g. plugins and templates depend on it) */ ?>
- <div id="dokuwiki__site"><div class="dokuwiki site mode_<?php echo $ACT ?>">
+ <div id="dokuwiki__site"><div class="dokuwiki site mode_<?php echo $ACT ?> <?php echo ($showSidebar) ? 'hasSidebar' : ''; ?>">
<?php html_msgarea() /* occasional error and info messages on top of the page */ ?>
<?php _tpl_include('header.html') ?>
@@ -109,10 +110,12 @@ $showTools = !tpl_getConf('hideTools') || ( tpl_getConf('hideTools') && $_SERVER
<div class="wrapper group">
- <!-- ********** ASIDE ********** -->
- <div id="dokuwiki__aside"><div class="pad include group">
- <?php tpl_include_page(tpl_getConf('sidebarID')) /* includes the given wiki page */ ?>
- </div></div><!-- /aside -->
+ <?php if($showSidebar): ?>
+ <!-- ********** ASIDE ********** -->
+ <div id="dokuwiki__aside"><div class="pad include group">
+ <?php tpl_include_page(tpl_getConf('sidebarID')) /* includes the given wiki page */ ?>
+ </div></div><!-- /aside -->
+ <?php endif; ?>
<!-- ********** CONTENT ********** -->
<div id="dokuwiki__content"><div class="pad group">