Minor - Code styling

pull/2487/head
Yannick Warnier 8 years ago
parent 15ee732196
commit e852f34dc8
  1. 13
      main/inc/introductionSection.inc.php

@ -64,6 +64,7 @@ $form->addButtonSave(get_lang('SaveIntroText'), 'intro_cmdUpdate');
/* INTRODUCTION MICRO MODULE - COMMANDS SECTION (IF ALLOWED) */ /* INTRODUCTION MICRO MODULE - COMMANDS SECTION (IF ALLOWED) */
$course_id = api_get_course_int_id(); $course_id = api_get_course_int_id();
$moduleId = intval($moduleId);
if ($intro_editAllowed) { if ($intro_editAllowed) {
/* Replace command */ /* Replace command */
@ -108,11 +109,13 @@ if ($intro_editAllowed) {
/* Delete Command */ /* Delete Command */
if ($intro_cmdDel) { if ($intro_cmdDel) {
$sql = "DELETE FROM $TBL_INTRODUCTION $sql = "DELETE FROM $TBL_INTRODUCTION
WHERE WHERE
c_id = $course_id AND c_id = $course_id AND
id='".Database::escape_string($moduleId)."' AND id = $moduleId AND
session_id='".intval($session_id)."'"; session_id = $session_id";
Database::query($sql); Database::query($sql);
echo Display::return_message(get_lang('IntroductionTextDeleted'), 'confirmation'); echo Display::return_message(get_lang('IntroductionTextDeleted'), 'confirmation');
} }
@ -127,7 +130,7 @@ $intro_content = '';
$sql = "SELECT intro_text FROM $TBL_INTRODUCTION $sql = "SELECT intro_text FROM $TBL_INTRODUCTION
WHERE WHERE
c_id = $course_id AND c_id = $course_id AND
id = '".Database::escape_string($moduleId)."' AND id = $moduleId AND
session_id = 0"; session_id = 0";
$intro_dbQuery = Database::query($sql); $intro_dbQuery = Database::query($sql);
@ -141,8 +144,8 @@ if (!empty($session_id)) {
$sql = "SELECT intro_text FROM $TBL_INTRODUCTION $sql = "SELECT intro_text FROM $TBL_INTRODUCTION
WHERE WHERE
c_id = $course_id AND c_id = $course_id AND
id = '".Database::escape_string($moduleId)."' AND id = $moduleId AND
session_id = '".intval($session_id)."'"; session_id = $session_id";
$intro_dbQuery = Database::query($sql); $intro_dbQuery = Database::query($sql);
$introSessionContent = ''; $introSessionContent = '';
if (Database::num_rows($intro_dbQuery) > 0) { if (Database::num_rows($intro_dbQuery) > 0) {

Loading…
Cancel
Save