Code Duplication    Length = 4-4 lines in 2 locations

include/blocksadmin.inc.php 2 locations

@@ 502-505 (lines=4) @@
499
    */
500
    $db      = XoopsDatabaseFactory::getDatabaseConnection();
501
    $bmodule = (isset($_POST['bmodule']) && is_array($_POST['bmodule'])) ? $_POST['bmodule'] : array(-1); // GIJ +
502
    foreach ($bmodule as $bmid) {
503
        $sql = 'INSERT INTO ' . $db->prefix('block_module_link') . " (block_id, module_id) VALUES ('{$newid}', '{$bmid}')";
504
        $db->query($sql);
505
    }
506
507
    /*  global $xoopsUser;
508
      $groups =& $xoopsUser->getGroups();
@@ 602-605 (lines=4) @@
599
        $db  = XoopsDatabaseFactory::getDatabaseConnection();
600
        $sql = sprintf('DELETE FROM %s WHERE block_id = %u', $db->prefix('block_module_link'), $bid);
601
        $db->query($sql);
602
        foreach ($bmodule as $bmid) {
603
            $sql = sprintf('INSERT INTO %s (block_id, module_id) VALUES (%u, %d)', $db->prefix('block_module_link'), $bid, (int)$bmid);
604
            $db->query($sql);
605
        }
606
        include_once XOOPS_ROOT_PATH . '/class/template.php';
607
        $xoopsTpl = new XoopsTpl();
608
        //$xoopsTpl->xoops_setCaching(2);