Code Duplication    Length = 13-13 lines in 2 locations

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

@@ 660-672 (lines=13) @@
657
        $form->addElement('hidden', 'type', $this->type);
658
        $form->addElement('hidden', 'field_id', $this->fieldId);
659
660
        if ($action == 'edit') {
661
            $translateUrl = api_get_path(WEB_CODE_PATH).'extrafield/translate.php?'.http_build_query([
662
                'extra_field_option' => $id
663
            ]);
664
            $translateButton = Display::toolbarButton(
665
                get_lang('TranslateThisTerm'),
666
                $translateUrl,
667
                'language',
668
                'link'
669
            );
670
671
            $form->addText(
672
                'display_text',
673
                [get_lang('Name'), $translateButton]
674
            );
675
        } else {

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

@@ 2155-2167 (lines=13) @@
2152
2153
        $form->addElement('header', $header);
2154
2155
        if ($action == 'edit') {
2156
            $translateUrl = api_get_path(WEB_CODE_PATH).'extrafield/translate.php?'
2157
                .http_build_query(['extra_field' => $id]);
2158
            $translateButton = Display::toolbarButton(get_lang('TranslateThisTerm'), $translateUrl, 'language', 'link');
2159
2160
            $form->addText(
2161
                'display_text',
2162
                [get_lang('Name'), $translateButton]
2163
            );
2164
        } else {
2165
            $form->addElement('text', 'display_text', get_lang('Name'));
2166
        }
2167
2168
        // Field type
2169
        $types = self::get_field_types();
2170