Code Duplication    Length = 17-17 lines in 2 locations

admin/controller/blog/post.php 1 location

@@ 882-898 (lines=17) @@
879
        $data['type'] = $type;
880
881
        switch ($type) {
882
            case 'category':
883
                $data['text_all'] = $this->language->get('entry_all_category');
884
885
                $this->load->model('blog/category');
886
887
                $categories = $this->model_blog_post->getPostCategories($this->request->get['post_id']);
888
889
                foreach ($categories as $category_id) {
890
                    $category_info = $this->model_blog_category->getCategory($category_id);
891
892
                    if ($category_info) {
893
                        $data['applied'][] = $category_info['category_id'];
894
                    }
895
                }
896
897
                $data['all'] = $this->model_blog_category->getCategories();
898
                break;
899
            case 'tag':
900
                $data['text_all'] = $this->language->get('entry_all_tags');
901

admin/controller/catalog/product.php 1 location

@@ 1703-1719 (lines=17) @@
1700
1701
                $data['all'] = $this->model_catalog_manufacturer->getManufacturers();
1702
                break;
1703
            case 'category':
1704
                $data['text_all'] = $this->language->get('entry_all_category');
1705
1706
                $this->load->model('catalog/category');
1707
1708
                $categories = $this->model_catalog_product->getProductCategories($this->request->get['product_id']);
1709
1710
                foreach ($categories as $category_id) {
1711
                    $category_info = $this->model_catalog_category->getCategory($category_id);
1712
1713
                    if ($category_info) {
1714
                        $data['applied'][] = $category_info['category_id'];
1715
                    }
1716
                }
1717
1718
                $data['all'] = $this->model_catalog_category->getCategories();
1719
                break;
1720
            case 'tag':
1721
                $data['text_all'] = $this->language->get('entry_all_tags');
1722