Use html editor instead of textarea in the course legal agreement.

pull/3944/head
Julio 4 years ago
parent 7f8b875ffc
commit 0b4406927a
  1. 3
      main/course_info/infocours.php
  2. 4
      main/course_info/legal.php

@ -288,7 +288,8 @@ $checkBoxActiveLegal = $form->createElement(
[null, get_lang('ShowALegalNoticeWhenEnteringTheCourse')], [null, get_lang('ShowALegalNoticeWhenEnteringTheCourse')],
get_lang('ActivateLegal') get_lang('ActivateLegal')
); );
$textAreaLegal = $form->createElement('textarea', 'legal', get_lang('CourseLegalAgreement'), ['rows' => 8]);
$textAreaLegal = $form->createElement('html_editor', 'legal', get_lang('CourseLegalAgreement'), ['rows' => 8]);
$elements = [ $elements = [
$groupElement, $groupElement,

@ -23,7 +23,7 @@ $enabled = api_get_plugin_setting('courselegal', 'tool_enable');
$pluginExtra = null; $pluginExtra = null;
$pluginLegal = false; $pluginLegal = false;
if ('true' == $enabled) { if ('true' === $enabled) {
$pluginLegal = true; $pluginLegal = true;
require_once api_get_path(SYS_PLUGIN_PATH).'courselegal/config.php'; require_once api_get_path(SYS_PLUGIN_PATH).'courselegal/config.php';
$plugin = CourseLegalPlugin::create(); $plugin = CourseLegalPlugin::create();
@ -64,7 +64,7 @@ if ($pluginLegal && isset($userData) && !empty($userData)) {
} }
} }
$form->addElement('header', get_lang('CourseLegalAgreement')); $form->addElement('header', get_lang('CourseLegalAgreement'));
$form->addElement('label', null, $course_legal); $form->addLabel(null, Security::remove_XSS($course_legal));
if ($pluginLegal && !empty($plugin)) { if ($pluginLegal && !empty($plugin)) {
$form->addElement('label', null, $plugin->getCurrentFile($course_info['real_id'], $session_id)); $form->addElement('label', null, $plugin->getCurrentFile($course_info['real_id'], $session_id));
} }

Loading…
Cancel
Save