Code Duplication    Length = 9-9 lines in 6 locations

admin/actions/categories.php 1 location

@@ 159-167 (lines=9) @@
156
            $sform->addElement(new XoopsFormLabel(_AM_OLEDRION_PARENT_CATEG, $select_categ), false);
157
        }
158
159
        if ($action === 'edit' && $item->pictureExists()) {
160
            $pictureTray = new XoopsFormElementTray(_AM_OLEDRION_CURRENT_PICTURE, '<br>');
161
            $pictureTray->addElement(new XoopsFormLabel('', "<img src='" . $item->getPictureUrl() . "' alt='' border='0'>"));
162
            $deleteCheckbox = new XoopsFormCheckBox('', 'delpicture');
163
            $deleteCheckbox->addOption(1, _DELETE);
164
            $pictureTray->addElement($deleteCheckbox);
165
            $sform->addElement($pictureTray);
166
            unset($pictureTray, $deleteCheckbox);
167
        }
168
        $sform->addElement(new XoopsFormFile(_AM_OLEDRION_PICTURE, 'attachedfile', OledrionUtility::getModuleOption('maxuploadsize')), false);
169
        $editor = OledrionUtility::getWysiwygForm(_AM_OLEDRION_DESCRIPTION, 'cat_description', $item->getVar('cat_description', 'e'), 15, 60, 'description_hidden');
