Code Duplication    Length = 15-16 lines in 2 locations

class/EventHandler.php 2 locations

@@ 1169-1183 (lines=15) @@
1166
        }
1167
1168
        // Description
1169
        if (class_exists('XoopsFormEditor')) {
1170
            $options['name']   = 'event_desc';
1171
            $options['value']  = $desc;
1172
            $options['rows']   = 5;
1173
            $options['cols']   = '100%';
1174
            $options['width']  = '100%';
1175
            $options['height'] = '200px';
1176
            if ($isAdmin) {
1177
                $descEditor = new \XoopsFormEditor(_MD_EXTCAL_DESCRIPTION, $xoopsModuleConfig['editorAdmin'], $options, $nohtml = false, $onfailure = 'textarea');
1178
            } else {
1179
                $descEditor = new \XoopsFormEditor(_MD_EXTCAL_DESCRIPTION, $xoopsModuleConfig['editorUser'], $options, $nohtml = false, $onfailure = 'textarea');
1180
            }
1181
        } else {
1182
            $descEditor = new \XoopsFormDhtmlTextArea(_MD_EXTCAL_DESCRIPTION, 'event_desc', $desc, '100%', '100%');
1183
        }
1184
        $form->addElement($descEditor);
1185
1186
        // Max registered member for this event
@@ 1209-1224 (lines=16) @@
1206
        $form->addElement( new \XoopsFormText(_MD_EXTCAL_EMAIL, 'event_email', 80, 255, $email), false);
1207
1208
        // Address
1209
        if (class_exists('XoopsFormEditor')) {
1210
            $options['name']   = 'event_address';
1211
            $options['value']  = $event_address;
1212
            $options['rows']   = 5;
1213
            $options['cols']   = '100%';
1214
            $options['width']  = '100%';
1215
            $options['height'] = '200px';
1216
            if ($isAdmin) {
1217
                $addressEditor = new \XoopsFormEditor(_MD_EXTCAL_DESCRIPTION, $xoopsModuleConfig['editorAdmin'], $options, $nohtml = false, $onfailure = 'textarea');
1218
            } else {
1219
                $addressEditor = new \XoopsFormEditor(_MD_EXTCAL_DESCRIPTION, $xoopsModuleConfig['editorUser'], $options, $nohtml = false, $onfailure = 'textarea');
1220
            }
1221
        } else {
1222
            $addressEditor = new \XoopsFormDhtmlTextArea(_MD_EXTCAL_DESCRIPTION, 'event_address', $event_address, '100%', '100%');
1223
        }
1224
        $form->addElement($addressEditor);
1225
1226
        // Recurence form
1227
        $form->addElement(new Extcal\Form\FormRecurRules($reccurOptions));