Code Duplication    Length = 4-9 lines in 2 locations

main/inc/introductionSection.inc.php 1 location

@@ 46-54 (lines=9) @@
43
$intro_cmdAdd = empty($_GET['intro_cmdAdd']) ? '' : $_GET['intro_cmdAdd'];
44
$courseId = api_get_course_id();
45
46
if (!empty($courseId)) {
47
    $form = new FormValidator(
48
        'introduction_text',
49
        'post',
50
        api_get_self().'?'.api_get_cidreq()
51
    );
52
} else {
53
    $form = new FormValidator('introduction_text');
54
}
55
56
$config = array(
57
    'ToolbarSet' => 'IntroductionTool',

main/inc/lib/document.lib.php 1 location

@@ 5154-5157 (lines=4) @@
5151
        }
5152
5153
        $attributes = [];
5154
        if (empty($form)) {
5155
            $form = new FormValidator('selector', 'GET', api_get_self().'?'.api_get_cidreq());
5156
            $attributes = array('onchange' => 'javascript: document.selector.submit();');
5157
        }
5158
        $form->addElement('hidden', 'cidReq', api_get_course_id());
5159
        $parent_select = $form->addSelect(
5160
            $selectName,