From 1e70067a36223be369656078e177e07b08cc3b37 Mon Sep 17 00:00:00 2001 From: Yannick Warnier Date: Tue, 27 Dec 2011 20:32:11 -0500 Subject: [PATCH] Added the section name as a class inside the body element. This will make it easier for CSS theming to adapt a style to the active section --- main/inc/global.inc.php | 4 ++++ main/inc/header.inc.php | 8 +++++--- main/inc/lib/template.lib.php | 8 +++++--- main/template/default/layout/main.tpl | 4 ++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/main/inc/global.inc.php b/main/inc/global.inc.php index edf1358ae7..fa8fe9ad38 100644 --- a/main/inc/global.inc.php +++ b/main/inc/global.inc.php @@ -287,6 +287,10 @@ require_once $lib_path.'formvalidator/Rule/allowed_tags.inc.php'; // Load HTMLPurifier. //require_once $lib_path.'htmlpurifier/library/HTMLPurifier.auto.php'; // It will be loaded later, in a lazy manner. +// Before we call local.inc.php, let's define a global $this_section variable +// which will then be usable from the banner and header scripts +$this_section = SECTION_GLOBAL; + // include the local (contextual) parameters of this course or section require $includePath.'/local.inc.php'; diff --git a/main/inc/header.inc.php b/main/inc/header.inc.php index e87704048a..2387845e9c 100644 --- a/main/inc/header.inc.php +++ b/main/inc/header.inc.php @@ -22,7 +22,7 @@ if (api_is_platform_admin()) { }*/ header('Content-Type: text/html; charset='.api_get_system_encoding()); //show the X-Powered-By header so that parsers can find it -global $_configuration; +global $_configuration, $this_section; header('X-Powered-By: '.$_configuration['software_name'].' '.substr($_configuration['system_version'],0,1)); $navigator_info = api_get_navigator(); @@ -204,8 +204,10 @@ if (!api_is_platform_admin()) { ?> > +if (defined('CHAMILO_HOMEPAGE') && CHAMILO_HOMEPAGE) { + echo 'onload="javascript: if(document.formLogin) { document.formLogin.login.focus(); }"'; +} +echo 'class="'.(!empty($this_section)?$this_section:'').'"';?>>