From: stronk7 Date: Mon, 3 Sep 2007 18:57:12 +0000 (+0000) Subject: Adding one new optional parameter to custom_corner functions, used to X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=e62148d600e414b3cf8f540ab3d1cf4bc7af1f90;p=moodle.git Adding one new optional parameter to custom_corner functions, used to apply ids to all the divs used to render corners. Defaults to null, so those ids won't be added if unespecified. --- diff --git a/lib/custom_corners_lib.php b/lib/custom_corners_lib.php index 5c88c12d13..47bcf641c3 100755 --- a/lib/custom_corners_lib.php +++ b/lib/custom_corners_lib.php @@ -14,13 +14,29 @@ * * @param boolean $clearfix, add CLASS "clearfix" to the inner div against collapsing * @param boolean $return, return as string or just print it + * @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) { +function print_custom_corners_start($clearfix=false, $return=false, $idbase=null) { + +/// Analise if we want ids for the custom corner elements + $idbt = ''; + $idi1 = ''; + $idi2 = ''; + $idi3 = ''; + + if ($idbase) { + $idbt = 'id="' . $idbase . '-bt" '; + $idi1 = 'id="' . $idbase . '-i1" '; + $idi2 = 'id="' . $idbase . '-i2" '; + $idi3 = 'id="' . $idbase . '-i3" '; + } + +/// Output begins $output = '
'."\n"; - $output .= '
 
'; + $output .= '
 
'; $output .= "\n"; - $output .= '
'; - $output .= (!empty($clearfix)) ? '
' : '
'; + $output .= '
'; + $output .= (!empty($clearfix)) ? '
' : '
'; if ($return) { return $output; @@ -34,11 +50,21 @@ function print_custom_corners_start($clearfix=false, $return=false) { * Ending part of the surrounding divs for custom corners * * @param boolean $return, return as string or just print it + * @param mixed $idbase, optionally, define one idbase to be added to all the elements in the corners */ -function print_custom_corners_end($return=false) { +function print_custom_corners_end($return=false, $idbase=null) { + +/// Analise if we want ids for the custom corner elements + $idbb = ''; + + if ($idbase) { + $idbb = 'id="' . $idbase . '-bb" '; + } + +/// Output begins $output = '
'; $output .= "\n"; - $output .= '
 
'."\n"; + $output .= '
 
'."\n"; $output .= '
'; if ($return) {