mobileapp value in origin variable to hide headers

pull/3419/head
Nosolored 5 years ago
parent 75da2b7845
commit 48c60d9769
  1. 2
      main/exercise/exercise.php
  2. 6
      main/exercise/exercise_result.php
  3. 6
      main/exercise/exercise_submit.php
  4. 4
      main/exercise/overview.php
  5. 4
      main/exercise/result.php
  6. 4
      main/inc/lib/display.lib.php

@ -506,7 +506,7 @@ if ($is_allowedToEdit) {
}
}
if (!in_array($origin, ['learnpath', 'noheader'])) {
if (!in_array($origin, ['learnpath', 'mobileapp'])) {
//so we are not in learnpath tool
Display::display_header($nameTools, get_lang('Exercise'));
if (isset($_GET['message']) && in_array($_GET['message'], ['ExerciseEdited'])) {

@ -89,7 +89,7 @@ $pageTop = '';
$pageBottom = '';
$pageContent = '';
if (!in_array($origin, ['learnpath', 'embeddable', 'noheader'])) {
if (!in_array($origin, ['learnpath', 'embeddable', 'mobileapp'])) {
// So we are not in learnpath tool
$showHeader = true;
}
@ -240,7 +240,7 @@ ExerciseLib::exercise_time_control_delete(
ExerciseLib::delete_chat_exercise_session($exe_id);
if (!in_array($origin, ['learnpath', 'embeddable', 'noheader'])) {
if (!in_array($origin, ['learnpath', 'embeddable', 'mobileapp'])) {
$pageBottom .= '<div class="question-return">';
$pageBottom .= Display::url(
get_lang('ReturnToCourseHomepage'),
@ -254,7 +254,7 @@ if (!in_array($origin, ['learnpath', 'embeddable', 'noheader'])) {
}
$showFooter = true;
} elseif (in_array($origin, ['embeddable', 'noheader'])) {
} elseif (in_array($origin, ['embeddable', 'mobileapp'])) {
if (api_is_allowed_to_session_edit()) {
Exercise::cleanSessionVariables();
}

@ -79,7 +79,7 @@ if ('true' === api_get_setting('enable_record_audio')) {
}
$zoomOptions = api_get_configuration_value('quiz_image_zoom');
if (isset($zoomOptions['options']) && !in_array($origin, ['embeddable', 'noheader'])) {
if (isset($zoomOptions['options']) && !in_array($origin, ['embeddable', 'mobileapp'])) {
$options = $zoomOptions['options'];
$htmlHeadXtra[] = '<script src="'.api_get_path(WEB_LIBRARY_JS_PATH).'jquery.elevatezoom.js"></script>';
$htmlHeadXtra[] = '<script>
@ -879,7 +879,7 @@ $interbreadcrumb[] = [
];
$interbreadcrumb[] = ['url' => '#', 'name' => $objExercise->selectTitle(true)];
if (!in_array($origin, ['learnpath', 'embeddable', 'noheader'])) { //so we are not in learnpath tool
if (!in_array($origin, ['learnpath', 'embeddable', 'mobileapp'])) { //so we are not in learnpath tool
if (!api_is_allowed_to_session_edit()) {
Display::addFlash(
Display::return_message(get_lang('SessionIsReadOnly'), 'warning')
@ -892,7 +892,7 @@ if (!in_array($origin, ['learnpath', 'embeddable', 'noheader'])) { //so we are n
echo '<div style="height:10px">&nbsp;</div>';
}
if ($origin == 'noheader') {
if ($origin == 'mobileapp') {
echo '<div class="actions">';
echo '<a href="javascript:window.history.go(-1);">'.
Display::return_icon('back.png', get_lang('GoBackToQuestionList'), [], 32).'</a>';

@ -71,7 +71,7 @@ if ($time_control) {
$htmlHeadXtra[] = $objExercise->showTimeControlJS($time_left);
}
if (!in_array($origin, ['learnpath', 'embeddable', 'noheader'])) {
if (!in_array($origin, ['learnpath', 'embeddable', 'mobileapp'])) {
Display::display_header();
} else {
$htmlHeadXtra[] = "
@ -82,7 +82,7 @@ if (!in_array($origin, ['learnpath', 'embeddable', 'noheader'])) {
Display::display_reduced_header();
}
if ($origin == 'noheader') {
if ($origin == 'mobileapp') {
echo '<div class="actions">';
echo '<a href="javascript:window.history.go(-1);">'.
Display::return_icon('back.png', get_lang('GoBackToQuestionList'), [], 32).'</a>';

@ -15,7 +15,7 @@ $id = isset($_REQUEST['id']) ? (int) $_GET['id'] : 0; // exe id
$show_headers = isset($_REQUEST['show_headers']) ? (int) $_REQUEST['show_headers'] : null;
$origin = api_get_origin();
if (in_array($origin, ['learnpath', 'embeddable', 'noheader'])) {
if (in_array($origin, ['learnpath', 'embeddable', 'mobileapp'])) {
$show_headers = false;
}
@ -78,7 +78,7 @@ if ($show_headers) {
body { background: none;}
</style>';
if ($origin == 'noheader') {
if ($origin == 'mobileapp') {
echo '<div class="actions">';
echo '<a href="javascript:window.history.go(-1);">'.
Display::return_icon('back.png', get_lang('GoBackToQuestionList'), [], 32).'</a>';

@ -64,11 +64,11 @@ class Display
) {
$origin = api_get_origin();
$showHeader = true;
if (isset($origin) && ($origin == 'learnpath' || $origin == 'noheader')) {
if (isset($origin) && ($origin == 'learnpath' || $origin == 'mobileapp')) {
$showHeader = false;
}
if (Session::read('origin') == 'noheader') {
if (Session::read('origin') == 'mobileapp') {
$showHeader = false;
}

Loading…
Cancel
Save