Code Duplication    Length = 6-6 lines in 2 locations

admin/blocksadmin.php 2 locations

@@ 451-456 (lines=6) @@
448
            if (in_array(0, $bmodule)) {
449
                $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $GLOBALS['xoopsDB']->prefix('block_module_link'), $bid, 0);
450
                $GLOBALS['xoopsDB']->query($sql);
451
            } else {
452
                foreach ($bmodule as $bmid) {
453
                    $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $GLOBALS['xoopsDB']->prefix('block_module_link'), $bid, (int)$bmid);
454
                    $GLOBALS['xoopsDB']->query($sql);
455
                }
456
            }
457
        }
458
        $sql = sprintf('DELETE FROM %s WHERE gperm_itemid = %u', $GLOBALS['xoopsDB']->prefix('group_permission'), $bid);
459
        $GLOBALS['xoopsDB']->query($sql);
@@ 491-496 (lines=6) @@
488
                if (in_array(0, $bmodule[$i])) {
489
                    $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $GLOBALS['xoopsDB']->prefix('block_module_link'), $bid[$i], 0);
490
                    $GLOBALS['xoopsDB']->query($sql);
491
                } else {
492
                    foreach ($bmodule[$i] as $bmid) {
493
                        $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $GLOBALS['xoopsDB']->prefix('block_module_link'), $bid[$i], (int)$bmid);
494
                        $GLOBALS['xoopsDB']->query($sql);
495
                    }
496
                }
497
            }
498
            $sql = sprintf('DELETE FROM %s WHERE gperm_itemid = %u', $GLOBALS['xoopsDB']->prefix('group_permission'), $bid[$i]);
499
            $GLOBALS['xoopsDB']->query($sql);