Code Duplication    Length = 4-4 lines in 4 locations

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

@@ 482-485 (lines=4) @@
479
                $file['type'] = $this->_extension_to_mimetype($extension, $file['type']);
480
            }
481
482
            if (! $this->_type->add_attachment($identifier, $filename, $title, $file['type'], $file['tmp_name']))
483
            {
484
                debug_add("Failed to add an attachment to the field '{$this->name}'. Ignoring silently.", MIDCOM_LOG_WARN);
485
            }
486
        }
487
    }
488
@@ 532-535 (lines=4) @@
529
                $title = $file['name'];
530
            }
531
532
            if (! $this->_type->update_attachment($identifier, $file['name'], $title, $file['type'], $file['tmp_name']))
533
            {
534
                debug_add("Failed to update the attachment {$identifier} on the field '{$this->name}'. Ignoring silently.", MIDCOM_LOG_WARN);
535
            }
536
        }
537
        else if (   array_key_exists("e_exist_{$identifier}_title", $values)
538
                 && $values["e_exist_{$identifier}_title"] != $this->_type->attachments_info[$identifier]['description'])

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

@@ 580-583 (lines=4) @@
577
            $filename = $file['name'];
578
        }
579
580
        if (! $this->_type->add_image($filename, $file['tmp_name'], $title))
581
        {
582
            debug_add("Failed to add an attachment to the field '{$this->name}'. Ignoring silently.", MIDCOM_LOG_WARN);
583
        }
584
    }
585
586
    /**
@@ 628-631 (lines=4) @@
625
                    $title = $filename;
626
                }
627
628
                if (! $this->_type->update_image($identifier, $filename, $file['tmp_name'], $title))
629
                {
630
                    debug_add("Failed to update the image {$identifier} on the field '{$this->name}'. Ignoring silently.", MIDCOM_LOG_WARN);
631
                }
632
                break;
633
        }
634
    }