Code Duplication    Length = 10-12 lines in 3 locations

xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php 2 locations

@@ 382-392 (lines=11) @@
379
    if (defined('XOOPS_CUBE_LEGACY')) {
380
        $handler = xoops_gethandler('block');//add
381
    }
382
    while ($myrow = $this->db->fetchArray($result)) {
383
384
//HACK by domifara
385
        if (defined('XOOPS_CUBE_LEGACY')) {
386
            $block_one =& $handler->create(false) ;
387
            $block_one->assignVars($myrow);
388
            $block_arr[] =& $block_one ;
389
        } else {
390
            $block_arr[] = new XoopsBlock($myrow) ;
391
        }
392
    }
393
    if (empty($block_arr)) {
394
        return ;
395
    }
@@ 462-471 (lines=10) @@
459
    if (defined('XOOPS_CUBE_LEGACY')) {
460
        $handler = xoops_gethandler('block');//add
461
    }
462
        while ($myrow = $this->db->fetchArray($result)) {
463
            //HACK by domifara
464
        if (defined('XOOPS_CUBE_LEGACY')) {
465
            $block_one =& $handler->create(false) ;
466
            $block_one->assignVars($myrow);
467
            $block_arr[] =& $block_one ;
468
        } else {
469
            $block_arr[] = new XoopsBlock($myrow) ;
470
        }
471
        }
472
473
        $item_list = array() ;
474
        foreach (array_keys($block_arr) as $i) {

xoops_trust_path/libs/altsys/include/admin_in_theme_header.inc.php 1 location

@@ 147-158 (lines=12) @@
144
        $sql = 'SELECT b.* FROM '.$db->prefix('newblocks').' b, '.$db->prefix('block_module_link').' m WHERE m.block_id=b.bid AND b.isactive=1 AND b.visible=1 AND m.module_id=' . (int)$altsysModuleId
145
               . ' AND b.bid IN (' . implode(',', $blockids) . ') ORDER BY b.weight,b.bid' ;
146
        $result = $db->query($sql);
147
        while ($myrow = $db->fetchArray($result)) {
148
149
//HACK by domifara
150
            if (defined('XOOPS_CUBE_LEGACY')) {
151
                $block =& $handler->create(false) ;
152
                $block->assignVars($myrow);
153
            } else {
154
                $block = new XoopsBlock($myrow) ;
155
            }
156
157
            $block_arr[ $myrow['bid'] ] = $block ;
158
        }
159
    }
160
161
    $adminmenublock_exists = false ;