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

skala
Yannick Warnier 14 years ago
parent 9414d98b9d
commit 1e70067a36
  1. 4
      main/inc/global.inc.php
  2. 8
      main/inc/header.inc.php
  3. 8
      main/inc/lib/template.lib.php
  4. 4
      main/template/default/layout/main.tpl

@ -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';

@ -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()) {
?>
</head>
<body dir="<?php echo api_get_text_direction(); ?>" <?php
if (defined('CHAMILO_HOMEPAGE') && CHAMILO_HOMEPAGE)
echo 'onload="javascript: if(document.formLogin) { document.formLogin.login.focus(); }"'; ?>>
if (defined('CHAMILO_HOMEPAGE') && CHAMILO_HOMEPAGE) {
echo 'onload="javascript: if(document.formLogin) { document.formLogin.login.focus(); }"';
}
echo 'class="'.(!empty($this_section)?$this_section:'').'"';?>>
<div class="skip">
<ul>
<li><a href="#menu"><?php echo get_lang('WCAGGoMenu'); ?></a></li>

@ -281,11 +281,13 @@ class Template extends Smarty {
foreach($css_files as $css_file) {
$css_file_to_string .= api_get_css($css_file);
}
global $this_section, $nameTools;
$this->assign('css_file_to_string', $css_file_to_string);
$this->assign('js_file_to_string', $js_file_to_string);
$this->assign('text_direction', api_get_text_direction());
$this->assign('style_print', $style_print);
$this->assign('text_direction', api_get_text_direction());
$this->assign('style_print', $style_print);
$this->assign('section_name', 'section-'.$this_section);
$extra_headers = '';
if (isset($htmlHeadXtra) && $htmlHeadXtra) {

@ -6,7 +6,7 @@
{include file="default/layout/head.tpl"}
</head>
<body dir="{$text_direction}">
<body dir="{$text_direction}" class="{$section_name}">
<div class="skip">
<ul>
@ -34,4 +34,4 @@
</div> <!-- end of #wrapper section -->
{block name="footer"}{/block}
</body>
</html>
</html>

Loading…
Cancel
Save