Browse Source

added tpl_classes() function

master
Anika Henke 11 years ago
parent
commit
9082afe90a
  1. 2
      detail.php
  2. 9
      main.php
  3. 2
      mediamanager.php
  4. 19
      tpl_functions.php

2
detail.php

@ -30,7 +30,7 @@ header('X-UA-Compatible: IE=edge,chrome=1');
<body> <body>
<!--[if lte IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]--> <!--[if lte IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]-->
<div id="dokuwiki__detail" class="dokuwiki">
<div id="dokuwiki__detail" class="<?php echo tpl_classes(); ?>">
<?php html_msgarea() ?> <?php html_msgarea() ?>
<?php if($ERROR){ print $ERROR; }else{ ?> <?php if($ERROR){ print $ERROR; }else{ ?>

9
main.php

@ -32,11 +32,10 @@ $showSidebar = page_findnearest($conf['sidebar']) && ($ACT=='show');
<!--[if lte IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]--> <!--[if lte IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]-->
<?php /* the "dokuwiki__top" id is needed somewhere at the top, because that's where the "back to top" button/link links to */ ?> <?php /* the "dokuwiki__top" id is needed somewhere at the top, because that's where the "back to top" button/link links to */ ?>
<?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 id="dokuwiki__top"
class="dokuwiki site mode_<?php echo $ACT ?> <?php echo ($showSidebar) ? 'hasSidebar' : '' ?>">
<?php /* tpl_classes() provides useful CSS classes; if you choose not to use it, the 'dokuwiki' class at least
should always be in one of the surrounding elements (e.g. plugins and templates depend on it) */ ?>
<div id="dokuwiki__site"><div id="dokuwiki__top" class="site <?php echo tpl_classes(); ?> <?php
echo ($showSidebar) ? 'hasSidebar' : ''; ?>">
<?php html_msgarea() /* occasional error and info messages on top of the page */ ?> <?php html_msgarea() /* occasional error and info messages on top of the page */ ?>
<?php tpl_includeFile('header.html') ?> <?php tpl_includeFile('header.html') ?>

2
mediamanager.php

@ -28,7 +28,7 @@ header('X-UA-Compatible: IE=edge,chrome=1');
<body> <body>
<!--[if lte IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]--> <!--[if lte IE 7 ]><div id="IE7"><![endif]--><!--[if IE 8 ]><div id="IE8"><![endif]-->
<div id="media__manager" class="dokuwiki">
<div id="media__manager" class="<?php echo tpl_classes(); ?>">
<?php html_msgarea() ?> <?php html_msgarea() ?>
<div id="mediamgr__aside"><div class="pad"> <div id="mediamgr__aside"><div class="pad">
<h1><?php echo hsc($lang['mediaselect'])?></h1> <h1><?php echo hsc($lang['mediaselect'])?></h1>

19
tpl_functions.php

@ -247,9 +247,28 @@ if (!function_exists('tpl_incdir')) {
/** /**
* does *not* emulate the core function, but returns only * does *not* emulate the core function, but returns only
* if sidebar is set to make it roughly backwards compatible * if sidebar is set to make it roughly backwards compatible
* (available since Adora Belle)
*/ */
if (!function_exists('page_findnearest')) { if (!function_exists('page_findnearest')) {
function page_findnearest($sidebar){ function page_findnearest($sidebar){
return $sidebar; return $sidebar;
} }
} }
/**
* copied from core (will be available in autumn 2013 release)
*/
if (!function_exists('tpl_classes')) {
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);
}
}
Loading…
Cancel
Save