Code Duplication    Length = 22-22 lines in 3 locations

htdocs/modules/system/themes/default/default.php 1 location

@@ 294-315 (lines=22) @@
291
            return null;
292
        }
293
294
        foreach ($mods as $mod) {
295
            $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
296
            if ($sadmin) {
297
                $rtn  = array();
298
                $info = $mod->getInfo();
299
                if (!empty($info ['adminindex'])) {
300
                    $rtn ['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info ['adminindex'];
301
                } else {
302
                    $rtn ['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid');
303
                }
304
                $rtn ['title']       = htmlspecialchars($mod->getVar('name'), ENT_QUOTES);
305
                $rtn ['description'] = $mod->getInfo('description');
306
                $rtn ['absolute']    = 1;
307
                if (isset($info ['icon_big'])) {
308
                    $rtn ['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info ['icon_big'];
309
                } elseif (isset($info ['image'])) {
310
                    $rtn ['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info ['image'];
311
                }
312
313
                $tpl->append('modules', $rtn);
314
            }
315
        }
316
    }
317
}
318

htdocs/modules/system/themes/zetadigme/zetadigme.php 1 location

@@ 333-354 (lines=22) @@
330
        if (is_object($xoopsModule) || !empty($_GET['xoopsorgnews'])) {
331
            return null;
332
        }
333
        foreach ($mods as $mod) {
334
            $rtn                = array();
335
            $moduleperm_handler = xoops_getHandler('groupperm');
336
            $sadmin             = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
337
            if ($sadmin) {
338
                $info = $mod->getInfo();
339
                if (!empty($info['adminindex'])) {
340
                    $rtn['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['adminindex'];
341
                } else {
342
                    $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid');
343
                }
344
                $rtn['title']        = $mod->getVar('name');
345
                $rtn ['description'] = $mod->getInfo('description');
346
                $rtn['absolute']     = 1;
347
                if (isset($info['icon_big'])) {
348
                    $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon_big'];
349
                } elseif (isset($info['image'])) {
350
                    $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['image'];
351
                }
352
            }
353
            $tpl->append('modules', $rtn);
354
        }
355
    }
356
}
357

htdocs/modules/system/themes/transition/transition.php 1 location

@@ 328-349 (lines=22) @@
325
            return null;
326
        }
327
328
        foreach ($mods as $mod) {
329
            $sadmin = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
330
            if ($sadmin) {
331
                $rtn  = array();
332
                $info = $mod->getInfo();
333
                if (!empty($info ['adminindex'])) {
334
                    $rtn ['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info ['adminindex'];
335
                } else {
336
                    $rtn ['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid');
337
                }
338
                $rtn ['title']       = htmlspecialchars($mod->getVar('name'), ENT_QUOTES);
339
                $rtn ['description'] = $mod->getInfo('description');
340
                $rtn ['absolute']    = 1;
341
                if (isset($info ['icon_big'])) {
342
                    $rtn ['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info ['icon_big'];
343
                } elseif (isset($info ['image'])) {
344
                    $rtn ['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info ['image'];
345
                }
346
347
                $tpl->append('modules', $rtn);
348
            }
349
        }
350
    }
351
}
352