Unverified Commit 6bc8a2e1 authored by João Umberto Ciocca de Almeida's avatar João Umberto Ciocca de Almeida Committed by GitHub
Browse files

MDL-60654 calendar: Clean up lines 140-154

The if+switch code between lines 140 and 154, even though they selected 3 different choices, all of them gave the same result.
Therefore, it'd be cleaner to replace those 16 lines for just two.
parent ccf75783
......@@ -123,21 +123,10 @@ echo $renderer->start_layout();
echo html_writer::start_tag('div', array('class'=>'heightcontainer'));
echo $OUTPUT->heading(get_string('calendar', 'calendar'));
if ($view == 'day' || $view == 'upcoming') {
switch($view) {
case 'day':
list($data, $template) = calendar_get_view($calendar, $view);
echo $renderer->render_from_template($template, $data);
break;
case 'upcoming':
list($data, $template) = calendar_get_view($calendar, $view);
echo $renderer->render_from_template($template, $data);
break;
}
} else if ($view == 'month') {
list($data, $template) = calendar_get_view($calendar, $view);
echo $renderer->render_from_template($template, $data);
}
list($data, $template) = calendar_get_view($calendar, $view);
echo $renderer->render_from_template($template, $data);
echo html_writer::end_tag('div');
list($data, $template) = calendar_get_footer_options($calendar);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment