pull/2487/head
Angel Fernando Quiroz Campos 9 years ago
parent 8ce30fe027
commit 7087b9fa17
  1. 2
      main/exercise/Draggable.php
  2. 4
      main/exercise/MatchingDraggable.php
  3. 4
      main/exercise/UniqueAnswerImage.php
  4. 2
      main/exercise/admin.php
  5. 4
      main/exercise/exercise.class.php
  6. 9
      main/exercise/exercise_admin.php
  7. 2
      main/exercise/exercise_result.php
  8. 6
      main/exercise/exercise_show.php
  9. 9
      main/exercise/exercise_submit.php
  10. 2
      main/exercise/export/exercise_import.php
  11. 2
      main/exercise/global_multiple_answer.class.php
  12. 2
      main/exercise/hotpotatoes.php
  13. 2
      main/exercise/hotspot_admin.inc.php
  14. 2
      main/exercise/multiple_answer.class.php
  15. 2
      main/exercise/multiple_answer_combination.class.php
  16. 2
      main/exercise/multiple_answer_true_false.class.php
  17. 2
      main/exercise/question_admin.inc.php
  18. 4
      main/exercise/unique_answer.class.php
  19. 2
      main/exercise/unique_answer_no_option.class.php
  20. 65
      main/gradebook/gradebook.php
  21. 4
      main/gradebook/gradebook_add_eval.php
  22. 56
      main/gradebook/index.php
  23. 10
      main/group/group_space.php
  24. 3
      main/inc/lib/display.lib.php
  25. 4
      main/inc/lib/exercise.lib.php
  26. 2
      main/inc/lib/myspace.lib.php
  27. 6
      main/inc/lib/system_announcements.lib.php
  28. 2
      main/inc/lib/usermanager.lib.php
  29. 33
      main/lp/blank.php
  30. 4
      main/lp/lp_add.php
  31. 4
      main/lp/lp_build.php
  32. 6
      main/mySpace/user_edit.php
  33. 4
      main/permissions/group_permissions.inc.php
  34. 2
      main/permissions/roles.php
  35. 4
      main/permissions/user_permissions.inc.php
  36. 2
      main/session/add_courses_to_session.php
  37. 2
      main/session/add_users_to_session.php
  38. 2
      main/session/session_course_edit.php
  39. 2
      main/session/session_export.php
  40. 6
      main/session/session_import.php
  41. 2
      main/session/session_import_drh.php
  42. 2
      main/session/session_user_import.php
  43. 19
      main/survey/surveyUtil.class.php
  44. 2
      main/survey/survey_invitation.php
  45. 4
      main/survey/survey_invite.php
  46. 4
      main/tracking/course_session_report.php
  47. 4
      main/upload/form.scorm.php
  48. 13
      main/upload/upload.document.php
  49. 30
      main/user/classes.php
  50. 10
      src/Chamilo/CourseBundle/Component/CourseCopy/CourseSelectForm.php

