Code Duplication    Length = 18-20 lines in 2 locations

lib/midcom/helper/datamanager2/widget/images.php 2 locations

@@ 235-254 (lines=20) @@
232
        );
233
        $this->_elements['e_new_title'] = $this->_form->createElement('text', 'e_new_title', '', $attributes);
234
235
        if (! $frozen)
236
        {
237
            // Controls Column
238
            $html = "            </td>\n
239
                                <td class=\"new upload\">";
240
            $this->_elements['s_new_upload'] = $this->_form->createElement('static', 's_new_upload', '', $html);
241
            $attributes = Array
242
            (
243
                'class' => 'new file',
244
                'id'    => "{$this->_namespace}{$this->name}_e_new_file",
245
            );
246
            $this->_elements['e_new_file'] = $this->_form->createElement('file', 'e_new_file', '', $attributes);
247
            $attributes = Array
248
            (
249
                'class' => 'new upload',
250
                'id'    => "{$this->_namespace}{$this->name}_e_new_upload",
251
            );
252
253
            $this->_elements['e_new_upload'] = $this->_form->createElement('submit', "{$this->name}_e_new_upload", $this->_l10n->get('upload file'), $attributes);
254
        }
255
256
        $html = "            </td>\n
257
                         </tr>\n";
@@ 284-301 (lines=18) @@
281
        $html .= $this->_l10n->get('add new file') . ':';
282
        $this->_elements['s_new_filename'] = $this->_form->createElement('static', 's_new_filename', '', $html);
283
284
        if (! $frozen)
285
        {
286
            // Controls Column
287
            $html = "</td><td class=\"new upload\" colspan=\"2\">";
288
            $this->_elements['s_new_upload'] = $this->_form->createElement('static', 's_new_upload', '', $html);
289
            $attributes = Array
290
            (
291
                'class' => 'new file',
292
                'id'    => "{$this->_namespace}{$this->name}_e_new_file",
293
            );
294
            $this->_elements['e_new_file'] = $this->_form->createElement('file', 'e_new_file', '', $attributes);
295
            $attributes = Array
296
            (
297
                'class' => 'new upload',
298
                'id'    => "{$this->_namespace}{$this->name}_e_new_upload",
299
            );
300
            $this->_elements['e_new_upload'] = $this->_form->createElement('submit', "{$this->name}_e_new_upload", $this->_l10n->get('upload file'), $attributes);
301
        }
302
303
        $html = "            </td>\n
304
                         </tr>\n";