Code Duplication    Length = 22-69 lines in 2 locations

class/Utility.php 1 location

@@ 433-501 (lines=69) @@
430
     * @param $variable
431
     * @return string
432
     */
433
public static function getServiceLinks($variable)
434
{
435
    global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $xoopsConfig, $entrytype;
436
437
        /** @var XoopsModuleHandler $moduleHandler */
438
        $moduleHandler = xoops_getHandler('module');
439
    $moduleInfo    = $moduleHandler->get($xoopsModule->getVar('mid'));
440
    $pathIcon16    = \Xmf\Module\Admin::iconUrl('', 16);
441
442
    $srvlinks = '';
443
    if ($xoopsUser) {
444
        if ($xoopsUser->isAdmin()) {
445
            $srvlinks .= "<a TITLE=\""
446
                             . _EDIT
447
                             . "\" href=\"/modules/lexikon/admin/entry.php?op=mod&entryID="
448
                             . $variable['id']
449
                             . "\" target=\"_blank\"><img src=\""
450
                             . $pathIcon16 . "/edit.png\"   alt=\""
451
                             . _MD_LEXIKON_EDITTERM
452
                             . "\" style=\"width:16px; height:16px;\"></a>&nbsp;<a TITLE=\""
453
                             . _DELETE
454
                             . "\" href=\"admin/entry.php?op=del&entryID="
455
                             . $variable['id']
456
                             . "\" target=\"_self\"><img src=\""
457
                             . $pathIcon16 . "/delete.png\" alt=\""
458
                             . _MD_LEXIKON_DELTERM
459
                             . "\" style=\"width:16px; height:16px;\"></a>&nbsp;";
460
        }
461
    }
462
    if ($entrytype != '1') {
463
        $srvlinks .= "<a TITLE=\""
464
                         . _MD_LEXIKON_PRINTTERM
465
                         . "\" href=\"print.php?entryID="
466
                         . $variable['id']
467
                         . "\" target=\"_blank\"><img src=\""
468
                         . $pathIcon16 . "/printer.png\"  alt=\""
469
                         . _MD_LEXIKON_PRINTTERM
470
                         . "\" style=\"width:16px; height:16px;\"></a>&nbsp;<a TITLE=\""
471
                         . _MD_LEXIKON_SENDTOFRIEND
472
                         . "\" href=\"mailto:?subject="
473
                         . sprintf(_MD_LEXIKON_INTENTRY, $xoopsConfig['sitename'])
474
                         . '&amp;body='
475
                         . sprintf(_MD_LEXIKON_INTENTRYFOUND, $xoopsConfig['sitename'])
476
                         . ': '
477
                         . XOOPS_URL
478
                         . '/modules/'
479
                         . $xoopsModule->dirname()
480
                         . '/entry.php?entryID='
481
                         . $variable['id']
482
                         . " \" target=\"_blank\"><img src=\""
483
                         . $pathIcon16 . "/mail_replay.png\" alt=\""
484
                         . _MD_LEXIKON_SENDTOFRIEND
485
                         . "\" style=\"width:16px; height:16px;\"></a>&nbsp;";
486
        if (($xoopsModuleConfig['com_rule'] != 0)
487
                && (!empty($xoopsModuleConfig['com_anonpost'])
488
                    || is_object($xoopsUser))
489
            ) {
490
            $srvlinks .= "<a TITLE=\""
491
                             . _COMMENTS
492
                             . "?\" href=\"comment_new.php?com_itemid="
493
                             . $variable['id']
494
                             . "\" target=\"_parent\"><img src=\"assets/images/comments.gif\" alt=\""
495
                             . _COMMENTS
496
                             . "?\" style=\"width:16px; height:16px;\"></a>&nbsp;";
497
        }
498
    }
499
500
    return $srvlinks;
501
}
502
503
    // entry footer
504
    /**

include/functions.php 1 location

@@ 205-226 (lines=22) @@
202
*/
203
204
// Functional links
205
function lx_serviceLinks ( $variable ) {
206
    global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $xoopsConfig, $entrytype;
207
208
    $module_handler  = xoops_gethandler('module');
209
    $moduleInfo = $module_handler->get($xoopsModule->getVar('mid'));
210
    $pathIcon16 = $xoopsModule->getInfo('icons16');
211
212
    $srvlinks = "";
213
    if ( $xoopsUser ) {
214
        if ( $xoopsUser->isAdmin() ) {
215
            $srvlinks .= "<a TITLE=\""._EDIT."\" href=\"admin/entry.php?op=mod&entryID=".$variable['id']."\" target=\"_blank\"><img src=\"" . $pathIcon16. "/edit.png\" alt=\""._MD_LEXIKON_EDITTERM."\" style=\"width:16px; height:16px;\"></a>&nbsp;<a TITLE=\""._DELETE."\" href=\"admin/entry.php?op=del&entryID=".$variable['id']."\" target=\"_self\"><img src=\"" . $pathIcon16. "/delete.png\"   alt=\""._MD_LEXIKON_DELTERM."\" style=\"width:16px; height:16px;\"></a>&nbsp;";
216
        }
217
    }
218
    if ( $entrytype != "1" ) {
219
        $srvlinks .= "<a TITLE=\""._MD_LEXIKON_PRINTTERM."\" href=\"print.php?entryID=".$variable['id']."\" target=\"_blank\"><img src=\"" . $pathIcon16. "/printer.png\" alt=\""._MD_LEXIKON_PRINTTERM."\" style=\"width:16px; height:16px;\"></a>&nbsp;<a TITLE=\""._MD_LEXIKON_SENDTOFRIEND."\" href=\"mailto:?subject=".sprintf(_MD_LEXIKON_INTENTRY,$xoopsConfig["sitename"])."&amp;body=".sprintf(_MD_LEXIKON_INTENTRYFOUND, $xoopsConfig['sitename']).": ".XOOPS_URL."/modules/".$xoopsModule->dirname()."/entry.php?entryID=".$variable['id']." \" target=\"_blank\"><img src=\"" . $pathIcon16. "/mail_replay.png\"   alt=\""._MD_LEXIKON_SENDTOFRIEND."\" style=\"width:16px; height:16px;\"></a>&nbsp;";
220
        if (( $xoopsModuleConfig['com_rule'] != 0 ) && (!empty($xoopsModuleConfig['com_anonpost']) || is_object($xoopsUser))) {
221
            $srvlinks .= "<a TITLE=\""._COMMENTS."?\" href=\"comment_new.php?com_itemid=".$variable['id']."\" target=\"_parent\"><img src=\"images/comments.gif\" alt=\"" ._COMMENTS. "?\" style=\"width:16px; height:16px;\"></a>&nbsp;";
222
            }
223
    }
224
225
    return $srvlinks;
226
}
227
// entry footer
228
function lx_serviceLinksnew ( $variable ) {
229
    global $xoopsUser, $xoopsDB, $xoopsModule, $xoopsModuleConfig, $xoopsConfig, $myts;