@ -101,7 +101,7 @@ class Draggable extends Question
if ($nb_matches < 1) {
$nb_matches = 1;
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal');
}
for ($i = 1; $i <= $nb_matches; ++$i) {

@ -115,7 +115,7 @@ class MatchingDraggable extends Question
if ($nb_matches < 1) {
$nb_matches = 1;
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal');
}
$editorConfig = array(
@ -174,7 +174,7 @@ class MatchingDraggable extends Question
if ($nb_options < 1) {
$nb_options = 1;
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal');
}
for ($i = 1; $i <= $nb_options; ++$i) {

@ -116,9 +116,7 @@ class UniqueAnswerImage extends UniqueAnswer
if ($numberAnswers < 1) {
$numberAnswers = 1;
Display::addFlash(Display::return_message(
get_lang('YouHaveToCreateAtLeastOneAnswer')
));
echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
}
for ($i = 1; $i <= $numberAnswers; ++$i) {

@ -483,7 +483,7 @@ if (!$newQuestion && !$modifyQuestion && !$editQuestion && !isset($_GET['hotspot
// this test to display only message in the question authoring page and not in the question list page too
// if (is_object($objQuestion) && $objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_EXAM && ($newQuestion || $modifyQuestion || $editQuestion)) {
if ($objExercise->selectFeedbackType() == EXERCISE_FEEDBACK_TYPE_EXAM) {
Display::addFlash(Display::return_message(get_lang('TestFeedbackNotShown'), 'normal'));
echo Display::return_message(get_lang('TestFeedbackNotShown'), 'normal');
}
Session::write('objExercise', $objExercise);

@ -6755,7 +6755,7 @@ class Exercise
if ($this->feedback_type != EXERCISE_FEEDBACK_TYPE_DIRECT) {
// if the user has already answered this question
if (isset($exerciseResult[$questionId])) {
Display::addFlash(Display::return_message(get_lang('AlreadyAnswered'), 'normal'));
echo Display::return_message(get_lang('AlreadyAnswered'), 'normal');
break;
}
}
@ -7061,7 +7061,7 @@ class Exercise
// Display text when test is finished #4074 and for LP #4227
$end_of_message = $this->selectTextWhenFinished();
if (!empty($end_of_message)) {
Display::addFlash(Display::return_message($end_of_message, 'normal', false));
echo Display::return_message($end_of_message, 'normal', false);
echo "<div class='clear'>&nbsp;</div>";
}

@ -209,15 +209,14 @@ if ($form->validate()) {
echo '</div>';
if ($objExercise->feedback_type == 1) {
Display::addFlash(Display::return_message(
get_lang('DirectFeedbackCantModifyTypeQuestion')
));
echo Display::return_message(get_lang('DirectFeedbackCantModifyTypeQuestion'));
}
if (api_get_setting('search_enabled')=='true' &&
if (
api_get_setting('search_enabled')=='true' &&
!extension_loaded('xapian')
) {
Display::display_error_message(get_lang('SearchXapianModuleNotInstalled'));
echo Display::return_message(get_lang('SearchXapianModuleNotInstalled'), 'error');
}
// to hide the exercise description

@ -173,7 +173,7 @@ if (!empty($exercise_stat_info)) {
$max_score = $objExercise->get_max_score();
Display::addFlash(Display::return_message(get_lang('Saved').'<br />', 'normal', false));
echo Display::return_message(get_lang('Saved').'<br />', 'normal', false);
// Display and save questions
ExerciseLib::display_question_list_by_attempt(

@ -244,7 +244,7 @@ if (!empty($track_exercise_info)) {
}
}
} else {
Display::addFlash(Display::return_message(get_lang('CantViewResults'), 'warning'));
echo Display::return_message(get_lang('CantViewResults'), 'warning');
$show_results = false;
}
@ -324,7 +324,7 @@ if (!empty($track_exercise_info['data_tracking'])) {
// Display the text when finished message if we are on a LP #4227
$end_of_message = $objExercise->selectTextWhenFinished();
if (!empty($end_of_message) && ($origin == 'learnpath')) {
Display::addFlash(Display::return_message($end_of_message, 'normal', false));
echo Display::return_message($end_of_message, 'normal', false);
echo "<div class='clear'>&nbsp;</div>";
}
@ -984,7 +984,7 @@ if ($origin != 'learnpath') {
echo "<script>window.parent.API.void_save_asset('$totalScore', '$totalWeighting', 0, 'completed'); </script>";
echo '</body></html>';
} else {
Display::addFlash(Display::return_message(get_lang('ExerciseFinished').' '.get_lang('ToContinueUseMenu'), 'normal'));
echo Display::return_message(get_lang('ExerciseFinished').' '.get_lang('ToContinueUseMenu'), 'normal');
echo '<br />';
}
}

@ -734,10 +734,13 @@ $interbreadcrumb[] = array("url" => "exercise.php?".api_get_cidreq(), "name" =>
$interbreadcrumb[] = array("url" => "#", "name" => $objExercise->name);
if ($origin != 'learnpath') { //so we are not in learnpath tool
Display :: display_header(null, 'Exercises');
if (!api_is_allowed_to_session_edit()) {
Display::addFlash(Display::return_message(get_lang('SessionIsReadOnly'), 'warning'));
Display::addFlash(
Display::return_message(get_lang('SessionIsReadOnly'), 'warning')
);
}
Display :: display_header(null, 'Exercises');
} else {
$htmlHeadXtra[] = "
<style>
@ -1202,7 +1205,7 @@ if (!empty($error)) {
$questionName = $objQuestionTmp->selectTitle();
// destruction of the Question object
unset($objQuestionTmp);
Display::addFlash(Display::return_message(get_lang('AlreadyAnswered')));
echo Display::return_message(get_lang('AlreadyAnswered'));
$i++;
break;
}

@ -75,7 +75,7 @@ Display::display_introduction_section(
// Display Forms or dialog box(if needed)
if (isset($dialogBox)) {
echo Display::addFlash(Display::return_message($dialogBox, 'normal', false));
echo Display::return_message($dialogBox, 'normal', false);
}
if (isset($display)) {

@ -72,7 +72,7 @@ class GlobalMultipleAnswer extends Question
/* V<EFBFBD>rification : Cr<EFBFBD>action d'au moins une r<EFBFBD>ponse */
if ($nb_answers < 1) {
$nb_answers = 1;
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal');
}
//D<EFBFBD>but affichage score global dans la modification d'une question

@ -236,7 +236,7 @@ if ((api_is_allowed_to_edit(null, true)) && (($finish == 0) || ($finish == 2)))
}
if ($dialogBox) {
Display::addFlash(Display::return_message($dialogBox, 'normal', false));
echo Display::return_message($dialogBox, 'normal', false);
}
$form->display();

@ -572,7 +572,7 @@ if ($modifyAnswers) {
);
if (!empty($msgErr)) {
Display::addFlash(Display::return_message($msgErr, 'normal')); //main API
echo Display::return_message($msgErr, 'normal'); //main API
}
$hotspot_admin_url = api_get_path(WEB_CODE_PATH) . 'exercise/admin.php?' . api_get_cidreq() . '&hotspotadmin=' . $modifyAnswers . '&exerciseId=' . $exerciseId . '&' . api_get_cidreq();

@ -75,7 +75,7 @@ class MultipleAnswer extends Question
if ($nb_answers < 1) {
$nb_answers = 1;
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
}
for ($i = 1; $i <= $nb_answers; ++$i) {

@ -68,7 +68,7 @@ class MultipleAnswerCombination extends Question
if ($nb_answers < 1) {
$nb_answers = 1;
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
}
for ($i = 1; $i <= $nb_answers; ++$i) {

@ -77,7 +77,7 @@ class MultipleAnswerTrueFalse extends Question
$form->addElement('hidden', 'nb_answers');
if ($nb_answers < 1) {
$nb_answers = 1;
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
}
// Can be more options

@ -77,7 +77,7 @@ if (is_object($objQuestion)) {
echo '<img src="../document/download.php?doc_url=%2Fimages%2F'.$pictureName.'" border="0">';
}
if (!empty($msgErr)) {
Display::addFlash(Display::return_message($msgErr, 'normal'));
echo Display::return_message($msgErr, 'normal');
}
// display the form
$form->display();

@ -123,9 +123,9 @@ class UniqueAnswer extends Question
if ($nb_answers < 1) {
$nb_answers = 1;
Display::addFlash(Display::return_message(
echo Display::return_message(
get_lang('YouHaveToCreateAtLeastOneAnswer')
));
);
}
for ($i = 1; $i <= $nb_answers; ++$i) {

@ -87,7 +87,7 @@ class UniqueAnswerNoOption extends Question
$temp_scenario = array();
if ($nb_answers < 1) {
$nb_answers = 1;
Display::addFlash(Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'), 'normal'));
echo Display::return_message(get_lang('YouHaveToCreateAtLeastOneAnswer'));
}
$editQuestion = isset($_GET['editQuestion']) ? $_GET['editQuestion'] : false;
if ($editQuestion) {

@ -371,36 +371,6 @@ if (isset ($_POST['submit']) && isset ($_POST['keyword'])) {
exit;
}
// DISPLAY HEADERS AND MESSAGES -
if (!isset($_GET['exportpdf']) && !isset($_GET['export_certificate'])) {
if (isset ($_GET['studentoverview'])) {
$interbreadcrumb[]= array (
'url' => $_SESSION['gradebook_dest'].'?selectcat=' . $selectcat.'&'.api_get_cidreq(),
'name' => get_lang('ToolGradebook')
);
Display :: display_header(get_lang('FlatView'));
} elseif (isset ($_GET['search'])) {
if ($_SESSION['gradebook_dest'] == 'index.php') {
$gradebook_dest = Security::remove_XSS($_SESSION['gradebook_dest']).'?'.api_get_cidreq().'&amp;';
} else {
$gradebook_dest = Security::remove_XSS($_SESSION['gradebook_dest']);
}
$interbreadcrumb[]= array ('url' => $gradebook_dest,'name' => get_lang('Gradebook'));
if ((isset($_GET['selectcat']) && $_GET['selectcat']>0)) {
if (!empty($_GET['course'])) {
$interbreadcrumb[]= array ('url' => $gradebook_dest.'selectcat='.$selectcat,'name' => get_lang('Details'));
} else {
$interbreadcrumb[]= array ('url' => $_SESSION['gradebook_dest'].'?selectcat=0','name' => get_lang('Details'));
}
}
Display :: display_header('');
} else {
Display :: display_header('');
}
}
if (isset($_GET['categorymoved'])) {
Display::addFlash(Display::return_message(get_lang('CategoryMoved'), 'confirmation', false));
}
@ -443,6 +413,37 @@ if (isset ($warning_message)) {
if (isset ($move_form)) {
Display::addFlash(Display::return_message($move_form->toHtml(), 'normal', false));
}
// DISPLAY HEADERS AND MESSAGES -
if (!isset($_GET['exportpdf']) && !isset($_GET['export_certificate'])) {
if (isset ($_GET['studentoverview'])) {
$interbreadcrumb[]= array (
'url' => $_SESSION['gradebook_dest'].'?selectcat=' . $selectcat.'&'.api_get_cidreq(),
'name' => get_lang('ToolGradebook')
);
Display :: display_header(get_lang('FlatView'));
} elseif (isset ($_GET['search'])) {
if ($_SESSION['gradebook_dest'] == 'index.php') {
$gradebook_dest = Security::remove_XSS($_SESSION['gradebook_dest']).'?'.api_get_cidreq().'&amp;';
} else {
$gradebook_dest = Security::remove_XSS($_SESSION['gradebook_dest']);
}
$interbreadcrumb[]= array ('url' => $gradebook_dest,'name' => get_lang('Gradebook'));
if ((isset($_GET['selectcat']) && $_GET['selectcat']>0)) {
if (!empty($_GET['course'])) {
$interbreadcrumb[]= array ('url' => $gradebook_dest.'selectcat='.$selectcat,'name' => get_lang('Details'));
} else {
$interbreadcrumb[]= array ('url' => $_SESSION['gradebook_dest'].'?selectcat=0','name' => get_lang('Details'));
}
}
Display :: display_header('');
} else {
Display :: display_header('');
}
}
// LOAD DATA & DISPLAY TABLE -
$is_platform_admin= api_is_platform_admin();
$is_course_admin= api_is_allowed_to_edit();
@ -602,14 +603,14 @@ $gradebooktable = new GradebookTable(
if (((empty($allcat)) && (empty ($alleval)) && (empty ($alllink)) && (!$is_platform_admin) && ($is_course_admin) && (!isset($_GET['selectcat']))) &&
api_is_course_tutor()
) {
Display::addFlash(Display::return_message(
echo Display::return_message(
get_lang('GradebookWelcomeMessage') .
'<br /><br />
<form name="createcat" method="post" action="' . api_get_self() . '?createallcategories=1">
<input type="submit" value="' . get_lang('CreateAllCat') . '"></form>',
'normal',
false
));
);
}
// Here we are in a sub category
if ($category != '0') {

@ -109,9 +109,11 @@ $(document).ready( function() {
});
</script>';
Display :: display_header(get_lang('NewEvaluation'));
if ($evaladd->get_course_code() == null) {
Display::addFlash(Display::return_message(get_lang('CourseIndependentEvaluation'), 'normal', false));
}
Display::display_header(get_lang('NewEvaluation'));
$form->display();
Display :: display_footer();

@ -512,32 +512,6 @@ if (isset ($_POST['submit']) && isset ($_POST['keyword'])) {
exit;
}
// DISPLAY HEADERS AND MESSAGES
if (!isset($_GET['exportpdf'])) {
if (isset ($_GET['studentoverview'])) {
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectCat,
'name' => get_lang('ToolGradebook')
);
Display :: display_header(get_lang('FlatView'));
} elseif (isset($_GET['search'])) {
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectCat,
'name' => get_lang('ToolGradebook')
);
Display :: display_header(get_lang('SearchResults'));
} elseif(!empty($selectCat)) {
$interbreadcrumb[] = array(
'url' => '#',
'name' => get_lang('ToolGradebook')
);
Display :: display_header('');
} else {
Display :: display_header(get_lang('ToolGradebook'));
}
}
if (isset ($_GET['categorymoved'])) {
Display::addFlash(Display::return_message(get_lang('CategoryMoved'), 'confirmation', false));
}
@ -581,6 +555,32 @@ if (isset ($move_form)){
Display::addFlash(Display::return_message($move_form->toHtml(), 'normal', false));
}
// DISPLAY HEADERS AND MESSAGES
if (!isset($_GET['exportpdf'])) {
if (isset ($_GET['studentoverview'])) {
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectCat,
'name' => get_lang('ToolGradebook')
);
Display :: display_header(get_lang('FlatView'));
} elseif (isset($_GET['search'])) {
$interbreadcrumb[] = array(
'url' => $_SESSION['gradebook_dest'].'?selectcat='.$selectCat,
'name' => get_lang('ToolGradebook')
);
Display :: display_header(get_lang('SearchResults'));
} elseif(!empty($selectCat)) {
$interbreadcrumb[] = array(
'url' => '#',
'name' => get_lang('ToolGradebook')
);
Display :: display_header('');
} else {
Display :: display_header(get_lang('ToolGradebook'));
}
}
// LOAD DATA & DISPLAY TABLE
$is_platform_admin = api_is_platform_admin();
@ -901,7 +901,9 @@ if (isset($first_time) && $first_time == 1 && api_is_allowed_to_edit(null,true))
) {
//Showing the grading system
if (!empty($grade_models[$grade_model_id])) {
Display::addFlash(Display::return_message(get_lang('GradeModel').': '.$grade_models[$grade_model_id]['name']));
echo Display::return_message(
get_lang('GradeModel').': '.$grade_models[$grade_model_id]['name']
);
}
}

@ -39,11 +39,6 @@ if (!GroupManager::userHasAccessToBrowse($user_id, $current_group, api_get_sessi
api_not_allowed(true);
}
Display::display_header($nameTools.' '.Security::remove_XSS($current_group['name']), 'Group');
/* Introduction section (editable by course admin) */
Display::display_introduction_section(TOOL_GROUP);
/* Actions and Action links */
/*
@ -66,6 +61,11 @@ if (!empty($_GET['selfUnReg']) &&
Display::addFlash(Display::return_message(get_lang('StudentDeletesHimself'), 'normal'));
}
Display::display_header($nameTools.' '.Security::remove_XSS($current_group['name']), 'Group');
/* Introduction section (editable by course admin) */
Display::display_introduction_section(TOOL_GROUP);
echo '<div class="actions">';
echo '<a href="group.php">'.
Display::return_icon('back.png', get_lang('BackToGroupList'), '', ICON_SIZE_MEDIUM).

@ -436,7 +436,8 @@ class Display
* @param bool $filter (true) or not (false)
* @param bool $returnValue
*
* @deprecated use Display::addFlash(Display::return_message($message, 'normal'));
* @deprecated Use <code>Display::addFlash(Display::return_message($message, 'normal'));</code>
* Or <code>echo Display::return_message($message, 'normal')</code>
*
* @return void
*/

@ -3717,7 +3717,7 @@ HOTSPOT;
// Display text when test is finished #4074 and for LP #4227
$end_of_message = $objExercise->selectTextWhenFinished();
if (!empty($end_of_message)) {
Display::addFlash(Display::return_message($end_of_message, 'normal', false));
echo Display::return_message($end_of_message, 'normal', false);
echo "<div class='clear'>&nbsp;</div>";
}
@ -3921,7 +3921,7 @@ HOTSPOT;
}
if (!empty($remainingMessage)) {
Display::addFlash(Display::return_message($remainingMessage, 'normal', false));
echo Display::return_message($remainingMessage, 'normal', false);
}
if ($save_user_result) {

@ -827,7 +827,7 @@ class MySpace
$message .= '<li>'.$extrafields[$extra_field_export][3].'</li>';
}
Display::addFlash(Display::return_message(get_lang('FollowingFieldsWillAlsoBeExported').': <br /><ul>'.$message.'</ul>', 'normal', false));
echo Display::return_message(get_lang('FollowingFieldsWillAlsoBeExported').': <br /><ul>'.$message.'</ul>', 'normal', false);
}
}
}

@ -527,7 +527,7 @@ class SystemAnnouncementManager
$lang = is_null($lang) ? '' : $lang;
if (!checkdate($date_start_to_compare[1], $date_start_to_compare[2], $date_start_to_compare[0])) {
Display::addFlash(Display::return_message(get_lang('InvalidStartDate'), 'normal'));
echo Display::return_message(get_lang('InvalidStartDate'));
return false;
}
@ -537,13 +537,13 @@ class SystemAnnouncementManager
$date_end_to_compare[0]) &&
!checkdate($date_end_to_compare[1], $date_end_to_compare[2], $date_end_to_compare[0])
) {
Display::addFlash(Display::return_message(get_lang('InvalidEndDate'), 'normal'));
echo Display::return_message(get_lang('InvalidEndDate'));
return false;
}
if (strlen(trim($title)) == 0) {
Display::addFlash(Display::return_message(get_lang('InvalidTitle'), 'normal'));
echo Display::return_message(get_lang('InvalidTitle'));
return false;
}

@ -4793,7 +4793,7 @@ class UserManager
//345600 = 7 days in seconds 63072000= 2 ans
// if ($currentTimestamp - $timestamp > 184590 )
if ($currentTimestamp - $timestamp > $inactive_time && self::delete_user($student_id)) {
Display::addFlash(Display::return_message(get_lang('UserDeleted'), 'normal'));
echo Display::return_message(get_lang('UserDeleted'));
echo '<p>', 'id', $student_id, ':', $last_login_date, '</p>';
}
}

@ -16,32 +16,29 @@ $htmlHeadXtra[] = "
body { background: none;}
</style>
";
Display::display_reduced_header();
$message = null;
if (isset($_GET['error'])) {
switch ($_GET['error']) {
case 'document_deleted':
echo '<br /><br />';
Display::addFlash(Display::return_message(get_lang('DocumentHasBeenDeleted'), 'error'));
$message = Display::return_message(get_lang('DocumentHasBeenDeleted'), 'error');
break;
case 'prerequisites':
echo '<br /><br />';
Display::addFlash(Display::return_message(get_lang('LearnpathPrereqNotCompleted'), 'warning'));
$message = Display::return_message(get_lang('LearnpathPrereqNotCompleted'), 'warning');
break;
case 'document_not_found':
echo '<br /><br />';
Display::addFlash(Display::return_message(get_lang('FileNotFound'), 'warning'));
$message = Display::return_message(get_lang('FileNotFound'), 'warning');
break;
case 'reached_one_attempt':
echo '<br /><br />';
Display::addFlash(Display::return_message(get_lang('ReachedOneAttempt'), 'warning'));
$message = Display::return_message(get_lang('ReachedOneAttempt'), 'warning');
break;
case 'x_frames_options':
$src = Session::read('x_frame_source');
if (!empty($src)) {
$icon = '<em class="icon-play-sign icon-2x"></em>&nbsp;';
$icon = '<em class="icon-play-sign icon-2x" aria-hidden="true"></em> ';
echo Display::return_message(
$message = Display::return_message(
Display::url($icon.$src, $src, ['class' => 'btn generated', 'target' => '_blank']),
'normal',
false
@ -53,9 +50,15 @@ if (isset($_GET['error'])) {
break;
}
} elseif (isset($_GET['msg']) && $_GET['msg'] == 'exerciseFinished') {
echo '<br /><br />';
Display::addFlash(Display::return_message(get_lang('ExerciseFinished'), 'normal'));
Display::addFlash(
Display::return_message(get_lang('ExerciseFinished'))
);
}
if (!empty($message)) {
Display::addFlash($message);
}
Display::display_reduced_header();
Display::display_reduced_footer();
?>
</body>
</html>

@ -74,10 +74,10 @@ echo '<a href="lp_controller.php?'.api_get_cidreq().'">'.
Display::return_icon('back.png', get_lang('ReturnToLearningPaths'), '', ICON_SIZE_MEDIUM).'</a>';
echo '</div>';
Display::addFlash(Display::return_message(get_lang('AddLpIntro'), 'normal', false));
echo Display::return_message(get_lang('AddLpIntro'), 'normal', false);
if ($_POST && empty($_REQUEST['lp_name'])) {
Display::addFlash(Display::return_message(get_lang('FormHasErrorsPleaseComplete'), 'error', false));
echo Display::return_message(get_lang('FormHasErrorsPleaseComplete'), 'error', false);
}
$form = new FormValidator(

@ -112,10 +112,10 @@ echo '</div>';
echo '<div class="col-md-8">';
if (isset($is_success) && $is_success === true) {
Display::addFlash(Display::return_message(get_lang('ItemRemoved'), 'confirmation'));
echo Display::return_message(get_lang('ItemRemoved'), 'confirmation');
} else {
if ($is_new) {
Display::addFlash(Display::return_message(get_lang('LearnpathAdded'), 'normal', zfalse));
echo Display::return_message(get_lang('LearnpathAdded'), 'normal', false);
}
// Display::addFlash(Display::return_message(get_lang('LPCreatedAddChapterStep'), 'normal', false));
$gradebook = isset($_GET['gradebook']) ? Security::remove_XSS($_GET['gradebook']) : null;

@ -205,12 +205,12 @@ $interbreadcrumb[] = array(
"name" => get_lang('UserList'),
);
// Display form
Display::display_header($tool_name);
if (isset($_REQUEST['message'])) {
Display::addFlash(Display::return_message(get_lang('Updated'), 'normal'));
}
Display::display_header($tool_name);
// Display form
$form->display();
Display::display_footer();

@ -12,7 +12,7 @@ echo $group_id;
if ($_POST['StoreGroupPermissions'] and $setting_visualisation == 'checkbox') {
$result_message = store_permissions('group', $group_id);
if ($result_message) {
Display::addFlash(Display::return_message($result_message, 'normal'));
echo Display::return_message($result_message);
}
}
if (isset($_GET['action'])) {
@ -25,7 +25,7 @@ if (isset($_GET['action'])) {
}
}
if (isset($result_message)) {
Display::addFlash(Display::return_message($result_message, 'normal'));
echo Display::return_message($result_message);
}
// RETRIEVING THE PERMISSIONS

@ -65,7 +65,7 @@ if (isset($_GET['action']) AND isset($_GET['role_id']) AND $_GET['action'] == 'd
// displaying the return message of the actions
if (isset($result_message)) {
Display::addFlash(Display::return_message($result_message, 'normal'));
echo Display::return_message($result_message);
}
// ADDING A NEW ROLE (FORM AND LINK)

@ -15,7 +15,7 @@ include_once (api_get_library_path()."/blog.lib.php");
if ($_POST['StoreUserPermissions'] and $setting_visualisation == 'checkbox') {
$result_message = store_permissions('user', $user_id);
if ($result_message) {
Display::addFlash(Display::return_message($result_message, 'normal'));
echo Display::return_message($result_message);
}
}
if (isset($_GET['action'])) {
@ -30,7 +30,7 @@ if (isset($_GET['action'])) {
}
if (isset($result_message)) {
Display::addFlash(Display::return_message($result_message, 'normal'));
echo Display::return_message($result_message);
}
// ---------------------------------------------------

@ -212,7 +212,7 @@ unset($Courses);
<?php
if (!empty($errorMsg)) {
Display::addFlash(Display::return_message($errorMsg, 'normal')); //main API
echo Display::return_message($errorMsg); //main API
}
?>
<div id="multiple-add-session" class="row">

@ -628,7 +628,7 @@ if ($add_type=='multiple') {
<?php
if (!empty($errorMsg)) {
Display::addFlash(Display::return_message($errorMsg, 'normal')); //main API
echo Display::return_message($errorMsg); //main API
}
?>
<div id="multiple-add-session" class="row">

@ -153,7 +153,7 @@ api_display_tool_title($tool_name);
<div class="title"></div>
<?php
if(!empty($errorMsg)) {
Display::addFlash(Display::return_message($errorMsg, 'normal'));
echo Display::return_message($errorMsg);
}
?>
</div>

@ -298,7 +298,7 @@ echo '<a href="../session/session_list.php">'.
echo '</div>';
if (!empty($errorMsg)) {
Display::addFlash(Display::return_message($errorMsg, 'normal', false)); //main API
echo Display::return_message($errorMsg, 'normal', false); //main API
}
$form = new FormValidator('session_export', 'post', api_get_self());

@ -463,7 +463,7 @@ if (count($inserted_in_course) > 1) {
$msg .= ' '.$title.' ('.$title.'),';
}
$msg = substr($msg, 0, -1);
Display::addFlash(Display::return_message($msg, 'warning'));
echo Display::return_message($msg, 'warning');
}
echo '<div class="actions">';
@ -472,7 +472,7 @@ echo '<a href="../session/session_list.php">'.
echo '</div>';
if (!empty($error_message)) {
Display::addFlash(Display::return_message($error_message, 'normal', false));
echo Display::return_message($error_message, 'normal', false);
}
$form = new FormValidator('import_sessions', 'post', api_get_self(), null, array('enctype' => 'multipart/form-data'));
@ -517,7 +517,7 @@ $form->addButtonImport(get_lang('ImportSession'));
$defaults = array('sendMail' => 'true', 'file_type' => 'csv');
$form->setDefaults($defaults);
Display::addFlash(Display::return_message(get_lang('TheXMLImportLetYouAddMoreInfoAndCreateResources'), 'normal'));
Display::return_message(get_lang('TheXMLImportLetYouAddMoreInfoAndCreateResources'));
$form->display();
?>

@ -31,7 +31,7 @@ echo '<a href="../session/session_list.php">'.
echo '</div>';
if (!empty($error_message)) {
Display::addFlash(Display::return_message($error_message, 'normal', false));
echo Display::return_message($error_message, 'normal', false);
}
$form = new FormValidator('import_sessions', 'post', api_get_self(), null, array('enctype' => 'multipart/form-data'));

@ -72,7 +72,7 @@ echo '<a href="resume_session.php?id_session='.$session_id.'">'.
echo '</div>';
if (!empty($error_message)) {
Display::addFlash(Display::return_message($error_message, 'normal', false));
echo Display::return_message($error_message, 'normal', false);
}
$form = new FormValidator(

@ -31,11 +31,11 @@ class SurveyUtil
$error = false;
while ($row = Database::fetch_array($result, 'ASSOC')) {
if ($counter == 1 && $row['type'] == 'pagebreak') {
Display::addFlash(Display::return_message(get_lang('PagebreakNotFirst'), 'error', false));
echo Display::return_message(get_lang('PagebreakNotFirst'), 'error', false);
$error = true;
}
if ($counter == $total && $row['type'] == 'pagebreak') {
Display::addFlash(Display::return_message(get_lang('PagebreakNotLast'), 'error', false));
echo Display::return_message(get_lang('PagebreakNotLast'), 'error', false);
$error = true;
}
$counter++;
@ -186,8 +186,9 @@ class SurveyUtil
if ($error) {
$tool_name = get_lang('Reporting');
Display::display_header($tool_name);
Display::addFlash(Display::return_message(get_lang('Error').': '.$error, 'error', false));
Display::display_header($tool_name);
Display::display_footer();
exit;
} else {
@ -281,7 +282,7 @@ class SurveyUtil
$message = get_lang('SurveyUserAnswersHaveBeenRemovedSuccessfully').'<br />
<a href="'.api_get_path(WEB_CODE_PATH).'survey/reporting.php?action=userreport&survey_id='.$survey_id.'">'.
get_lang('GoBack').'</a>';
Display::addFlash(Display::return_message($message, 'confirmation', false));
echo Display::return_message($message, 'confirmation', false);
}
}
@ -366,11 +367,11 @@ class SurveyUtil
$course_id = api_get_course_int_id();
// Step 2: displaying the survey and the answer of the selected users
if (isset($_GET['user'])) {
Display::addFlash(Display::return_message(
echo Display::return_message(
get_lang('AllQuestionsOnOnePage'),
'normal',
false
));
);
// Getting all the questions and options
$sql = "SELECT
@ -1672,7 +1673,7 @@ class SurveyUtil
echo '</div>';
// Displaying an information message that only the questions with predefined answers can be used in a comparative report
Display::addFlash(Display::return_message(get_lang('OnlyQuestionsWithPredefinedAnswers'), 'normal', false));
echo Display::return_message(get_lang('OnlyQuestionsWithPredefinedAnswers'), 'normal', false);
$xAxis = isset($_GET['xaxis']) ? Security::remove_XSS($_GET['xaxis']) : '';
$yAxis = isset($_GET['yaxis']) ? Security::remove_XSS($_GET['yaxis']) : '';
@ -2528,7 +2529,7 @@ class SurveyUtil
if (isset($_GET['do_search']) && $_GET['do_search']) {
$message = get_lang('DisplaySearchResults').'<br />';
$message .= '<a href="'.api_get_self().'?'.api_get_cidreq().'">'.get_lang('DisplayAll').'</a>';
Display::addFlash(Display::return_message($message, 'normal', false));
echo Display::return_message($message, 'normal', false);
}
// Create a sortable table with survey-data
@ -2567,7 +2568,7 @@ class SurveyUtil
if (isset($_GET['do_search'])) {
$message = get_lang('DisplaySearchResults').'<br />';
$message .= '<a href="'.api_get_self().'?'.api_get_cidreq().'">'.get_lang('DisplayAll').'</a>';
Display::addFlash(Display::return_message($message, 'normal', false));
echo Display::return_message($message, 'normal', false);
}
// Create a sortable table with survey-data

@ -47,7 +47,7 @@ Display::display_header($tool_name);
// Getting all the people who have filled this survey
$answered_data = SurveyManager::get_people_who_filled_survey($survey_id);
if ($survey_data['anonymous'] == 1) {
Display::addFlash(Display::return_message(get_lang('AnonymousSurveyCannotKnowWhoAnswered').' '.count($answered_data).' '.get_lang('PeopleAnswered'), 'normal'));
echo Display::return_message(get_lang('AnonymousSurveyCannotKnowWhoAnswered').' '.count($answered_data).' '.get_lang('PeopleAnswered'));
$answered_data = array();
}

@ -83,7 +83,7 @@ if ($survey_data['invited'] > 0 && !isset($_POST['submit'])) {
$message .= get_lang('HaveAnswered').' ';
$message .= '<a href="'.api_get_path(WEB_CODE_PATH).'survey/survey_invitation.php?view=invited&survey_id='.$survey_data['survey_id'].'">'.$survey_data['invited'].'</a> ';
$message .= get_lang('WereInvited');
Display::addFlash(Display::return_message($message, 'normal', false));
echo Display::return_message($message, 'normal', false);
}
// Building the form for publishing the survey
@ -178,7 +178,7 @@ if ($form->validate()) {
if ($sendMail) {
if (empty($values['mail_title']) || empty($values['mail_text'])) {
Display::addFlash(Display::return_message(get_lang('FormHasErrorsPleaseComplete'), 'error'));
echo Display::return_message(get_lang('FormHasErrorsPleaseComplete'), 'error');
// Getting the invited users
$defaults = SurveyUtil::get_invited_users($survey_data['code']);

@ -84,7 +84,7 @@ if (!$export_to_xls) {
echo '<h2>'.get_lang('LPExerciseResultsBySession').'</h2>';
$form->display();
Display::addFlash(Display::return_message(get_lang('StudentScoreAverageIsCalculatedBaseInAllLPsAndAllAttempts'), 'normal'));
echo Display::return_message(get_lang('StudentScoreAverageIsCalculatedBaseInAllLPsAndAllAttempts'));
}
$users = SessionManager::get_users_by_session($session_id);
@ -218,7 +218,7 @@ if (!empty($users) && is_array($users)) {
$html_result .= "</tr>";
$html_result .= '</table>';
} else {
Display::addFlash(Display::return_message(get_lang('NoResults'), 'warning'));
echo Display::return_message(get_lang('NoResults'), 'warning');
}
if (!$export_to_xls) {

@ -127,11 +127,11 @@ if (is_dir(api_get_path(PLUGIN_PATH)."/pens")) {
// the default values for the form
$defaults = array('index_document' => 'checked="checked"', 'use_max_score' => 1);
$form->setDefaults($defaults);
Display::addFlash(Display::return_message(
echo Display::return_message(
Display::tag('strong', get_lang('SupportedScormContentMakers')).': '.implode(', ', $content_origins),
'normal',
false
));
);
$form->display();
Display::display_footer();

@ -80,14 +80,13 @@ if (isset($_FILES['user_upload'])) {
$missing_files = check_for_missing_files($base_work_dir.$_POST['curdirpath'].$new_path);
if ($missing_files) {
//show a form to upload the missing files
Display::addFlash(Display::return_message(
echo Display::return_message(
build_missing_files_form(
$missing_files,
$_POST['curdirpath'],
$_FILES['user_upload']['name']
),
'normal'
));
)
);
}
}
}
@ -146,10 +145,10 @@ if (isset($_POST['create_dir']) && $_POST['dirname'] != '') {
$_POST['dirname']
);
if ($created_dir) {
Display::addFlash(Display::return_message(get_lang('DirCr'), 'normal'));
echo Display::return_message(get_lang('DirCr'));
$path = $created_dir;
} else {
Display::addFlash(Display::return_message(get_lang('CannotCreateDir')));
echo Display::return_message(get_lang('CannotCreateDir'));
}
}
@ -162,7 +161,7 @@ if (isset($_GET['createdir'])) {
$new_folder_text .= '<input type="submit" name="create_dir" value="'.get_lang('Ok').'"/>';
$new_folder_text .= '</form>';
//show the form
Display::addFlash(Display::return_message($new_folder_text, 'normal'));
echo Display::return_message($new_folder_text, 'normal');
} else { //give them a link to create a directory
?>
<p>

@ -17,31 +17,37 @@ if (isset($_GET['id'])) {
$interbreadcrumb[] = array('url' =>'#', 'name' => get_lang('Groups'));
}
Display :: display_header($tool_name, 'Classes');
$content = '';
$usergroup = new UserGroup();
$usergroup_list = $usergroup->get_usergroup_by_user(api_get_user_id());
if (!empty($usergroup_list)) {
echo Display::tag('h1', get_lang('MyClasses'));
$content .= Display::tag('h1', get_lang('MyClasses'));
foreach ($usergroup_list as $group_id) {
if (isset($_GET['id']) && $_GET['id'] != $group_id) {
continue;
}
$data = $usergroup->get($group_id);
echo Display::tag('h2', $data['name']);
echo Display::div($data['description']);
$content .= Display::tag('h2', $data['name']);
$content .= Display::div($data['description']);
}
} else {
if (api_is_platform_admin()) {
Display::addFlash(Display::return_message(
Display::url(
get_lang('AddClasses'),
api_get_path(WEB_CODE_PATH).'admin/usergroups.php?action=add'
),
'normal',
false
));
Display::addFlash(
Display::return_message(
Display::url(
get_lang('AddClasses'),
api_get_path(WEB_CODE_PATH).'admin/usergroups.php?action=add'
),
'normal',
false
)
);
}
}
Display :: display_header($tool_name, 'Classes');
echo $content;
Display :: display_footer();

@ -178,7 +178,7 @@ class CourseSelectForm
echo get_lang('SelectResources');
echo '</p>';
Display::addFlash(Display::return_message(get_lang('DontForgetToSelectTheMediaFilesIfYourResourceNeedIt'), 'normal'));
echo Display::return_message(get_lang('DontForgetToSelectTheMediaFilesIfYourResourceNeedIt'));
foreach ($course->resources as $type => $resources) {
if (count($resources) > 0) {
@ -215,12 +215,12 @@ class CourseSelectForm
echo '<span class="title">'.$resource_titles[$type].'</span></div>';
echo '<div class="item-content" id="div_'.$type.'">';
if ($type == RESOURCE_LEARNPATH) {
Display::addFlash(Display::return_message(get_lang('ToExportLearnpathWithQuizYouHaveToSelectQuiz'), 'warning'));
Display::addFlash(Display::return_message(get_lang('IfYourLPsHaveAudioFilesIncludedYouShouldSelectThemFromTheDocuments'), 'warning'));
echo Display::return_message(get_lang('ToExportLearnpathWithQuizYouHaveToSelectQuiz'), 'warning');
echo Display::return_message(get_lang('IfYourLPsHaveAudioFilesIncludedYouShouldSelectThemFromTheDocuments'), 'warning');
}
if ($type == RESOURCE_DOCUMENT) {
if (api_get_setting('show_glossary_in_documents') != 'none') {
Display::addFlash(Display::return_message(get_lang('ToExportDocumentsWithGlossaryYouHaveToSelectGlossary'), 'warning'));
echo Display::return_message(get_lang('ToExportDocumentsWithGlossaryYouHaveToSelectGlossary'), 'warning');
}
}
@ -321,7 +321,7 @@ class CourseSelectForm
$recycleOption = isset($_POST['recycle_option']) ? true : false;
if (empty($element_count)) {
Display::addFlash(Display::return_message(get_lang('NoDataAvailable'), 'warning'));
echo Display::return_message(get_lang('NoDataAvailable'), 'warning');
} else {
if (!empty($hidden_fields['destination_session'])) {
echo '<br /><button class="save" type="submit" onclick="javascript:if(!confirm('."'".addslashes(api_htmlentities(get_lang("ConfirmYourChoice"), ENT_QUOTES, $charset))."'".')) return false;" >'.

Loading…
Cancel
Save