Code Duplication    Length = 11-11 lines in 2 locations

viewpost.php 1 location

@@ 429-439 (lines=11) @@
426
$xoopsTpl->assign('unread_link', $unread_link);
427
428
$viewmode_options = [];
429
if ('DESC' === $order) {
430
    $viewmode_options[] = [
431
        'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?viewmode=flat&order=ASC&forum=' . $forum_id,
432
        'title' => _OLDESTFIRST
433
    ];
434
} else {
435
    $viewmode_options[] = [
436
        'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname') . '/viewpost.php?viewmode=flat&order=DESC&forum=' . $forum_id,
437
        'title' => _NEWESTFIRST
438
    ];
439
}
440
441
//$xoopsTpl->assign('viewmode_compact', ($viewmode=="compact")?1:0);
442
$xoopsTpl->assign_by_ref('viewmode_options', $viewmode_options);

viewtopic.php 1 location

@@ 704-714 (lines=11) @@
701
                  ]);
702
703
$viewmode_options = [];
704
if ('DESC' === $order) {
705
    $viewmode_options[] = [
706
        'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=ASC&status=$status&topic_id=' . $topic_id,
707
        'title' => _OLDESTFIRST
708
    ];
709
} else {
710
    $viewmode_options[] = [
711
        'link'  => XOOPS_URL . '/modules/' . $xoopsModule->getVar('dirname', 'n') . '/viewtopic.php?order=DESC&status=$status&topic_id=' . $topic_id,
712
        'title' => _NEWESTFIRST
713
    ];
714
}
715
716
switch ($status) {
717
    case 'active':