Code Duplication    Length = 23-23 lines in 2 locations

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

@@ 154-176 (lines=23) @@
151
152
        $menu               = array();
153
        $moduleperm_handler = xoops_getHandler('groupperm');
154
        foreach ($mods as $mod) {
155
            $rtn        = array();
156
            $modOptions = array();                                                         //add for sub menus
157
            $sadmin     = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
158
            if ($sadmin) {
159
                $info = $mod->getInfo();
160
                if (!empty($info['adminindex'])) {
161
                    $rtn['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['adminindex'];
162
                } else {
163
                    $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid');
164
                }
165
                $rtn['title']    = htmlspecialchars($mod->name(), ENT_QUOTES);
166
                $rtn['absolute'] = 1;
167
                $rtn['url']      = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/'; //add for sub menus
168
                $modOptions      = $mod->getAdminMenu();                                        //add for sub menus
169
                $rtn['options']  = $modOptions;                                             //add for sub menus
170
171
                if (isset($info['icon']) && $info['icon'] !== '') {
172
                    $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon'];
173
                }
174
                $menu[] = $rtn;
175
            }
176
        }
177
        $tpl->append('navitems', array(
178
            'link' => XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin',
179
            'text' => _AM_SYSTEM_MODULES,

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

@@ 204-226 (lines=23) @@
201
        $mods               = $module_handler->getObjects($criteria);
202
        $menu               = array();
203
        $moduleperm_handler = xoops_getHandler('groupperm');
204
        foreach ($mods as $mod) {
205
            $rtn        = array();
206
            $modOptions = array();                                                         //add for sub menus
207
            $sadmin     = $moduleperm_handler->checkRight('module_admin', $mod->getVar('mid'), $xoopsUser->getGroups());
208
            if ($sadmin) {
209
                $info = $mod->getInfo();
210
                if (!empty($info['adminindex'])) {
211
                    $rtn['link'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['adminindex'];
212
                } else {
213
                    $rtn['link'] = XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $mod->getVar('mid');
214
                }
215
                $rtn['title']    = $mod->name();
216
                $rtn['absolute'] = 1;
217
                $rtn['url']      = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/'; //add for sub menus
218
                $modOptions      = $mod->getAdminMenu();                                        //add for sub menus
219
                $rtn['options']  = $modOptions;                                             //add for sub menus
220
221
                if (isset($info['icon']) && $info['icon'] !== '') {
222
                    $rtn['icon'] = XOOPS_URL . '/modules/' . $mod->getVar('dirname', 'n') . '/' . $info['icon'];
223
                }
224
                $menu[] = $rtn;
225
            }
226
        }
227
        $tpl->append('navitems', array(
228
            'link' => XOOPS_URL . '/modules/system/admin.php?fct=modulesadmin',
229
            'text' => _AM_SYSTEM_MODULES,