Code Duplication    Length = 17-19 lines in 2 locations

application/modules/admin/components.php 2 locations

@@ 579-597 (lines=19) @@
576
            $mid = $this->input->post('mid');
577
            $row = $this->db->where('id', $mid)->get('components')->row();
578
579
            if (count($row) > 0) {
580
                $enabled = $row->enabled;
581
                if ($enabled) {
582
                    $enabled = 0;
583
                    $status = lang('Disable', 'admin');
584
                } else {
585
                    $enabled = 1;
586
                    $status = lang('Enable', 'admin');
587
                }
588
589
                $this->db->where('id', $mid)->set('enabled', $enabled)->update('components');
590
591
                $row->enabled = $enabled;
592
                $nameModule = $this->get_module_info($row->identif)['menu_name'];
593
594
                $message = lang('Change URL access. Module : ', 'admin') . ' '
595
                    . $nameModule . '. ' . lang('Status', 'admin') . ' : ' . $status . '.';
596
                $this->lib_admin->log($message);
597
            }
598
        }
599
    }
600
@@ 604-620 (lines=17) @@
601
    public function change_show_in_menu() {
602
        $id = $this->input->post('id');
603
        $row = $this->db->where('id', (int) $id)->get('components')->row();
604
        if (count($row) > 0) {
605
            $in_menu = $row->in_menu;
606
            if ($in_menu == 1) {
607
                $in_menu = 0;
608
                $status = lang('Disable', 'admin');
609
            } else {
610
                $in_menu = 1;
611
                $status = lang('Enable', 'admin');
612
            }
613
            $this->db->where('id', (int) $id)->set('in_menu', $in_menu)->update('components');
614
615
            $nameModule = $this->get_module_info($row->identif)['menu_name'];
616
617
            $message = lang('Change Show in menu. Module : ', 'admin') . ' '
618
                . $nameModule . '. ' . lang('Status', 'admin') . ' : ' . $status . '.';
619
            $this->lib_admin->log($message);
620
        }
621
    }
622
623
    public function save_components_positions() {