Avoid headers in the layout when there is a modal - refs #7161

1.9.x
Francis Gonzales 12 years ago
parent da3ce3ef94
commit 78d68affae
  1. 2
      main/course_progress/thematic.php
  2. 18
      main/course_progress/thematic_controller.php

@ -163,7 +163,7 @@ if ($action == 'thematic_list') {
$edit_link = ''; $edit_link = '';
if (api_is_allowed_to_edit(null, true)) { if (api_is_allowed_to_edit(null, true)) {
$edit_link = '<a class="thickbox" href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic['id'].'&thematic_advance_id='.$thematic_advance['id'].'" >'.Display::return_icon('edit.png',get_lang('EditThematicAdvance'),array(),ICON_SIZE_SMALL).'</a>'; $edit_link = '<a class="thickbox" href="index.php?'.api_get_cidreq().'&action=thematic_advance_edit&thematic_id='.$thematic['id'].'&thematic_advance_id='.$thematic_advance['id'].'&display=no_header" >'.Display::return_icon('edit.png',get_lang('EditThematicAdvance'),array(),ICON_SIZE_SMALL).'</a>';
$edit_link .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic['id'].'&thematic_advance_id='.$thematic_advance['id'].'">'. $edit_link .= '<a onclick="javascript:if(!confirm(\''.get_lang('AreYouSureToDelete').'\')) return false;" href="index.php?'.api_get_cidreq().'&action=thematic_advance_delete&thematic_id='.$thematic['id'].'&thematic_advance_id='.$thematic_advance['id'].'">'.
Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a></center>'; Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a></center>';

@ -40,7 +40,8 @@ class ThematicController {
$check = Security::check_token('request'); $check = Security::check_token('request');
$thematic_id = isset($_REQUEST['thematic_id']) ? intval($_REQUEST['thematic_id']) : null; $thematic_id = isset($_REQUEST['thematic_id']) ? intval($_REQUEST['thematic_id']) : null;
$displayHeader = (!empty($_REQUEST['display']) && $_REQUEST['display'] === 'no_header') ? false : true;
if ($check) { if ($check) {
switch ($action) { switch ($action) {
case 'thematic_add': case 'thematic_add':
@ -248,9 +249,11 @@ class ThematicController {
$data['default_thematic_plan_title'] = $thematic->get_default_thematic_plan_title(); $data['default_thematic_plan_title'] = $thematic->get_default_thematic_plan_title();
$data['action'] = $action; $data['action'] = $action;
$layoutName = $displayHeader ? 'layout' : 'layout_no_header';
// render to the view // render to the view
$this->view->set_data($data); $this->view->set_data($data);
$this->view->set_layout('layout'); $this->view->set_layout($layoutName);
$this->view->set_template('thematic'); $this->view->set_template('thematic');
$this->view->render(); $this->view->render();
} }
@ -357,7 +360,9 @@ class ThematicController {
$thematic = new Thematic(); $thematic = new Thematic();
$attendance = new Attendance(); $attendance = new Attendance();
$data = array(); $data = array();
$displayHeader = (!empty($_REQUEST['display']) && $_REQUEST['display'] === 'no_header') ? false : true;
// get data for attendance input select // get data for attendance input select
$attendance_list = $attendance->get_attendances_list(); $attendance_list = $attendance->get_attendances_list();
$attendance_select = array(); $attendance_select = array();
@ -365,7 +370,7 @@ class ThematicController {
foreach ($attendance_list as $attendance_id => $attendance_data) { foreach ($attendance_list as $attendance_id => $attendance_data) {
$attendance_select[$attendance_id] = $attendance_data['name']; $attendance_select[$attendance_id] = $attendance_data['name'];
} }
$thematic_id = intval($_REQUEST['thematic_id']); $thematic_id = intval($_REQUEST['thematic_id']);
$thematic_advance_id = intval($_REQUEST['thematic_advance_id']); $thematic_advance_id = intval($_REQUEST['thematic_advance_id']);
@ -459,10 +464,11 @@ class ThematicController {
$data['attendance_select'] = $attendance_select; $data['attendance_select'] = $attendance_select;
$data['thematic_advance_data'] = $thematic_advance_data; $data['thematic_advance_data'] = $thematic_advance_data;
$data['calendar_select'] = $calendar_select; $data['calendar_select'] = $calendar_select;
$layoutName = $displayHeader ? 'layout' : 'layout_no_header';
// render to the view // render to the view
$this->view->set_data($data); $this->view->set_data($data);
$this->view->set_layout('layout'); $this->view->set_layout($layoutName);
$this->view->set_template('thematic_advance'); $this->view->set_template('thematic_advance');
$this->view->render(); $this->view->render();
} }

Loading…
Cancel
Save