Skip to content
Browse files

MDL-17510 calendar - added 2 missing labels plus space/comments clean…

…ing. Credit goes to Daniel Neis
  • Loading branch information...
1 parent 7e4a97c commit 4f13fe005e73a13f1593faa0607aa5f481401365 @stronk7 stronk7 committed
Showing with 54 additions and 56 deletions.
  1. +54 −56 calendar/view.php
View
110 calendar/view.php
@@ -251,7 +251,10 @@ function calendar_show_day($d, $m, $y, $courses, $groups, $users, $courseid) {
$text.= '</div></form></div>';
}
- $text .= get_string('dayview', 'calendar').': '.calendar_course_filter_selector($getvars);
+ $text .= '<label for="cal_course_flt_jump">'.
+ get_string('dayview', 'calendar').
+ ':</label>'.
+ calendar_course_filter_selector($getvars);
echo '<div class="header">'.$text.'</div>';
@@ -374,7 +377,7 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users, $course
}
}
}
-
+
// Extract information: events vs. time
calendar_events_by_day($events, $m, $y, $eventsbyday, $durationbyday, $typesbyday, $courses);
@@ -517,55 +520,51 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users, $course
echo "</table>\n"; // Tabular display of days ends
- // OK, now for the filtering display
- echo '<div class="filters"><table><tr>';
-
- // Global events
- if($SESSION->cal_show_global) {
- echo '<td class="event_global" style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
- echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
- }
- else {
- echo '<td style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
- echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
- }
-
- // Course events
- if(!empty($SESSION->cal_show_course)) {
- echo '<td class="event_course" style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
- echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
- }
- else {
- echo '<td style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
- echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
- }
-
- echo "</tr>\n";
-
- if(!empty($USER->id) && !isguest()) {
- echo '<tr>';
- // Group events
- if($SESSION->cal_show_groups) {
- echo '<td class="event_group" style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
- echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
- }
- else {
- echo '<td style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
- echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
- }
- // User events
- if($SESSION->cal_show_user) {
- echo '<td class="event_user" style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
- echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
- }
- else {
- echo '<td style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
- echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
- }
- echo "</tr>\n";
- }
-
- echo '</table></div>';
+ // OK, now for the filtering display
+ echo '<div class="filters"><table><tr>';
+
+ // Global events
+ if($SESSION->cal_show_global) {
+ echo '<td class="event_global" style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
+ echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
+ } else {
+ echo '<td style="width: 8px;"></td><td><strong>'.get_string('globalevents', 'calendar').':</strong> ';
+ echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showglobal&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
+ }
+
+ // Course events
+ if(!empty($SESSION->cal_show_course)) {
+ echo '<td class="event_course" style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
+ echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
+ } else {
+ echo '<td style="width: 8px;"></td><td><strong>'.get_string('courseevents', 'calendar').':</strong> ';
+ echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showcourses&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
+ }
+
+ echo "</tr>\n";
+
+ if(!empty($USER->id) && !isguest()) {
+ echo '<tr>';
+ // Group events
+ if($SESSION->cal_show_groups) {
+ echo '<td class="event_group" style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
+ echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
+ } else {
+ echo '<td style="width: 8px;"></td><td><strong>'.get_string('groupevents', 'calendar').':</strong> ';
+ echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showgroups&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
+ }
+ // User events
+ if($SESSION->cal_show_user) {
+ echo '<td class="event_user" style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
+ echo get_string('shown', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&amp;'.$getvars.'">'.get_string('clickhide', 'calendar').'</a>)</td>'."\n";
+ } else {
+ echo '<td style="width: 8px;"></td><td><strong>'.get_string('userevents', 'calendar').':</strong> ';
+ echo get_string('hidden', 'calendar').' (<a href="'.CALENDAR_URL.'set.php?var=showuser&amp;'.$getvars.'">'.get_string('clickshow', 'calendar').'</a>)</td>'."\n";
+ }
+ echo "</tr>\n";
+ }
+
+ echo '</table></div>';
}
function calendar_show_upcoming_events($courses, $groups, $users, $futuredays, $maxevents, $courseid) {
@@ -581,15 +580,14 @@ function calendar_show_upcoming_events($courses, $groups, $users, $futuredays, $
$text.= '<div>';
$text.= '<input type="hidden" name="action" value="new" />';
$text.= '<input type="hidden" name="course" value="'.$courseid.'" />';
- /*
- $text.= '<input type="hidden" name="cal_m" value="'.$m.'" />';
- $text.= '<input type="hidden" name="cal_y" value="'.$y.'" />';
- */
$text.= '<input type="submit" value="'.get_string('newevent', 'calendar').'" />';
$text.= '</div></form></div>';
}
- $text .= get_string('upcomingevents', 'calendar').': '.calendar_course_filter_selector('from=upcoming');
+ $text .= '<label for="cal_course_flt_jump">'.
+ get_string('upcomingevents', 'calendar').
+ ': </label>'.
+ calendar_course_filter_selector('from=upcoming');
echo '<div class="header">'.$text.'</div>';

0 comments on commit 4f13fe0

Please sign in to comment.
Something went wrong with that request. Please try again.