|
Moodle
2.2.1
http://www.collinsharper.com
|
00001 <?php 00002 00003 class theme_anomaly_core_renderer extends core_renderer { 00004 00015 function block($bc, $region) { 00016 00017 $bc = clone($bc); // Avoid messing up the object passed in. 00018 if (empty($bc->blockinstanceid) || !strip_tags($bc->title)) { 00019 $bc->collapsible = block_contents::NOT_HIDEABLE; 00020 } 00021 if ($bc->collapsible == block_contents::HIDDEN) { 00022 $bc->add_class('hidden'); 00023 } 00024 if (!empty($bc->controls)) { 00025 $bc->add_class('block_with_controls'); 00026 } 00027 00028 $skiptitle = strip_tags($bc->title); 00029 if (empty($skiptitle)) { 00030 $output = ''; 00031 $skipdest = ''; 00032 } else { 00033 $output = html_writer::tag('a', get_string('skipa', 'access', $skiptitle), array('href' => '#sb-' . $bc->skipid, 'class' => 'skip-block')); 00034 $skipdest = html_writer::tag('span', '', array('id' => 'sb-' . $bc->skipid, 'class' => 'skip-block-to')); 00035 } 00036 00037 $output .= html_writer::start_tag('div', $bc->attributes); 00038 00040 $output .= html_writer::start_tag('div', array('class'=>'corner-box')); 00041 $output .= html_writer::start_tag('div', array('class'=>'rounded-corner top-left')).html_writer::end_tag('div'); 00042 $output .= html_writer::start_tag('div', array('class'=>'rounded-corner top-right')).html_writer::end_tag('div'); 00043 00044 $controlshtml = $this->block_controls($bc->controls); 00045 00046 $title = ''; 00047 if ($bc->title) { 00048 $title = html_writer::tag('h2', $bc->title); 00049 } 00050 00051 if ($title || $controlshtml) { 00052 $output .= html_writer::tag('div', html_writer::tag('div', html_writer::tag('div', '', array('class'=>'block_action')). $title . $controlshtml, array('class' => 'title')), array('class' => 'header')); 00053 } 00054 00055 $output .= html_writer::start_tag('div', array('class' => 'content')); 00056 if (!$title && !$controlshtml) { 00057 $output .= html_writer::tag('div', '', array('class'=>'block_action notitle')); 00058 } 00059 $output .= $bc->content; 00060 00061 if ($bc->footer) { 00062 $output .= html_writer::tag('div', $bc->footer, array('class' => 'footer')); 00063 } 00064 00065 $output .= html_writer::end_tag('div'); 00066 00068 $output .= html_writer::start_tag('div', array('class'=>'rounded-corner bottom-left')).html_writer::end_tag('div'); 00069 $output .= html_writer::start_tag('div', array('class'=>'rounded-corner bottom-right')).html_writer::end_tag('div'); 00070 $output .= html_writer::end_tag('div'); 00071 00072 $output .= html_writer::end_tag('div'); 00073 00074 if ($bc->annotation) { 00075 $output .= html_writer::tag('div', $bc->annotation, array('class' => 'blockannotation')); 00076 } 00077 $output .= $skipdest; 00078 00079 $this->init_block_hider_js($bc); 00080 00081 return $output; 00082 } 00083 00084 }