calendar/lib: calendar_set_filters() use pre-fetched context and course recs
[moodle-pu.git] / lib / custom_corners_lib.php
blob47bcf641c3f808a145ab48d3ccfd6455b1746e9d
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) {
21 /// Analise if we want ids for the custom corner elements
22 $idbt = '';
23 $idi1 = '';
24 $idi2 = '';
25 $idi3 = '';
27 if ($idbase) {
28 $idbt = 'id="' . $idbase . '-bt" ';
29 $idi1 = 'id="' . $idbase . '-i1" ';
30 $idi2 = 'id="' . $idbase . '-i2" ';
31 $idi3 = 'id="' . $idbase . '-i3" ';
34 /// Output begins
35 $output = '<div class="wrap">'."\n";
36 $output .= '<div '.$idbt.'class="bt"><div>&nbsp;</div></div>';
37 $output .= "\n";
38 $output .= '<div '.$idi1.'class="i1"><div '.$idi2.'class="i2">';
39 $output .= (!empty($clearfix)) ? '<div '.$idi3.'class="i3 clearfix">' : '<div '.$idi3.'class="i3">';
41 if ($return) {
42 return $output;
43 } else {
44 echo $output;
49 /**
50 * Ending part of the surrounding divs for custom corners
52 * @param boolean $return, return as string or just print it
53 * @param mixed $idbase, optionally, define one idbase to be added to all the elements in the corners
55 function print_custom_corners_end($return=false, $idbase=null) {
57 /// Analise if we want ids for the custom corner elements
58 $idbb = '';
60 if ($idbase) {
61 $idbb = 'id="' . $idbase . '-bb" ';
64 /// Output begins
65 $output = '</div></div></div>';
66 $output .= "\n";
67 $output .= '<div '.$idbb.'class="bb"><div>&nbsp;</div></div>'."\n";
68 $output .= '</div>';
70 if ($return) {
71 return $output;
72 } else {
73 echo $output;