Browse Source

Fix active tab in calendar list view - refs CT#7396

Yannick Warnier 10 years ago
parent
commit
2095b9573b
2 changed files with 7 additions and 3 deletions
  1. 1 0
      main/calendar/agenda_js.php
  2. 6 3
      main/calendar/agenda_list.php

+ 1 - 0
main/calendar/agenda_js.php

@@ -47,6 +47,7 @@ if (isset($_REQUEST['cidReq']) && !empty($_REQUEST['cidReq'])) {
         exit;
     } else {
         $type = 'course';
+        $this_section = SECTION_COURSES;
     }
 }
 

+ 6 - 3
main/calendar/agenda_list.php

@@ -18,8 +18,6 @@ $interbreadcrumb[] = array(
     'name' => get_lang('Agenda')
 );
 
-$tpl = new Template(get_lang('Events'));
-
 $agenda = new Agenda();
 $type = isset($_REQUEST['type']) ? $_REQUEST['type'] : null;
 $agenda->type = $type;
@@ -31,10 +29,13 @@ $events = $agenda->get_events(
     null,
     'array'
 );
+
+$this_section = SECTION_MYAGENDA;
+
 if (!empty($GLOBALS['_cid']) && $GLOBALS['_cid'] != -1) {
     // Agenda is inside a course tool
     $url = api_get_self() . '?' . api_get_cidreq();
-
+    $this_section = SECTION_COURSES;
 } else {
     // Agenda is out of the course tool (e.g personal agenda)
     $url = false;
@@ -43,6 +44,8 @@ if (!empty($GLOBALS['_cid']) && $GLOBALS['_cid'] != -1) {
     }
 }
 
+$tpl = new Template(get_lang('Events'));
+
 $tpl->assign('agenda_events', $events);
 
 $actions = $agenda->displayActions('list');