Code Duplication    Length = 30-30 lines in 2 locations

xoops_trust_path/libs/altsys/class/MyBlocksAdmin.class.php 1 location

@@ 617-646 (lines=30) @@
614
    }
615
616
617
    public function fetchRequest4Block($bid)
618
    {
619
        $bid = (int)$bid;
620
        (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance() ;
621
622
        if (@$_POST['extra_sides'][$bid] > 0) {
623
            $_POST['sides'][$bid] = (int)$_POST['extra_sides'][$bid];
624
        }
625
626
        if (@$_POST['sides'][$bid] < 0) {
627
            $visible = 0 ;
628
            $_POST['sides'][$bid] = -1 ;
629
        } else {
630
            $visible = 1 ;
631
        }
632
633
        return array(
634
        'bid' => $bid ,
635
            'side' => (int)(@$_POST['sides'][$bid]),
636
            'weight' => (int)(@$_POST['weights'][$bid]),
637
        'visible' => $visible ,
638
        'title' => $myts->stripSlashesGPC(@$_POST['titles'][$bid]) ,
639
        'content' => $myts->stripSlashesGPC(@$_POST['contents'][$bid]) ,
640
        'ctype' => preg_replace('/[^A-Z]/', '', @$_POST['ctypes'][$bid]) ,
641
            'bcachetime' => (int)(@$_POST['bcachetimes'][$bid]),
642
        'bmodule' => is_array(@$_POST['bmodules'][$bid]) ? $_POST['bmodules'][$bid] : array( 0 ) ,
643
        'bgroup' => is_array(@$_POST['bgroups'][$bid]) ? $_POST['bgroups'][$bid] : array() ,
644
        'options' => is_array(@$_POST['options'][$bid]) ? $_POST['options'][$bid] : array()
645
    ) ;
646
    }
647
648
649
    public function do_delete($bid)

xoops_trust_path/libs/altsys/class/MyBlocksAdminForX25.class.php 1 location

@@ 283-312 (lines=30) @@
280
281
        return ;
282
    }
283
    public function fetchRequest4Block($bid)
284
    {
285
        $bid = (int)$bid;
286
        (method_exists('MyTextSanitizer', 'sGetInstance') and $myts =& MyTextSanitizer::sGetInstance()) || $myts = MyTextSanitizer::getInstance() ;
287
288
        if (@$_POST['extra_sides'][$bid] > 0) {
289
            $_POST['sides'][$bid] = (int)$_POST['extra_sides'][$bid];
290
        }
291
292
        if (@$_POST['sides'][$bid] < 0) {
293
            $visible = 0 ;
294
            $_POST['sides'][$bid] = -1 ;
295
        } else {
296
            $visible = 1 ;
297
        }
298
299
        return array(
300
        'bid' => $bid ,
301
            'side' => (int)(@$_POST['sides'][$bid]),
302
            'weight' => (int)(@$_POST['weights'][$bid]),
303
        'visible' => $visible ,
304
        'title' => $myts->stripSlashesGPC(@$_POST['titles'][$bid]) ,
305
        'content' => $myts->stripSlashesGPC(@$_POST['textarea_content']) ,
306
        'ctype' => preg_replace('/[^A-Z]/', '', @$_POST['ctypes'][$bid]) ,
307
            'bcachetime' => (int)(@$_POST['bcachetimes'][$bid]),
308
        'bmodule' => is_array(@$_POST['bmodules'][$bid]) ? $_POST['bmodules'][$bid] : array( 0 ) ,
309
        'bgroup' => is_array(@$_POST['bgroups'][$bid]) ? $_POST['bgroups'][$bid] : array() ,
310
        'options' => is_array(@$_POST['options'][$bid]) ? $_POST['options'][$bid] : array()
311
    ) ;
312
    }
313
314
    public function previewContent($block_data)
315
    {