170
        if ($editor) {

admin/actions/delivery.php 1 location

@@ 123-131 (lines=9) @@
120
        $paymentSelect->setDescription(_AM_OLEDRION_SELECT_HLP);
121
        $sform->addElement($paymentSelect, true);
122
123
        if ($action === 'edit' && $item->pictureExists()) {
124
            $pictureTray = new XoopsFormElementTray(_AM_OLEDRION_CURRENT_PICTURE, '<br>');
125
            $pictureTray->addElement(new XoopsFormLabel('', "<img src='" . $item->getPictureUrl() . "' alt='' border='0'>"));
126
            $deleteCheckbox = new XoopsFormCheckBox('', 'delpicture');
127
            $deleteCheckbox->addOption(1, _DELETE);
128
            $pictureTray->addElement($deleteCheckbox);
129
            $sform->addElement($pictureTray);
130
            unset($pictureTray, $deleteCheckbox);
131
        }
132
        $sform->addElement(new XoopsFormFile(_AM_OLEDRION_PICTURE, 'attachedfile', OledrionUtility::getModuleOption('maxuploadsize')), false);
133
        $editor = OledrionUtility::getWysiwygForm(_AM_OLEDRION_DESCRIPTION, 'delivery_description', $item->getVar('delivery_description', 'e'), 15, 60, 'description_hidden');
134
        if ($editor) {

admin/actions/packing.php 1 location

@@ 98-106 (lines=9) @@
95
        $sform->addElement(new XoopsFormText(_AM_OLEDRION_PACKING_WIDTH, 'packing_width', 20, 20, $item->getVar('packing_width', 'e')), false);
96
        $sform->addElement(new XoopsFormText(_AM_OLEDRION_PACKING_LENGTH, 'packing_length', 20, 20, $item->getVar('packing_length', 'e')), false);
97
        $sform->addElement(new XoopsFormText(_AM_OLEDRION_PACKING_WEIGHT, 'packing_weight', 20, 20, $item->getVar('packing_weight', 'e')), false);
98
        if ($action === 'edit' && $item->pictureExists()) {
99
            $pictureTray = new XoopsFormElementTray(_AM_OLEDRION_CURRENT_PICTURE, '<br>');
100
            $pictureTray->addElement(new XoopsFormLabel('', "<img src='" . $item->getPictureUrl() . "' alt='' border='0'>"));
101
            $deleteCheckbox = new XoopsFormCheckBox('', 'delpicture');
102
            $deleteCheckbox->addOption(1, _DELETE);
103
            $pictureTray->addElement($deleteCheckbox);
104
            $sform->addElement($pictureTray);
105
            unset($pictureTray, $deleteCheckbox);
106
        }
107
        $sform->addElement(new XoopsFormFile(_AM_OLEDRION_PICTURE, 'attachedfile', OledrionUtility::getModuleOption('maxuploadsize')), false);
108
        $editor = OledrionUtility::getWysiwygForm(_AM_OLEDRION_DESCRIPTION, 'packing_description', $item->getVar('packing_description', 'e'), 15, 60, 'description_hidden');
109
        if ($editor) {

admin/actions/payment.php 1 location

@@ 111-119 (lines=9) @@
108
            $payment_gateway->addOption($payment_gateway_item);
109
        }
110
        $sform->addElement($payment_gateway, true);
111
        if ($action === 'edit' && $item->pictureExists()) {
112
            $pictureTray = new XoopsFormElementTray(_AM_OLEDRION_CURRENT_PICTURE, '<br>');
113
            $pictureTray->addElement(new XoopsFormLabel('', "<img src='" . $item->getPictureUrl() . "' alt='' border='0'>"));
114
            $deleteCheckbox = new XoopsFormCheckBox('', 'delpicture');
115
            $deleteCheckbox->addOption(1, _DELETE);
116
            $pictureTray->addElement($deleteCheckbox);
117
            $sform->addElement($pictureTray);
118
            unset($pictureTray, $deleteCheckbox);
119
        }
120
        $sform->addElement(new XoopsFormFile(_AM_OLEDRION_PICTURE, 'attachedfile', OledrionUtility::getModuleOption('maxuploadsize')), false);
121
        $editor = OledrionUtility::getWysiwygForm(_AM_OLEDRION_DESCRIPTION, 'payment_description', $item->getVar('payment_description', 'e'), 15, 60, 'description_hidden');
122
        if ($editor) {

admin/actions/products.php 2 locations

@@ 462-470 (lines=9) @@
459
        $sform->addElement(new XoopsFormText(_AM_OLEDRION_URL_HLP3, 'product_url3', 50, 255, $item->getVar('product_url3', 'e')), false);
460
461
        // Images *************************************************************
462
        if ($action === 'edit' && $item->pictureExists()) {
463
            $pictureTray = new XoopsFormElementTray(_AM_OLEDRION_IMAGE1_HELP, '<br>');
464
            $pictureTray->addElement(new XoopsFormLabel('', "<img src='" . $item->getPictureUrl() . "' alt='' border='0'>"));
465
            $deleteCheckbox = new XoopsFormCheckBox('', 'delpicture1');
466
            $deleteCheckbox->addOption(1, _DELETE);
467
            $pictureTray->addElement($deleteCheckbox);
468
            $sform->addElement($pictureTray);
469
            unset($pictureTray, $deleteCheckbox);
470
        }
471
        $sform->addElement(new XoopsFormFile(_AM_OLEDRION_IMAGE1_CHANGE, 'attachedfile1', OledrionUtility::getModuleOption('maxuploadsize')), false);
472
473
        if (!OledrionUtility::getModuleOption('create_thumbs')) { // L'utilisateur se charge de créer la vignette lui même
@@ 474-482 (lines=9) @@
471
        $sform->addElement(new XoopsFormFile(_AM_OLEDRION_IMAGE1_CHANGE, 'attachedfile1', OledrionUtility::getModuleOption('maxuploadsize')), false);
472
473
        if (!OledrionUtility::getModuleOption('create_thumbs')) { // L'utilisateur se charge de créer la vignette lui même
474
            if ($action === 'edit' && $item->thumbExists()) {
475
                $pictureTray = new XoopsFormElementTray(_AM_OLEDRION_IMAGE2_HELP, '<br>');
476
                $pictureTray->addElement(new XoopsFormLabel('', "<img src='" . $item->getThumbUrl() . "' alt='' border='0'>"));
477
                $deleteCheckbox = new XoopsFormCheckBox('', 'delpicture2');
478
                $deleteCheckbox->addOption(1, _DELETE);
479
                $pictureTray->addElement($deleteCheckbox);
480
                $sform->addElement($pictureTray);
481
                unset($pictureTray, $deleteCheckbox);
482
            }
483
            $sform->addElement(new XoopsFormFile(_AM_OLEDRION_IMAGE2_CHANGE, 'attachedfile2', OledrionUtility::getModuleOption('maxuploadsize')), false);
484
        }
485