$menu = '';
}
+/// there should be exactly one open container 'content'
+ if (open_containers() != 1) {
+ debugging('Unexpected number of open containers: '.open_containers().', expecting 1.', DEBUG_DEVELOPER);
+ }
+
/// Provide some performance info if required
$performanceinfo = '';
if (defined('MDL_PERF') || (!empty($CFG->perfdebug) and $CFG->perfdebug > 7)) {
global $THEME;
if (empty($THEME->open_containers)) {
- debugging('Incorrect closing of custom corners - no more open containers');
+ debugging('Incorrect closing of custom corners - no more open containers.', DEBUG_DEVELOPER);
$idbase = '';
} else {
$idbase = array_pop($THEME->open_containers);
}
}
+/**
+ * Returns number of currently open containers
+ * @return int number of open containers
+ */
+function open_containers() {
+ global $THEME;
+
+ if (!isset($THEME->open_containers)) {
+ $THEME->open_containers = array();
+ }
+
+ return count($THEME->open_containers);
+}
+
/**
* Force closing of all open containers except the main content one.
* @param boolean $return, return as string or just print it
<?php } else if ($heading) { // If no navigation, but a heading, then print a line
?>
<hr />
-<?php }
- print_container_end(); ?>
+<?php } ?>
<!-- END OF HEADER -->
<?php print_container_start(true, '', 'content'); ?>