Code Duplication    Length = 29-29 lines in 2 locations

htdocs/class/xoopsblock.php 1 location

@@ 295-323 (lines=29) @@
292
     *
293
     * @return bool
294
     */
295
    public function getOptions()
296
    {
297
        global $xoopsConfig;
298
        if (!$this->isCustom()) {
299
            $edit_func = $this->getVar('edit_func');
300
            if (!$edit_func) {
301
                return false;
302
            }
303
            if (file_exists($GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file')))) {
304
                if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/blocks.php'))) {
305
                    include_once $file;
306
                } elseif (file_exists($file = $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/language/english/blocks.php'))) {
307
                    include_once $file;
308
                }
309
                include_once $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file'));
310
                $options   = explode('|', $this->getVar('options'));
311
                $edit_form = $edit_func($options);
312
                if (!$edit_form) {
313
                    return false;
314
                }
315
316
                return $edit_form;
317
            } else {
318
                return false;
319
            }
320
        } else {
321
            return false;
322
        }
323
    }
324
325
    /**
326
     * get all the blocks that match the supplied parameters

htdocs/modules/system/class/block.php 1 location

@@ 205-233 (lines=29) @@
202
     *
203
     * @return bool|string
204
     */
205
    public function getOptions()
206
    {
207
        global $xoopsConfig;
208
        if (!$this->isCustom()) {
209
            $edit_func = $this->getVar('edit_func');
210
            if (!$edit_func) {
211
                return false;
212
            }
213
            if (file_exists($GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file')))) {
214
                if (file_exists($file = $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/blocks.php'))) {
215
                    include_once $file;
216
                } elseif (file_exists($file = $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/language/english/blocks.php'))) {
217
                    include_once $file;
218
                }
219
                include_once $GLOBALS['xoops']->path('modules/' . $this->getVar('dirname') . '/blocks/' . $this->getVar('func_file'));
220
                $options   = explode('|', $this->getVar('options'));
221
                $edit_form = $edit_func($options);
222
                if (!$edit_form) {
223
                    return false;
224
                }
225
226
                return $edit_form;
227
            } else {
228
                return false;
229
            }
230
        } else {
231
            return false;
232
        }
233
    }
234
235
    /**
236
     * @return bool