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:'').'"';?>>