Code Duplication    Length = 17-19 lines in 2 locations

application/modules/admin/components.php 2 locations

@@ 555-573 (lines=19) @@
552
            $mid = $this->input->post('mid');
553
            $row = $this->db->where('id', $mid)->get('components')->row();
554
555
            if (count($row) > 0) {
556
                $enabled = $row->enabled;
557
                if ($enabled) {
558
                    $enabled = 0;
559
                    $status = lang('Disable', 'admin');
560
                } else {
561
                    $enabled = 1;
562
                    $status = lang('Enable', 'admin');
563
                }
564
565
                $this->db->where('id', $mid)->set('enabled', $enabled)->update('components');
566
567
                $row->enabled = $enabled;
568
                $nameModule = $this->get_module_info($row->identif)['menu_name'];
569
570
                $message = lang('Change URL access. Module : ', 'admin') . ' '
571
                    . $nameModule . '. ' . lang('Status', 'admin') . ' : ' . $status . '.';
572
                $this->lib_admin->log($message);
573
            }
574
        }
575
    }
576
@@ 580-596 (lines=17) @@
577
    public function change_show_in_menu() {
578
        $id = $this->input->post('id');
579
        $row = $this->db->where('id', (int) $id)->get('components')->row();
580
        if (count($row) > 0) {
581
            $in_menu = $row->in_menu;
582
            if ($in_menu == 1) {
583
                $in_menu = 0;
584
                $status = lang('Disable', 'admin');
585
            } else {
586
                $in_menu = 1;
587
                $status = lang('Enable', 'admin');
588
            }
589
            $this->db->where('id', (int) $id)->set('in_menu', $in_menu)->update('components');
590
591
            $nameModule = $this->get_module_info($row->identif)['menu_name'];
592
593
            $message = lang('Change Show in menu. Module : ', 'admin') . ' '
594
                . $nameModule . '. ' . lang('Status', 'admin') . ' : ' . $status . '.';
595
            $this->lib_admin->log($message);
596
        }
597
    }
598
599
    public function save_components_positions() {