Skip to content

Commit

Permalink
MDL-60654 calendar: Clean up lines 140-154
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
joaociocca committed Nov 8, 2017
1 parent ccf7578 commit 6bc8a2e
Showing 1 changed file with 4 additions and 15 deletions.
19 changes: 4 additions & 15 deletions calendar/view.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,21 +123,10 @@
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);
Expand Down

0 comments on commit 6bc8a2e

Please sign in to comment.