Code Duplication    Length = 33-33 lines in 4 locations

blocks/category_events.php 1 location

@@ 83-115 (lines=33) @@
80
 *
81
 * @return string
82
 */
83
function bExtcalUpcomingByCategoryEdit($options)
84
{
85
    global $xoopsUser;
86
87
    $catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE);
88
89
    $cats = $catHandler->getAllCat($xoopsUser, 'extcal_cat_view');
90
91
    $form = _MB_EXTCAL_DISPLAY . " \n";
92
    $form .= '<input name="options[0]" size="5" maxlength="255" value="' . $options[0] . '" type="text">&nbsp;' . _MB_EXTCAL_EVENT . '<br>';
93
    $form .= _MB_EXTCAL_TITLE_LENGTH . ' : <input name="options[1]" size="5" maxlength="255" value="' . $options[1] . '" type="text"><br>';
94
    array_shift($options);
95
    array_shift($options);
96
    $form .= _MB_EXTCAL_CAT_TO_USE . '<br><select name="options[]" multiple="multiple" size="5">';
97
    if (array_search(0, $options) === false) {
98
        $form .= '<option value="0">' . _MB_EXTCAL_ALL_CAT . '</option>';
99
    } else {
100
        $form .= '<option value="0" selected="selected">' . _MB_EXTCAL_ALL_CAT . '</option>';
101
    }
102
    foreach ($cats as $cat) {
103
        if (array_search($cat->getVar('cat_id'), $options) === false) {
104
            $form .= '<option value="' . $cat->getVar('cat_id') . '">' . $cat->getVar('cat_name') . '</option>';
105
        } else {
106
            $form .= '<option value="' . $cat->getVar('cat_id') . '" selected="selected">' . $cat->getVar('cat_name') . '</option>';
107
        }
108
    }
109
    $form .= '</select>';
110
111
    return $form;
112
}
113

blocks/day_events.php 1 location

@@ 59-91 (lines=33) @@
56
 *
57
 * @return string
58
 */
59
function bExtcalDayEdit($options)
60
{
61
    global $xoopsUser;
62
63
    $catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE);
64
65
    $cats = $catHandler->getAllCat($xoopsUser, 'extcal_cat_view');
66
67
    $form = _MB_EXTCAL_DISPLAY . "&nbsp;\n";
68
    $form .= '<input name="options[0]" size="5" maxlength="255" value="' . $options[0] . '" type="text">&nbsp;' . _MB_EXTCAL_EVENT . '<br>';
69
    $form .= _MB_EXTCAL_TITLE_LENGTH . ' : <input name="options[1]" size="5" maxlength="255" value="' . $options[1] . '" type="text"><br>';
70
    array_shift($options);
71
    array_shift($options);
72
    $form .= _MB_EXTCAL_CAT_TO_USE . '<br><select name="options[]" multiple="multiple" size="5">';
73
    if (array_search(0, $options) === false) {
74
        $form .= '<option value="0">' . _MB_EXTCAL_ALL_CAT . '</option>';
75
    } else {
76
        $form .= '<option value="0" selected="selected">' . _MB_EXTCAL_ALL_CAT . '</option>';
77
    }
78
    foreach ($cats as $cat) {
79
        if (array_search($cat->getVar('cat_id'), $options) === false) {
80
            $form .= '<option value="' . $cat->getVar('cat_id') . '">' . $cat->getVar('cat_name') . '</option>';
81
        } else {
82
            $form .= '<option value="' . $cat->getVar('cat_id') . '" selected="selected">' . $cat->getVar('cat_name') . '</option>';
83
        }
84
    }
85
    $form .= '</select>';
86
87
    return $form;
88
}
89

blocks/new_events.php 1 location

@@ 59-91 (lines=33) @@
56
 *
57
 * @return string
58
 */
59
function bExtcalNewEdit($options)
60
{
61
    global $xoopsUser;
62
63
    $catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE);
64
65
    $cats = $catHandler->getAllCat($xoopsUser, 'extcal_cat_view');
66
67
    $form = _MB_EXTCAL_DISPLAY . "&nbsp;\n";
68
    $form .= '<input name="options[0]" size="5" maxlength="255" value="' . $options[0] . '" type="text">&nbsp;' . _MB_EXTCAL_EVENT . '<br>';
69
    $form .= _MB_EXTCAL_TITLE_LENGTH . ' : <input name="options[1]" size="5" maxlength="255" value="' . $options[1] . '" type="text"><br>';
70
    array_shift($options);
71
    array_shift($options);
72
    $form .= _MB_EXTCAL_CAT_TO_USE . '<br><select name="options[]" multiple="multiple" size="5">';
73
    if (array_search(0, $options) === false) {
74
        $form .= '<option value="0">' . _MB_EXTCAL_ALL_CAT . '</option>';
75
    } else {
76
        $form .= '<option value="0" selected="selected">' . _MB_EXTCAL_ALL_CAT . '</option>';
77
    }
78
    foreach ($cats as $cat) {
79
        if (array_search($cat->getVar('cat_id'), $options) === false) {
80
            $form .= '<option value="' . $cat->getVar('cat_id') . '">' . $cat->getVar('cat_name') . '</option>';
81
        } else {
82
            $form .= '<option value="' . $cat->getVar('cat_id') . '" selected="selected">' . $cat->getVar('cat_name') . '</option>';
83
        }
84
    }
85
    $form .= '</select>';
86
87
    return $form;
88
}
89

blocks/random_events.php 1 location

@@ 59-91 (lines=33) @@
56
 *
57
 * @return string
58
 */
59
function bExtcalRandomEdit($options)
60
{
61
    global $xoopsUser;
62
63
    $catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE);
64
65
    $cats = $catHandler->getAllCat($xoopsUser, 'extcal_cat_view');
66
67
    $form = _MB_EXTCAL_DISPLAY . "&nbsp;\n";
68
    $form .= '<input name="options[0]" size="5" maxlength="255" value="' . $options[0] . '" type="text">&nbsp;' . _MB_EXTCAL_EVENT . '<br>';
69
    $form .= _MB_EXTCAL_TITLE_LENGTH . ' : <input name="options[1]" size="5" maxlength="255" value="' . $options[1] . '" type="text"><br>';
70
    array_shift($options);
71
    array_shift($options);
72
    $form .= _MB_EXTCAL_CAT_TO_USE . '<br><select name="options[]" multiple="multiple" size="5">';
73
    if (array_search(0, $options) === false) {
74
        $form .= '<option value="0">' . _MB_EXTCAL_ALL_CAT . '</option>';
75
    } else {
76
        $form .= '<option value="0" selected="selected">' . _MB_EXTCAL_ALL_CAT . '</option>';
77
    }
78
    foreach ($cats as $cat) {
79
        if (array_search($cat->getVar('cat_id'), $options) === false) {
80
            $form .= '<option value="' . $cat->getVar('cat_id') . '">' . $cat->getVar('cat_name') . '</option>';
81
        } else {
82
            $form .= '<option value="' . $cat->getVar('cat_id') . '" selected="selected">' . $cat->getVar('cat_name') . '</option>';
83
        }
84
    }
85
    $form .= '</select>';
86
87
    return $form;
88
}
89