Minor - Cleanup course progress code

1.10.x
Yannick Warnier 10 years ago
parent f810f69e37
commit da86364ec5
  1. 7
      main/course_progress/thematic.php
  2. 4
      main/course_progress/thematic_controller.php
  3. 2
      main/course_progress/thematic_plan.php

@ -236,7 +236,7 @@ if ($action == 'thematic_list') {
} else {
echo '<div><em>'.get_lang('ThereIsNoAThematicSection').'</em></div>';
}
} else if ($action == 'thematic_add' || $action == 'thematic_edit') {
} elseif ($action == 'thematic_add' || $action == 'thematic_edit') {
// Display form
$form = new FormValidator('thematic_add','POST','index.php?action=thematic_add&'.api_get_cidreq());
@ -275,9 +275,10 @@ if ($action == 'thematic_list') {
if (isset($error)) {
Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false);
}
if ($show_form)
if ($show_form) {
$form->display();
} else if ($action == 'thematic_import_select') {
}
} elseif ($action == 'thematic_import_select') {
// Create form to upload csv file.
$form = new FormValidator('thematic_import','POST','index.php?action=thematic_import&'.api_get_cidreq().$url_token);
$form->addElement('header', get_lang('ImportThematic'));

@ -55,8 +55,8 @@ class ThematicController
if (api_is_allowed_to_edit(null, true)) {
$id = isset($_POST['thematic_id']) ? $_POST['thematic_id'] : null;
$title = $_POST['title'];
$content = $_POST['content'];
$title = trim($_POST['title']);
$content = trim($_POST['content']);
$session_id = api_get_session_id();
$thematic->set_thematic_attributes($id, $title, $content, $session_id);
$last_id = $thematic->thematic_save();

@ -73,7 +73,7 @@ if ($action == 'thematic_plan_list') {
}
$form->addButtonSave(get_lang('Save'));
$form->display();
} else if ($action == 'thematic_plan_add' || $action == 'thematic_plan_edit') {
} elseif ($action == 'thematic_plan_add' || $action == 'thematic_plan_edit') {
if ($description_type >= ADD_THEMATIC_PLAN) {
$header_form = get_lang('NewBloc');
} else {

Loading…
Cancel
Save