Skip to content

Commit

Permalink
Merge branch 'MDL-25853-24' of git://github.com/FMCorz/moodle into MO…
Browse files Browse the repository at this point in the history
…ODLE_24_STABLE
  • Loading branch information
danpoltawski committed Feb 4, 2013
2 parents a8e927e + d987453 commit 56f84f2
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions calendar/lib.php
Expand Up @@ -745,7 +745,7 @@ function calendar_get_events($tstart, $tend, $users, $groups, $courses, $withdur
* @return string $content return available control for the calender in html * @return string $content return available control for the calender in html
*/ */
function calendar_top_controls($type, $data) { function calendar_top_controls($type, $data) {
global $CFG; global $CFG, $PAGE;
$content = ''; $content = '';
if(!isset($data['d'])) { if(!isset($data['d'])) {
$data['d'] = 1; $data['d'] = 1;
Expand All @@ -768,6 +768,7 @@ function calendar_top_controls($type, $data) {


$data['m'] = $date['mon']; $data['m'] = $date['mon'];
$data['y'] = $date['year']; $data['y'] = $date['year'];
$urlbase = $PAGE->url;


//Accessibility: calendar block controls, replaced <table> with <div>. //Accessibility: calendar block controls, replaced <table> with <div>.
//$nexttext = link_arrow_right(get_string('monthnext', 'access'), $url='', $accesshide=true); //$nexttext = link_arrow_right(get_string('monthnext', 'access'), $url='', $accesshide=true);
Expand All @@ -777,8 +778,8 @@ function calendar_top_controls($type, $data) {
case 'frontpage': case 'frontpage':
list($prevmonth, $prevyear) = calendar_sub_month($data['m'], $data['y']); list($prevmonth, $prevyear) = calendar_sub_month($data['m'], $data['y']);
list($nextmonth, $nextyear) = calendar_add_month($data['m'], $data['y']); list($nextmonth, $nextyear) = calendar_add_month($data['m'], $data['y']);
$nextlink = calendar_get_link_next(get_string('monthnext', 'access'), 'index.php?', 0, $nextmonth, $nextyear, $accesshide=true); $nextlink = calendar_get_link_next(get_string('monthnext', 'access'), $urlbase, 0, $nextmonth, $nextyear, true);
$prevlink = calendar_get_link_previous(get_string('monthprev', 'access'), 'index.php?', 0, $prevmonth, $prevyear, true); $prevlink = calendar_get_link_previous(get_string('monthprev', 'access'), $urlbase, 0, $prevmonth, $prevyear, true);


$calendarlink = calendar_get_link_href(new moodle_url(CALENDAR_URL.'view.php', array('view'=>'month')), 1, $data['m'], $data['y']); $calendarlink = calendar_get_link_href(new moodle_url(CALENDAR_URL.'view.php', array('view'=>'month')), 1, $data['m'], $data['y']);
if (!empty($data['id'])) { if (!empty($data['id'])) {
Expand All @@ -804,8 +805,8 @@ function calendar_top_controls($type, $data) {
case 'course': case 'course':
list($prevmonth, $prevyear) = calendar_sub_month($data['m'], $data['y']); list($prevmonth, $prevyear) = calendar_sub_month($data['m'], $data['y']);
list($nextmonth, $nextyear) = calendar_add_month($data['m'], $data['y']); list($nextmonth, $nextyear) = calendar_add_month($data['m'], $data['y']);
$nextlink = calendar_get_link_next(get_string('monthnext', 'access'), 'view.php?id='.$data['id'].'&amp;', 0, $nextmonth, $nextyear, $accesshide=true); $nextlink = calendar_get_link_next(get_string('monthnext', 'access'), $urlbase, 0, $nextmonth, $nextyear, true);
$prevlink = calendar_get_link_previous(get_string('monthprev', 'access'), 'view.php?id='.$data['id'].'&amp;', 0, $prevmonth, $prevyear, true); $prevlink = calendar_get_link_previous(get_string('monthprev', 'access'), $urlbase, 0, $prevmonth, $prevyear, true);


$calendarlink = calendar_get_link_href(new moodle_url(CALENDAR_URL.'view.php', array('view'=>'month')), 1, $data['m'], $data['y']); $calendarlink = calendar_get_link_href(new moodle_url(CALENDAR_URL.'view.php', array('view'=>'month')), 1, $data['m'], $data['y']);
if (!empty($data['id'])) { if (!empty($data['id'])) {
Expand Down

0 comments on commit 56f84f2

Please sign in to comment.