Code Duplication    Length = 23-26 lines in 2 locations

class/Utility.php 1 location

@@ 760-785 (lines=26) @@
757
     * @param string $article
758
     * @param string $topic
759
     */
760
public static function createPageTitle($article = '', $topic = '')
761
{
762
    global $xoopsModule, $xoopsTpl;
763
    $myts    = MyTextSanitizer::getInstance();
764
    $content = '';
765
    if (!empty($article)) {
766
        $content .= strip_tags($myts->displayTarea($article));
767
    }
768
    if (!empty($topic)) {
769
        if (xoops_trim($content) != '') {
770
            $content .= ' - ' . strip_tags($myts->displayTarea($topic));
771
        } else {
772
            $content .= strip_tags($myts->displayTarea($topic));
773
        }
774
    }
775
    if (is_object($xoopsModule) && xoops_trim($xoopsModule->name()) != '') {
776
        if (xoops_trim($content) != '') {
777
            $content .= ' - ' . strip_tags($myts->displayTarea($xoopsModule->name()));
778
        } else {
779
            $content .= strip_tags($myts->displayTarea($xoopsModule->name()));
780
        }
781
    }
782
    if ($content != '') {
783
        $xoopsTpl->assign('xoops_pagetitle', $content);
784
    }
785
}
786
787
    // clear descriptions
788
    /**

include/functions.php 1 location

@@ 500-522 (lines=23) @@
497
}
498
499
// Create pagetitles
500
function lx_create_pagetitle($article='', $topic='') {
501
    global $xoopsModule, $xoopsTpl;
502
    $myts = MyTextSanitizer::getInstance();
503
    $content='';
504
    if (!empty($article)) $content .= strip_tags($myts->displayTarea($article));
505
    if (!empty($topic)) {
506
        if (xoops_trim($content)!='') {
507
            $content .= ' - '.strip_tags($myts->displayTarea($topic));
508
        } else {
509
            $content .= strip_tags($myts->displayTarea($topic));
510
        }
511
    }
512
    if (is_object($xoopsModule) && xoops_trim($xoopsModule->name())!='') {
513
        if (xoops_trim($content)!='') {
514
            $content.=' - '.strip_tags($myts->displayTarea($xoopsModule->name()));
515
        } else {
516
            $content.=strip_tags($myts->displayTarea($xoopsModule->name()));
517
        }
518
    }
519
    if ($content!='') {
520
        $xoopsTpl->assign('xoops_pagetitle', $content);
521
    }
522
}
523
524
// clear descriptions
525
function lx_html2text($document) {