Code Duplication    Length = 25-25 lines in 2 locations

blocks/references_last_news.php 1 location

@@ 57-81 (lines=25) @@
54
 * @param array $options indice 0 = nombre d'articles à afficher
55
 * @return string
56
 */
57
function b_references_last_news_edit($options)
58
{
59
    global $xoopsConfig;
60
    include XOOPS_ROOT_PATH . '/modules/references/include/common.php';
61
    $handlers   = references_handler::getInstance();
62
    $categories = $handlers->h_references_categories->getListArray();
63
    $form       = '';
64
    $form .= "<table border='0'>";
65
    $form .= '<tr><td>' . _MB_REFERENCES_ITEMS_COUNT . "</td><td><input type='text' name='options[]' id='options' value='" . $options[0] . "' /></td></tr>\n";
66
    $form .= '<tr><td>' . _MB_REFERENCES_CATEGORIES . "</td><td><select name='options[]' multiple='multiple'>";
67
    $size = count($options);
68
    foreach ($categories as $Idcategory => $categoryName) {
69
        $sel = '';
70
        for ($i = 1; $i < $size; ++$i) {
71
            if ($options[$i] == $Idcategory) {
72
                $sel = " selected='selected'";
73
            }
74
        }
75
        $form .= "<option value='$Idcategory' $sel>$categoryName</option>";
76
    }
77
    $form .= "</select></td></tr>\n";
78
    $form .= '</table>';
79
80
    return $form;
81
}
82

blocks/references_random_news.php 1 location

@@ 59-83 (lines=25) @@
56
 * @param array $options indice 0 = nombre d'articles à afficher
57
 * @return string
58
 */
59
function b_references_random_news_edit($options)
60
{
61
    global $xoopsConfig;
62
    include XOOPS_ROOT_PATH . '/modules/references/include/common.php';
63
    $handlers   = references_handler::getInstance();
64
    $categories = $handlers->h_references_categories->getListArray();
65
    $form       = '';
66
    $form .= "<table border='0'>";
67
    $form .= '<tr><td>' . _MB_REFERENCES_ITEMS_COUNT . "</td><td><input type='text' name='options[]' id='options' value='" . $options[0] . "' /></td></tr>\n";
68
    $form .= '<tr><td>' . _MB_REFERENCES_CATEGORIES . "</td><td><select name='options[]' multiple='multiple'>";
69
    $size = count($options);
70
    foreach ($categories as $Idcategory => $categoryName) {
71
        $sel = '';
72
        for ($i = 1; $i < $size; ++$i) {
73
            if ($options[$i] == $Idcategory) {
74
                $sel = " selected='selected'";
75
            }
76
        }
77
        $form .= "<option value='$Idcategory' $sel>$categoryName</option>";
78
    }
79
    $form .= "</select></td></tr>\n";
80
    $form .= '</table>';
81
82
    return $form;
83
}
84