Skip to content

Commit 78d68af

Browse files
author
Francis Gonzales
committed
Avoid headers in the layout when there is a modal - refs #7161
1 parent da3ce3e commit 78d68af

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

main/course_progress/thematic.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@
163163

164164
$edit_link = '';
165165
if (api_is_allowed_to_edit(null, true)) {
166-
$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>';
166+
$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>';
167167
$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'].'">'.
168168
Display::return_icon('delete.png',get_lang('Delete'),'',ICON_SIZE_SMALL).'</a></center>';
169169

main/course_progress/thematic_controller.php

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ public function thematic($action) {
4040

4141
$check = Security::check_token('request');
4242
$thematic_id = isset($_REQUEST['thematic_id']) ? intval($_REQUEST['thematic_id']) : null;
43-
43+
$displayHeader = (!empty($_REQUEST['display']) && $_REQUEST['display'] === 'no_header') ? false : true;
44+
4445
if ($check) {
4546
switch ($action) {
4647
case 'thematic_add':
@@ -248,9 +249,11 @@ public function thematic($action) {
248249
$data['default_thematic_plan_title'] = $thematic->get_default_thematic_plan_title();
249250

250251
$data['action'] = $action;
252+
$layoutName = $displayHeader ? 'layout' : 'layout_no_header';
253+
251254
// render to the view
252255
$this->view->set_data($data);
253-
$this->view->set_layout('layout');
256+
$this->view->set_layout($layoutName);
254257
$this->view->set_template('thematic');
255258
$this->view->render();
256259
}
@@ -357,15 +360,17 @@ public function thematic_advance($action) {
357360
$thematic = new Thematic();
358361
$attendance = new Attendance();
359362
$data = array();
360-
363+
364+
$displayHeader = (!empty($_REQUEST['display']) && $_REQUEST['display'] === 'no_header') ? false : true;
365+
361366
// get data for attendance input select
362367
$attendance_list = $attendance->get_attendances_list();
363368
$attendance_select = array();
364369
$attendance_select[0] = get_lang('SelectAnAttendance');
365370
foreach ($attendance_list as $attendance_id => $attendance_data) {
366371
$attendance_select[$attendance_id] = $attendance_data['name'];
367372
}
368-
373+
369374
$thematic_id = intval($_REQUEST['thematic_id']);
370375
$thematic_advance_id = intval($_REQUEST['thematic_advance_id']);
371376

@@ -459,10 +464,11 @@ public function thematic_advance($action) {
459464
$data['attendance_select'] = $attendance_select;
460465
$data['thematic_advance_data'] = $thematic_advance_data;
461466
$data['calendar_select'] = $calendar_select;
462-
467+
$layoutName = $displayHeader ? 'layout' : 'layout_no_header';
468+
463469
// render to the view
464470
$this->view->set_data($data);
465-
$this->view->set_layout('layout');
471+
$this->view->set_layout($layoutName);
466472
$this->view->set_template('thematic_advance');
467473
$this->view->render();
468474
}

0 commit comments

Comments
 (0)