Code Duplication    Length = 3-4 lines in 4 locations

blocks/oledrion_categories.php 2 locations

@@ 49-51 (lines=3) @@
46
            $mytree         = new XoopsObjectTree($tbl_categories, 'cat_cid', 'cat_pid');
47
            $tblChilds      = $mytree->getAllChild($cat_cid);
48
            //$tblChilds = array_reverse($tblChilds);
49
            foreach ($tblChilds as $item) {
50
                $tbl_tmp[] = "<a href='" . $item->getLink() . "' title='" . Oledrion_utils::makeHrefTitle($item->getVar('cat_title')) . "'>" . $item->getVar('cat_title') . '</a>';
51
            }
52
            $block['block_categories'] = $tbl_tmp;
53
54
            $category = null;
@@ 66-68 (lines=3) @@
63
            $criteria       = new Criteria('cat_pid', 0, '=');
64
            $criteria->setSort('cat_title');
65
            $tbl_categories = $h_oledrion_cat->getObjects($criteria, true);
66
            foreach ($tbl_categories as $item) {
67
                $tbl_tmp[] = "<a href='" . $item->getLink() . "' title='" . Oledrion_utils::makeHrefTitle($item->getVar('cat_title')) . "'>" . $item->getVar('cat_title') . '</a>';
68
            }
69
            $block['block_categories'] = $tbl_tmp;
70
        }
71
    } elseif ((int)$options[0] == 1) { // Affichage classique

category.php 1 location

@@ 210-212 (lines=3) @@
207
    $ancestors = $mytree->getAllParent($cat_cid);
208
    $ancestors = array_reverse($ancestors);
209
    $tbl_tmp[] = "<a href='" . OLEDRION_URL . "index.php' title='" . Oledrion_utils::makeHrefTitle(Oledrion_utils::getModuleName()) . "'>" . Oledrion_utils::getModuleName() . '</a>';
210
    foreach ($ancestors as $item) {
211
        $tbl_tmp[] = "<a href='" . $item->getLink() . "' title='" . Oledrion_utils::makeHrefTitle($item->getVar('cat_title')) . "'>" . $item->getVar('cat_title') . '</a>';
212
    }
213
    // Ajout de la catégorie courante
214
    $tbl_tmp[]  = "<a href='" . $category->getLink() . "' title='" . Oledrion_utils::makeHrefTitle($category->getVar('cat_title')) . "'>" . $category->getVar('cat_title') . '</a>';
215
    $breadcrumb = implode(' &raquo; ', $tbl_tmp);

product.php 1 location

@@ 336-339 (lines=4) @@
333
        $tbl_ancestors = $mytree->getAllParent($product->getVar('product_cid'));
334
        $tbl_ancestors = array_reverse($tbl_ancestors);
335
        $tbl_tmp[]     = "<a href='" . OLEDRION_URL . "index.php' title='" . Oledrion_utils::makeHrefTitle(Oledrion_utils::getModuleName()) . "'>" . Oledrion_utils::getModuleName() . '</a>';
336
        foreach ($tbl_ancestors as $item) {
337
            $tbl_tmp[] = "<a href='" . $item->getLink() . "' title='" . Oledrion_utils::makeHrefTitle($item->getVar('cat_title')) . "'>" . $item->getVar('cat_title') . '</a>';
338
        }
339
        // Ajout de la catégorie courante
340
        $tbl_tmp[]  = "<a href='" . $product_category->getLink() . "' title='" . Oledrion_utils::makeHrefTitle($product_category->getVar('cat_title')) . "'>" . $product_category->getVar('cat_title') . '</a>';
341
        $tbl_tmp[]  = $product->getVar('product_title');
342
        $breadcrumb = implode(' &raquo; ', $tbl_tmp);