From c71db656795e82055d114764ad93f71a968a2f28 Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Sun, 21 Jul 2013 21:20:44 +0100 Subject: added tpl_classes() to return useful layout classes --- inc/template.php | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'inc') diff --git a/inc/template.php b/inc/template.php index a87650b84..087e2f9df 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1748,5 +1748,23 @@ function tpl_media() { echo ''.NL; } +/** + * Return useful layout classes + * + * @author Anika Henke + */ +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 : -- cgit v1.2.3 From 39f00629c3ce90b643728a3afa5ee7c74faa481c Mon Sep 17 00:00:00 2001 From: Anika Henke Date: Thu, 1 Aug 2013 18:54:02 +0100 Subject: improved coding style on tpl_classes() --- inc/template.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'inc') diff --git a/inc/template.php b/inc/template.php index 087e2f9df..6566df7ad 100644 --- a/inc/template.php +++ b/inc/template.php @@ -1759,8 +1759,8 @@ function tpl_classes() { 'dokuwiki', 'mode_'.$ACT, 'tpl_'.$conf['template'], - ($_SERVER['REMOTE_USER']) ? 'loggedIn' : '', - ($INFO['exists']) ? '' : 'notFound', + $_SERVER['REMOTE_USER'] ? 'loggedIn' : '', + $INFO['exists'] ? '' : 'notFound', ($ID == $conf['start']) ? 'home' : '', ); return join(' ', $classes); -- cgit v1.2.3