diff --git a/lang/en_utf8/moodle.php b/lang/en_utf8/moodle.php
index 2e4b88630af..a1e797ec098 100644
--- a/lang/en_utf8/moodle.php
+++ b/lang/en_utf8/moodle.php
@@ -1079,6 +1079,7 @@ $string['notenrolledprofile'] = 'This profile is not available because this user
$string['noteuserschangednonetocourse'] = 'Note: course users need to be restored when restoring user data (in activities, files or messages). This setting has been changed for you.';
$string['nothingnew'] = 'Nothing new since your last login';
$string['nothingtodisplay'] = 'Nothing to display';
+$string['notice'] = 'Notice';
$string['noticenewerbackup'] = 'This backup file has been created with Moodle $a->backuprelease ($a->backupversion) and it\'s newer than your currently installed Moodle $a->serverrelease ($a->serverversion). This could cause some inconsistencies because backwards compatibility of backup files cannot be guaranteed.';
$string['notifications'] = 'Notifications';
$string['notifyloginfailuresmessage'] = '$a->time, IP: $a->ip, User: $a->info';
diff --git a/lib/adminlib.php b/lib/adminlib.php
index ffa9b146da7..1406e9a4ea3 100644
--- a/lib/adminlib.php
+++ b/lib/adminlib.php
@@ -3115,26 +3115,27 @@ function admin_externalpage_print_header() {
foreach ($lt1 as $column) {
switch ($column) {
case 'left':
- echo '
';
- print_container_start();
- blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
- print_container_end();
- echo ' | ';
+ echo '';
+ print_container_start();
+ blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
+ print_container_end();
+ echo ' | ';
break;
case 'middle':
- echo '';
- print_container_start(true);
+ echo ' | ';
+ print_container_start(true);
+ $THEME->open_header_containers++; // this is hacky workaround for the error()/notice() autoclosing problems on admin pages
break;
case 'right':
- if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT)) {
- echo ' | ';
- print_container_start();
- blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
- print_container_end();
- echo ' | ';
- }
+ if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT)) {
+ echo '';
+ print_container_start();
+ blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
+ print_container_end();
+ echo ' | ';
+ }
break;
}
}
@@ -3169,27 +3170,27 @@ function admin_externalpage_print_footer() {
foreach ($lt as $column) {
switch ($column) {
case 'left':
- echo '';
- print_container_start();
- blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
- print_container_end();
- echo ' | ';
+ echo '';
+ print_container_start();
+ blocks_print_group($PAGE, $pageblocks, BLOCK_POS_LEFT);
+ print_container_end();
+ echo ' | ';
break;
case 'middle':
- print_container_end();
- echo '';
+ print_container_end();
+ $THEME->open_header_containers--; // this is hacky workaround for the error()/notice() autoclosing problems on admin pages
+ echo '';
break;
case 'right':
- if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT)) {
- echo '';
- print_container_start();
- blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
-
- print_container_end();
- echo ' | ';
- }
+ if (blocks_have_content($pageblocks, BLOCK_POS_RIGHT)) {
+ echo '';
+ print_container_start();
+ blocks_print_group($PAGE, $pageblocks, BLOCK_POS_RIGHT);
+ print_container_end();
+ echo ' | ';
+ }
break;
}
}
diff --git a/lib/weblib.php b/lib/weblib.php
index 767a9853a50..9d386995394 100644
--- a/lib/weblib.php
+++ b/lib/weblib.php
@@ -80,6 +80,13 @@ define('FORMAT_MARKDOWN', '4'); // Markdown-formatted text http://daringfireba
define('TRUSTTEXT', '#####TRUSTTEXT#####');
+/**
+ * Javascript related defines
+ */
+define('REQUIREJS_BEFOREHEADER', 0);
+define('REQUIREJS_INHEADER', 1);
+define('REQUIREJS_AFTERHEADER', 2);
+
/**
* Allowed tags - string of html tags that can be tested against for safe html tags
* @global string $ALLOWED_TAGS
@@ -2526,6 +2533,9 @@ function print_header ($title='', $heading='', $navigation='', $focus='',
$output = ob_get_contents();
ob_end_clean();
+ // container debugging info
+ $THEME->open_header_containers = open_containers();
+
// Skip to main content, see skip_main_destination().
if ($pageid=='course-view' or $pageid=='site-index' or $pageid=='course-index') {
$skiplink = ''.get_string('tocontent', 'access').'';
@@ -2551,10 +2561,6 @@ function print_header ($title='', $heading='', $navigation='', $focus='',
}
}
-define('REQUIREJS_BEFOREHEADER',0);
-define('REQUIREJS_INHEADER',1);
-define('REQUIREJS_AFTERHEADER',2);
-
/**
* Used to include JavaScript libraries.
*
@@ -2758,12 +2764,14 @@ function print_header_simple($title='', $heading='', $navigation='', $focus='',
/**
* Can provide a course object to make the footer contain a link to
* to the course home page, otherwise the link will go to the site home
- *
- * @uses $CFG
* @uses $USER
- * @param course $course {@link $COURSE} object containing course information
- * @param ? $usercourse ?
- * @todo Finish documenting this function
+ * @param mixed $course course object, used for course link button or
+ * 'none' means no user link, only docs link
+ * 'empty' means nothing printed in footer
+ * 'home' special frontpage footer
+ * @param object $usercourse course used in user link
+ * @param boolean $return output as string
+ * @return mixed string or void
*/
function print_footer($course=NULL, $usercourse=NULL, $return=false) {
global $USER, $CFG, $THEME, $COURSE;
@@ -2773,23 +2781,45 @@ function print_footer($course=NULL, $usercourse=NULL, $return=false) {
return;
}
-/// Course links
+/// Course links or special footer
if ($course) {
- if (is_string($course) && $course == 'none') { // Don't print any links etc
+ if ($course === 'empty') {
+ // special hack - sometimes we do not want even the docs link in footer
+ $output = '';
+ if (!empty($THEME->open_header_containers)) {
+ for ($i=0; $i<$THEME->open_header_containers; $i++) {
+ $output .= print_container_end_all(); // containers opened from header
+ }
+ } else {
+ //1.8 theme compatibility
+ $output .= "\n"; // content div
+ }
+ $output .= "\n\n