From: urs_hunkler Date: Mon, 24 Sep 2007 11:08:02 +0000 (+0000) Subject: MDL-11370 :: added a global var $THEME->customcornersopen to track properly closed... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=c7a66cc4e17229222919940800e8515bb4a924b2;p=moodle.git MDL-11370 :: added a global var $THEME->customcornersopen to track properly closed custom corners divs. In function print_footer I added a check if some custom_corneres divs are still open and eventually close them. --- diff --git a/lib/custom_corners_lib.php b/lib/custom_corners_lib.php index 47bcf641c3..dbabc05467 100755 --- a/lib/custom_corners_lib.php +++ b/lib/custom_corners_lib.php @@ -17,6 +17,7 @@ * @param mixed $idbase, optionally, define one idbase to be added to all the elements in the corners */ function print_custom_corners_start($clearfix=false, $return=false, $idbase=null) { + global $THEME; /// Analise if we want ids for the custom corner elements $idbt = ''; @@ -37,7 +38,9 @@ function print_custom_corners_start($clearfix=false, $return=false, $idbase=null $output .= "\n"; $output .= '
'; $output .= (!empty($clearfix)) ? '
' : '
'; - + + $THEME->customcornersopen += 1; + if ($return) { return $output; } else { @@ -53,6 +56,7 @@ function print_custom_corners_start($clearfix=false, $return=false, $idbase=null * @param mixed $idbase, optionally, define one idbase to be added to all the elements in the corners */ function print_custom_corners_end($return=false, $idbase=null) { + global $THEME; /// Analise if we want ids for the custom corner elements $idbb = ''; @@ -66,7 +70,9 @@ function print_custom_corners_end($return=false, $idbase=null) { $output .= "\n"; $output .= '
 
'."\n"; $output .= '
'; - + + $THEME->customcornersopen -= ($THEME->customcornersopen > 0) ? 1 : 0; + if ($return) { return $output; } else { diff --git a/lib/weblib.php b/lib/weblib.php index b944564c34..2835866b9c 100644 --- a/lib/weblib.php +++ b/lib/weblib.php @@ -2665,6 +2665,13 @@ function print_footer($course=NULL, $usercourse=NULL, $return=false) { } } +/// Close eventually open custom_corner divs + if ((!empty($THEME->customcorners)) && ($THEME->customcornersopen > 1)) { + require_once($CFG->dirroot.'/lib/custom_corners_lib.php'); + while ($THEME->customcornersopen > 1) { + print_custom_corners_end(); + } + } /// Include the actual footer file @@ -5948,6 +5955,7 @@ function print_side_block_start($heading='', $attributes = array()) { if (!empty($THEME->customcorners)) { echo '
'; echo '
'; + $THEME->customcornersopen += 1; } echo '
';