Code Duplication    Length = 18-18 lines in 2 locations

class/Utility.php 1 location

@@ 123-140 (lines=18) @@
120
     * @param string $name
121
     * @return XoopsFormSelect
122
     */
123
    public static function getListCategories($cat, $addNone = true, $name = 'cat')
124
    {
125
        global $xoopsUser;
126
        // Category selectbox
127
        $catHandler   = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_CAT);
128
129
        $catsList  = $catHandler->getAllCat($xoopsUser);
130
        $catSelect = new \XoopsFormSelect('', $name, $cat);
131
        if ($addNone) {
132
            $catSelect->addOption(0, ' ');
133
        }
134
135
        foreach ($catsList as $catList) {
136
            $catSelect->addOption($catList->getVar('cat_id'), $catList->getVar('cat_name'));
137
        }
138
139
        return $catSelect;
140
    }
141
142
    /*******************************************************************
143
     *

include/functions0.php 1 location

@@ 110-127 (lines=18) @@
107
 * @param string $name
108
 * @return XoopsFormSelect
109
 */
110
function getListCategories($cat, $addNone = true, $name = 'cat')
111
{
112
    global $xoopsUser;
113
    // Category selectbox
114
     $catHandler   = Extcal\Helper::getInstance()->getHandler(_EXTCAL_CLN_CAT);
115
116
    $catsList  = $catHandler->getAllCat($xoopsUser);
117
    $catSelect = new \XoopsFormSelect('', $name, $cat);
118
    if ($addNone) {
119
        $catSelect->addOption(0, ' ');
120
    }
121
122
    foreach ($catsList as $catList) {
123
        $catSelect->addOption($catList->getVar('cat_id'), $catList->getVar('cat_name'));
124
    }
125
126
    return $catSelect;
127
}
128
129
/*******************************************************************
130
 *