diff --git a/main/course_description/add.php b/main/course_description/add.php
index 8c83e8328d..eeecb0004b 100755
--- a/main/course_description/add.php
+++ b/main/course_description/add.php
@@ -24,7 +24,7 @@ echo ''.
'';
ksort($categories);
foreach ($categories as $id => $title) {
- if ($i==ADD_BLOCK) {
+ if ($i == ADD_BLOCK) {
echo ''.
Display::return_icon($default_description_icon[$id], $title, '',ICON_SIZE_MEDIUM).'';
break;
@@ -38,7 +38,7 @@ echo '';
// error messages
if (isset($error) && intval($error) == 1) {
- Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'),false);
+ Display::display_error_message(get_lang('FormHasErrorsPleaseComplete'), false);
}
// default header title form
@@ -48,9 +48,6 @@ if ($description_type >= ADD_BLOCK) {
$header = $default_description_titles[ADD_BLOCK];
}
-if (!$error) {
- $token = Security::get_token();
-}
// display form
$form = new FormValidator(
'course_description',
@@ -61,7 +58,7 @@ $form->addElement('header', '', $header);
$form->addElement('hidden', 'description_type', $description_type);
$form->addElement('hidden', 'sec_token', $token);
$form->addText('title', get_lang('Title'), true, array('size'=>'width: 350px;'));
-$form->applyFilter('title','html_filter');
+$form->applyFilter('title', 'html_filter');
$form->addHtmlEditor(
'contentDescription',
get_lang('Content'),
diff --git a/main/course_description/course_description_controller.php b/main/course_description/course_description_controller.php
index 2ec3af51e2..01cc693aec 100644
--- a/main/course_description/course_description_controller.php
+++ b/main/course_description/course_description_controller.php
@@ -76,11 +76,9 @@ class CourseDescriptionController
$data = array();
$data['id'] = $id;
$affected_rows = null;
- $message = array();
if (strtoupper($_SERVER['REQUEST_METHOD']) == "POST") {
if (!empty($_POST['title']) && !empty($_POST['contentDescription'])) {
- $check = Security::check_token();
- if ($check) {
+ if (1) {
$title = $_POST['title'];
$content = $_POST['contentDescription'];
$description_type = $_POST['description_type'];
@@ -108,7 +106,6 @@ class CourseDescriptionController
} else {
$course_description->insert();
}
- Security::clear_token();
Display::addFlash(
Display::return_message(
@@ -193,9 +190,7 @@ class CourseDescriptionController
$data = array();
if (strtoupper($_SERVER['REQUEST_METHOD']) == "POST") {
if (!empty($_POST['title']) && !empty($_POST['contentDescription'])) {
-
- $check = Security::check_token();
- if ($check) {
+ if (1) {
$title = $_POST['title'];
$content = $_POST['contentDescription'];
$description_type = $_POST['description_type'];
@@ -205,7 +200,6 @@ class CourseDescriptionController
$course_description->set_content($content);
$course_description->insert(api_get_course_int_id());
}
- Security::clear_token();
Display::addFlash(
Display::return_message(
diff --git a/main/course_description/index.php b/main/course_description/index.php
index 29d5888fd4..3beee9e3ee 100755
--- a/main/course_description/index.php
+++ b/main/course_description/index.php
@@ -34,29 +34,47 @@ if (isset($_GET['description_type'])) {
$id = null;
if (isset($_GET['id'])) {
- $id = intval($_GET['id']);
+ $id = intval($_GET['id']);
}
if (isset($_GET['isStudentView']) && $_GET['isStudentView'] == 'true') {
- $action = 'listing';
+ $action = 'listing';
}
// interbreadcrumb
-$interbreadcrumb[] = array ("url" => "index.php", "name" => get_lang('CourseProgram'));
-if ($description_type == 1) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('GeneralDescription'));
-if ($description_type == 2) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('Objectives'));
-if ($description_type == 3) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('Topics'));
-if ($description_type == 4) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('Methodology'));
-if ($description_type == 5) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('CourseMaterial'));
-if ($description_type == 6) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('HumanAndTechnicalResources'));
-if ($description_type == 7) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('Assessment'));
-if ($description_type == 8) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('ThematicAdvance'));
-if ($description_type >= 9) $interbreadcrumb[] = array ("url" => "#", "name" => get_lang('Others'));
+$interbreadcrumb[] = array ("url" => "index.php?".api_get_cidreq(), "name" => get_lang('CourseProgram'));
+if ($description_type == 1) {
+ $interbreadcrumb[] = array("url" => "#", "name" => get_lang('GeneralDescription'));
+}
+if ($description_type == 2) {
+ $interbreadcrumb[] = array("url" => "#", "name" => get_lang('Objectives'));
+}
+if ($description_type == 3) {
+ $interbreadcrumb[] = array("url" => "#", "name" => get_lang('Topics'));
+}
+if ($description_type == 4) {
+ $interbreadcrumb[] = array("url" => "#", "name" => get_lang('Methodology'));
+}
+if ($description_type == 5) {
+ $interbreadcrumb[] = array("url" => "#", "name" => get_lang('CourseMaterial'));
+}
+if ($description_type == 6) {
+ $interbreadcrumb[] = array("url" => "#", "name" => get_lang('HumanAndTechnicalResources'));
+}
+if ($description_type == 7) {
+ $interbreadcrumb[] = array("url" => "#", "name" => get_lang('Assessment'));
+}
+if ($description_type == 8) {
+ $interbreadcrumb[] = array("url" => "#", "name" => get_lang('ThematicAdvance'));
+}
+if ($description_type >= 9) {
+ $interbreadcrumb[] = array("url" => "#", "name" => get_lang('Others'));
+}
// course description controller object
$course_description_controller = new CourseDescriptionController();
-// distpacher actions to controller
+// Actions to controller
switch ($action) {
case 'listing':
$course_description_controller->listing();
diff --git a/main/coursecopy/classes/CourseRestorer.class.php b/main/coursecopy/classes/CourseRestorer.class.php
index e52c524911..db38a15123 100755
--- a/main/coursecopy/classes/CourseRestorer.class.php
+++ b/main/coursecopy/classes/CourseRestorer.class.php
@@ -1536,10 +1536,9 @@ class CourseRestorer
);
$params = [];
- if (!empty($session_id)) {
- $session_id = intval($session_id);
- $params['session_id'] = $session_id;
- }
+
+ $session_id = intval($session_id);
+ $params['session_id'] = $session_id;
$params['c_id'] = $this->destination_course_id;
$params['description_type'] = self::DBUTF8($descriptionType);
$params['title'] = self::DBUTF8($title);