Conditions | 1 |
Paths | 1 |
Total Lines | 54 |
Code Lines | 29 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
38 | function xfguestbook_admin_menu($currentoption = 0, $breadcrumb = '') |
||
|
|||
39 | { |
||
40 | /* Nice buttons styles */ |
||
41 | echo " |
||
42 | <style type='text/css'> |
||
43 | #buttontop { float:left; width:100%; background: #e7e7e7; font-size:93%; line-height:normal; border-top: 1px solid #000000; border-left: 1px solid #000000; border-right: 1px solid #000000; margin: 0; } |
||
44 | #buttonbar { float:left; width:100%; background: #e7e7e7 url('" . XOOPS_URL . "/modules/xfguestbook/assets/images/bg.gif') repeat-x left bottom; font-size:93%; line-height:normal; border-left: 1px solid #000000; border-right: 1px solid #000000; margin-bottom: 12px; } |
||
45 | #buttonbar ul { margin: 15px 0 0;padding:10px 10px 0; list-style:none; } |
||
46 | #buttonbar li { display:inline; margin:0; padding:0; } |
||
47 | #buttonbar a { float:left; background:url('" . XOOPS_URL . "/modules/xfguestbook/assets/images/left_both.gif') no-repeat left top; margin:0; padding:0 0 0 9px; border-bottom:1px solid #000; text-decoration:none; } |
||
48 | #buttonbar a span { float:left; display:block; background:url('" . XOOPS_URL . "/modules/xfguestbook/assets/images/right_both.gif') no-repeat right top; padding:5px 15px 4px 6px; font-weight:bold; color:#765; } |
||
49 | /* Commented Backslash Hack hides rule from IE5-Mac \*/ |
||
50 | #buttonbar a span {float:none;} |
||
51 | /* End IE5-Mac hack */ |
||
52 | #buttonbar a:hover span { color:#333; } |
||
53 | #buttonbar #current a { background-position:0 -150px; border-width:0; } |
||
54 | #buttonbar #current a span { background-position:100% -150px; padding-bottom:5px; color:#333; } |
||
55 | #buttonbar a:hover { background-position:0 -150px; } |
||
56 | #buttonbar a:hover span { background-position:100% -150px; } |
||
57 | </style> |
||
58 | "; |
||
59 | |||
60 | global $xoopsModule, $xoopsConfig; |
||
61 | $myts = \MyTextSanitizer::getInstance(); |
||
62 | |||
63 | $tblColors = []; |
||
64 | $tblColors[0] = $tblColors[1] = $tblColors[2] = $tblColors[3] = $tblColors[4] = $tblColors[5] = $tblColors[6] = $tblColors[7] = $tblColors[8] = ''; |
||
65 | $tblColors[$currentoption] = 'current'; |
||
66 | |||
67 | /** @var Helper $helper */ |
||
68 | $helper = Helper::getInstance(); |
||
69 | $helper->loadLanguage('modinfo'); |
||
70 | |||
71 | echo "<div id='buttontop'>"; |
||
72 | echo '<table style="width: 100%; padding: 0; " cellspacing="0"><tr>'; |
||
73 | //echo "<td style=\"width: 45%; font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;\"><a class=\"nobutton\" href=\"../../system/admin.php?fct=preferences&op=showmod&mod=" . $xoopsModule->getVar('mid') . "\">" . _AM_SF_OPTS . "</a> | <a href=\"import.php\">" . _AM_SF_IMPORT . "</a> | <a href=\"../index.php\">" . _AM_SF_GOMOD . "</a> | <a href=\"../help/index.html\" target=\"_blank\">" . _AM_SF_HELP . "</a> | <a href=\"about.php\">" . _AM_SF_ABOUT . "</a></td>"; |
||
74 | echo "<td style='font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;'> |
||
75 | <a class='nobutton' href='" . XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $xoopsModule->getVar('mid') . '\'>' . AM_XFGUESTBOOK_GENERALSET . "</a> |
||
76 | | <a href='" . XOOPS_URL . "/modules/xfguestbook/index.php'>" . AM_XFGUESTBOOK_GOINDEX . "</a> |
||
77 | | <a href='" . XOOPS_URL . "/modules/xfguestbook/admin/flags_install.php'>" . AM_XFGUESTBOOK_INSTALL_IMG . "</a> |
||
78 | | <a href='" . XOOPS_URL . "/modules/xfguestbook/admin/upgrade.php'>" . AM_XFGUESTBOOK_UPGRADE . "</a> |
||
79 | | <a href='" . XOOPS_URL . "/modules/xfguestbook/admin/img_manager.php'>" . AM_XFGUESTBOOK_MSGIMG . '</a> |
||
80 | </td>'; |
||
81 | echo "<td style='font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;'><b>" . $myts->displayTarea($xoopsModule->name()) . ' </b> </td>'; |
||
82 | echo '</tr></table>'; |
||
83 | echo '</div>'; |
||
84 | |||
85 | echo "<div id='buttonbar'>"; |
||
86 | echo '<ul>'; |
||
87 | echo "<li id='" . $tblColors[0] . '\'><a href="' . XOOPS_URL . '/modules/xfguestbook/admin/index.php"><span>' . AM_XFGUESTBOOK_MSGMANAGE . '</span></a></li>'; |
||
88 | echo "<li id='" . $tblColors[1] . '\'><a href="' . XOOPS_URL . '/modules/xfguestbook/admin/config.php"><span>' . AM_XFGUESTBOOK_FORMOPT . '</span></a></li>'; |
||
89 | echo "<li id='" . $tblColors[2] . '\'><a href="' . XOOPS_URL . '/modules/xfguestbook/admin/country_manager.php"><span>' . AM_XFGUESTBOOK_COUNTRYMANAGE . '</span></a></li>'; |
||
90 | echo "<li id='" . $tblColors[3] . '\'><a href="' . XOOPS_URL . '/modules/xfguestbook/admin/ip_manager.php"><span>' . AM_XFGUESTBOOK_BADIPSMANAGE . '</span></a></li>'; |
||
91 | echo '</ul></div> '; |
||
92 | } |
||
163 |
This check looks for parameters that have been defined for a function or method, but which are not used in the method body.