Code Duplication    Length = 6-13 lines in 4 locations

main/course_progress/thematic.php 1 location

@@ 193-203 (lines=11) @@
190
        $form->addElement('hidden', 'thematic_id', $thematic_id);
191
    }
192
193
    if (api_get_configuration_value('save_titles_as_html')) {
194
        $form->addHtmlEditor(
195
            'title',
196
            get_lang('Title'),
197
            true,
198
            false,
199
            ['ToolbarSet' => 'Minimal']
200
        );
201
    } else {
202
        $form->addText('title', get_lang('Title'), true, array('size' => '50'));
203
    }
204
    $form->addHtmlEditor('content', get_lang('Content'), false, false, array('ToolbarSet' => 'TrainingDescription', 'Height' => '150'));
205
    $form->addButtonSave(get_lang('Save'));
206

main/exercise/question.class.php 1 location

@@ 1564-1569 (lines=6) @@
1561
        </script>';
1562
1563
        // question name
1564
        if (api_get_configuration_value('save_titles_as_html')) {
1565
            $editorConfig = ['ToolbarSet' => 'Minimal'];
1566
            $form->addHtmlEditor('questionName', get_lang('Question'), false, false, $editorConfig, true);
1567
        } else {
1568
            $form->addElement('text', 'questionName', get_lang('Question'));
1569
        }
1570
1571
        $form->addRule('questionName', get_lang('GiveQuestion'), 'required');
1572

main/exercise/ReadingComprehension.php 1 location

@@ 150-162 (lines=13) @@
147
        $form->addElement('hidden', 'answerType', READING_COMPREHENSION);
148
        $form->addTextarea('questionDescription', get_lang('Text'), ['rows' => 20]);
149
        // question name
150
        if (api_get_configuration_value('save_titles_as_html')) {
151
            $editorConfig = ['ToolbarSet' => 'Minimal'];
152
            $form->addHtmlEditor(
153
                'questionName',
154
                get_lang('Question'),
155
                false,
156
                false,
157
                $editorConfig,
158
                true
159
            );
160
        } else {
161
            $form->addText('questionName', get_lang('Question'), false);
162
        }
163
164
        // hidden values
165
        $my_id = isset($_REQUEST['myid']) ? intval($_REQUEST['myid']) : null;

main/lp/lp_add_category.php 1 location

@@ 34-44 (lines=11) @@
31
$form->addElement('header', null, get_lang('AddLPCategory'));
32
33
// Title
34
if (api_get_configuration_value('save_titles_as_html')) {
35
    $form->addHtmlEditor(
36
        'name',
37
        get_lang('Name'),
38
        true,
39
        false,
40
        ['ToolbarSet' => 'Minimal']
41
    );
42
} else {
43
    $form->addText('name', get_lang('Name'), true);
44
}
45
46
$form->addElement('hidden', 'action', 'add_lp_category');
47
$form->addElement('hidden', 'c_id', api_get_course_int_id());