Code Duplication    Length = 23-23 lines in 2 locations

class/utilities.php 1 location

@@ 137-159 (lines=23) @@
134
     * @param        $cat
135
     * @return array
136
     */
137
    public static function getCheckeCategories($name = 'cat', $cat)
138
    {
139
        global $xoopsUser;
140
        // Category selectbox
141
        //<option style="background-color:#00FFFF;">VARCHAR</option>
142
143
        $catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE);
144
        $catsList = $catHandler->getAllCat($xoopsUser);
145
146
        $t = array();
147
        foreach ($catsList as $catList) {
148
            $cat_id = $catList->getVar('cat_id');
149
            $name = $catList->getVar('cat_name');
150
            $cat_color = $catList->getVar('cat_color');
151
            $checked = in_array($cat_id, $cat) ? 'checked' : '';
152
            $cat = ''."<div style='float:left; margin-left:5px;'>"."<input type='checkbox' name='{$name}[{$cat_id}]' value='1' {$checked}>"
153
                         ."<div style='absolute:left;height:12px; width:6px; background-color:#{$cat_color}; border:1px solid black; float:left; margin-right:5px;' ></div>"." {$name}".'</div>';
154
155
            $t[] = $cat;
156
        }
157
158
        return $t;
159
    }
160
161
    /*******************************************************************
162
     *

include/functions.php 1 location

@@ 132-154 (lines=23) @@
129
 * @param        $cat
130
 * @return array
131
 */
132
function getCheckeCategories($name = 'cat', $cat)
133
{
134
    global $xoopsUser;
135
    // Category selectbox
136
    //<option style="background-color:#00FFFF;">VARCHAR</option>
137
138
    $catHandler = xoops_getModuleHandler(_EXTCAL_CLS_CAT, _EXTCAL_MODULE);
139
    $catsList = $catHandler->getAllCat($xoopsUser);
140
141
    $t = array();
142
    foreach ($catsList as $catList) {
143
        $cat_id = $catList->getVar('cat_id');
144
        $name = $catList->getVar('cat_name');
145
        $cat_color = $catList->getVar('cat_color');
146
        $checked = in_array($cat_id, $cat) ? 'checked' : '';
147
        $cat = ''."<div style='float:left; margin-left:5px;'>"."<input type='checkbox' name='{$name}[{$cat_id}]' value='1' {$checked}>"
148
                     ."<div style='absolute:left;height:12px; width:6px; background-color:#{$cat_color}; border:1px solid black; float:left; margin-right:5px;' ></div>"." {$name}".'</div>';
149
150
        $t[] = $cat;
151
    }
152
153
    return $t;
154
}
155
156
/*******************************************************************
157
 *