MDL-11517 reserved word MOD used in table alias in questions backup code
[moodle-pu.git] / lib / custom_corners_lib.php
blobdbabc054670362f75208061f64588f183b8b3f34
1 <?php
2 /**
3 * @author Urs Hunkler
4 * @license http://www.gnu.org/copyleft/gpl.html GNU Public License
6 * Custom corners and borders
7 * Support library
9 * 2007-05-07 File created.
12 /**
13 * Starting part of the surrounding divs for custom corners
15 * @param boolean $clearfix, add CLASS "clearfix" to the inner div against collapsing
16 * @param boolean $return, return as string or just print it
17 * @param mixed $idbase, optionally, define one idbase to be added to all the elements in the corners
19 function print_custom_corners_start($clearfix=false, $return=false, $idbase=null) {
20 global $THEME;
22 /// Analise if we want ids for the custom corner elements
23 $idbt = '';
24 $idi1 = '';
25 $idi2 = '';
26 $idi3 = '';
28 if ($idbase) {
29 $idbt = 'id="' . $idbase . '-bt" ';
30 $idi1 = 'id="' . $idbase . '-i1" ';
31 $idi2 = 'id="' . $idbase . '-i2" ';
32 $idi3 = 'id="' . $idbase . '-i3" ';
35 /// Output begins
36 $output = '<div class="wrap">'."\n";
37 $output .= '<div '.$idbt.'class="bt"><div>&nbsp;</div></div>';
38 $output .= "\n";
39 $output .= '<div '.$idi1.'class="i1"><div '.$idi2.'class="i2">';
40 $output .= (!empty($clearfix)) ? '<div '.$idi3.'class="i3 clearfix">' : '<div '.$idi3.'class="i3">';
42 $THEME->customcornersopen += 1;
44 if ($return) {
45 return $output;
46 } else {
47 echo $output;
52 /**
53 * Ending part of the surrounding divs for custom corners
55 * @param boolean $return, return as string or just print it
56 * @param mixed $idbase, optionally, define one idbase to be added to all the elements in the corners
58 function print_custom_corners_end($return=false, $idbase=null) {
59 global $THEME;
61 /// Analise if we want ids for the custom corner elements
62 $idbb = '';
64 if ($idbase) {
65 $idbb = 'id="' . $idbase . '-bb" ';
68 /// Output begins
69 $output = '</div></div></div>';
70 $output .= "\n";
71 $output .= '<div '.$idbb.'class="bb"><div>&nbsp;</div></div>'."\n";
72 $output .= '</div>';
74 $THEME->customcornersopen -= ($THEME->customcornersopen > 0) ? 1 : 0;
76 if ($return) {
77 return $output;
78 } else {
79 echo $output;