mirror of
https://github.com/moodle/moodle.git
synced 2025-05-04 15:27:34 +02:00
Bye bye event details view...
This commit is contained in:
parent
0784eb7ef1
commit
f434283f4f
@ -163,14 +163,16 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
|
||||
|
||||
// Special visual fx if an event is defined
|
||||
if(isset($eventsbyday[$day])) {
|
||||
$dayhref = calendar_get_link_href(CALENDAR_URL.'view.php?view=day&', $day, $m, $y);
|
||||
|
||||
// OverLib popup
|
||||
$popupcontent = '';
|
||||
foreach($eventsbyday[$day] as $eventid) {
|
||||
if(!empty($events[$eventid]->modulename)) {
|
||||
$popupcontent .= '<div><img src=\\\''.$CFG->modpixpath.'/'.$events[$eventid]->modulename.'/icon.gif\\\' style=\\\'vertical-align: middle; margin-right: 4px;\\\' alt=\\\''.$events[$eventid]->modulename.'\\\' /><a href=\\\''.CALENDAR_URL.'view.php?view=event&id='.$events[$eventid]->id.'\\\'>'.addslashes(htmlspecialchars($events[$eventid]->name)).'</a></div>';
|
||||
$popupcontent .= '<div><img src=\\\''.$CFG->modpixpath.'/'.$events[$eventid]->modulename.'/icon.gif\\\' style=\\\'vertical-align: middle; margin-right: 4px;\\\' alt=\\\''.$events[$eventid]->modulename.'\\\' /><a href=\\\''.$dayhref.'\\\'>'.addslashes(htmlspecialchars($events[$eventid]->name)).'</a></div>';
|
||||
}
|
||||
else {
|
||||
$popupcontent .= '<div><img src=\\\''.$CFG->pixpath.'/c/event.gif\\\' style=\\\'vertical-align: middle; margin-right: 4px;\\\' alt=\\\'\\\' /><a href=\\\''.CALENDAR_URL.'view.php?view=event&id='.$events[$eventid]->id.'\\\'>'.addslashes(htmlspecialchars($events[$eventid]->name)).'</a></div>';
|
||||
$popupcontent .= '<div><img src=\\\''.$CFG->pixpath.'/c/event.gif\\\' style=\\\'vertical-align: middle; margin-right: 4px;\\\' alt=\\\'\\\' /><a href=\\\''.$dayhref.'\\\'>'.addslashes(htmlspecialchars($events[$eventid]->name)).'</a></div>';
|
||||
}
|
||||
}
|
||||
|
||||
@ -196,7 +198,7 @@ function calendar_get_mini($courses, $groups, $users, $cal_month = false, $cal_y
|
||||
else {
|
||||
$title = get_string('manyevents', 'calendar', count($eventsbyday[$day]));
|
||||
}
|
||||
$cell = '<strong><a href="'.calendar_get_link_href(CALENDAR_URL.'view.php?view=day&', $day, $m, $y).'" '.$popup.'">'.$day.'</a></strong>';
|
||||
$cell = '<strong><a href="'.$dayhref.'" '.$popup.'">'.$day.'</a></strong>';
|
||||
}
|
||||
else {
|
||||
$cell = $day;
|
||||
@ -560,12 +562,6 @@ function calendar_filter_controls($type, $vars = NULL) {
|
||||
case 'upcoming':
|
||||
$getvars = '&from=upcoming';
|
||||
break;
|
||||
case 'prefs':
|
||||
$getvars = '&from=prefs&pref='.$_GET['edit'];
|
||||
break;
|
||||
case 'event':
|
||||
$getvars = '&from=event&id='.$_GET['id'];
|
||||
break;
|
||||
case 'day':
|
||||
$getvars = '&from=day';
|
||||
break;
|
||||
|
@ -85,18 +85,12 @@
|
||||
}
|
||||
|
||||
switch($_GET['from']) {
|
||||
case 'prefs':
|
||||
redirect($CFG->wwwroot.'/calendar/preferences.php?edit='.$_GET['pref']);
|
||||
break;
|
||||
case 'month':
|
||||
redirect($CFG->wwwroot.'/calendar/view.php?view=month&cal_d='.$_GET['cal_d'].'&cal_m='.$_GET['cal_m'].'&cal_y='.$_GET['cal_y']);
|
||||
break;
|
||||
case 'upcoming':
|
||||
redirect($CFG->wwwroot.'/calendar/view.php?view=upcoming&cal_d='.$_GET['cal_d'].'&cal_m='.$_GET['cal_m'].'&cal_y='.$_GET['cal_y']);
|
||||
break;
|
||||
case 'event':
|
||||
redirect($CFG->wwwroot.'/calendar/view.php?view=event&id='.$_GET['id']);
|
||||
break;
|
||||
case 'day':
|
||||
redirect($CFG->wwwroot.'/calendar/view.php?view=day&cal_d='.$_GET['cal_d'].'&cal_m='.$_GET['cal_m'].'&cal_y='.$_GET['cal_y']);
|
||||
break;
|
||||
|
@ -88,10 +88,6 @@
|
||||
case 'upcoming':
|
||||
$pagetitle = get_string('upcomingevents', 'calendar');
|
||||
break;
|
||||
case 'event':
|
||||
$pagetitle = get_string('eventview', 'calendar');
|
||||
$nav .= ' -> '.$pagetitle; // Smart guy... :)
|
||||
break;
|
||||
}
|
||||
|
||||
if(isguest($USER->id)) {
|
||||
@ -128,17 +124,6 @@
|
||||
echo '<td style="vertical-align: top; width: 100%;">';
|
||||
|
||||
switch($_GET['view']) {
|
||||
case 'event':
|
||||
optional_variable($_GET['id'], 0);
|
||||
$event = get_record('event', 'id', intval($_GET['id']));
|
||||
if($event === false) {
|
||||
error('Invalid event id');
|
||||
}
|
||||
$date = calendar_show_event($event);
|
||||
$day = $date['mday'];
|
||||
$mon = $date['mon'];
|
||||
$yr = $date['year'];
|
||||
break;
|
||||
case 'day':
|
||||
calendar_show_day($day, $mon, $yr, $courses, $groups, $users);
|
||||
break;
|
||||
@ -258,8 +243,9 @@ function calendar_show_day($d, $m, $y, $courses, $groups, $users) {
|
||||
echo '<p style="text-align: center;"><ul>';
|
||||
foreach($summarize as $index) {
|
||||
$endstamp = $events[$index]->timestart + $events[$index]->timeduration;
|
||||
$startdate = usergetdate($events[$index]->timestart);
|
||||
$enddate = usergetdate($endstamp);
|
||||
echo '<li><a href="view.php?view=event&id='.$events[$index]->id.'">'.$events[$index]->name.'</a> ';
|
||||
echo '<li><a href="'.calendar_get_link_href('view.php?view=day&', $startdate['mday'], $startdate['mon'], $startdate['year']).'">'.$events[$index]->name.'</a> ';
|
||||
echo '('.$until.' <a href="'.calendar_get_link_href('view.php?view=day&', $enddate['mday'], $enddate['mon'], $enddate['year']).'">';
|
||||
echo calendar_day_representation($endstamp, false, false).'</a>)</li>';
|
||||
}
|
||||
@ -382,6 +368,8 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users) {
|
||||
|
||||
// Reset vars
|
||||
$cell = '';
|
||||
$dayhref = calendar_get_link_href(CALENDAR_URL.'view.php?view=day&', $day, $m, $y);
|
||||
|
||||
if($dayweek % 7 == 0 || $dayweek % 7 == 6) {
|
||||
// Weekend. This is true no matter what the exact range is.
|
||||
$class = 'cal_weekend';
|
||||
@ -411,7 +399,7 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users) {
|
||||
else {
|
||||
$title = get_string('manyevents', 'calendar', count($eventsbyday[$day]));
|
||||
}
|
||||
$cell = '<strong><a href="'.calendar_get_link_href(CALENDAR_URL.'view.php?view=day&', $day, $m, $y).'" title="'.$title.'">'.$day.'</a></strong>';
|
||||
$cell = '<strong><a href="'.$dayhref.'" title="'.$title.'">'.$day.'</a></strong>';
|
||||
}
|
||||
else {
|
||||
$cell = $day;
|
||||
@ -446,7 +434,7 @@ function calendar_show_month_detailed($m, $y, $courses, $groups, $users) {
|
||||
echo '<table>';
|
||||
foreach($eventsbyday[$day] as $eventindex) {
|
||||
echo '<tr><td style="vertical-align: top; width: 10px;"><strong>·</strong></td>';
|
||||
echo '<td style="width: 100%;"><a href="'.CALENDAR_URL.'view.php?view=event&id='.$events[$eventindex]->id.'">'.$events[$eventindex]->name.'</a></td></tr>';
|
||||
echo '<td style="width: 100%;"><a href="'.$dayhref.'">'.$events[$eventindex]->name.'</a></td></tr>';
|
||||
}
|
||||
echo '</table>';
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user