Code Duplication    Length = 6-6 lines in 3 locations

application/modules/gallery/admin.php 2 locations

@@ 383-388 (lines=6) @@
380
                        'description' => trim($this->input->post('description')),
381
                       ];
382
383
        if ($this->db->where('id', $id)->where('locale', $locale)->get('gallery_albums_i18n')->num_rows()) {
384
            $this->db->where('id', $id)->where('locale', $locale);
385
            $this->db->update('gallery_albums_i18n', $data_locale);
386
        } else {
387
            $this->db->insert('gallery_albums_i18n', $data_locale);
388
        }
389
390
        $album = $this->gallery_m->get_album($id);
391
@@ 811-816 (lines=6) @@
808
                            'description' => trim($this->input->post('description')),
809
                           ];
810
811
            if ($this->db->where('id', $id)->where('locale', $locale)->get('gallery_category_i18n')->num_rows()) {
812
                $this->db->where('id', $id)->where('locale', $locale);
813
                $this->db->update('gallery_category_i18n', $data_locale);
814
            } else {
815
                $this->db->insert('gallery_category_i18n', $data_locale);
816
            }
817
818
            $this->lib_admin->log(lang('Gallery category was edited', 'gallery') . '. Id: ' . $id);
819
            showMessage(lang('Changes have been saved', 'gallery'));

application/modules/cmsemail/models/cmsemail_model.php 1 location

@@ 173-178 (lines=6) @@
170
                        'admin_message' => $data['admin_message'],
171
                        'description'   => $data['description'],
172
                       ];
173
        if ($this->db->where('id', $id)->where('locale', $locale)->get('mod_email_paterns_i18n')->num_rows()) {
174
            $this->db->where('id', $id)->where('locale', $locale)->update('mod_email_paterns_i18n', $data_locale);
175
        } else {
176
            $data_locale['variables'] = '';
177
            $this->db->insert('mod_email_paterns_i18n', $data_locale);
178
        }
179
    }
180
181
    /**