| Conditions | 1 |
| Paths | 1 |
| Total Lines | 58 |
| Code Lines | 29 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 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 |
||
| 30 | function xfguestbook_admin_menu($currentoption = 0, $breadcrumb = '') |
||
|
|
|||
| 31 | { |
||
| 32 | |||
| 33 | /* Nice buttons styles */ |
||
| 34 | echo " |
||
| 35 | <style type='text/css'> |
||
| 36 | #buttontop { float:left; width:100%; background: #e7e7e7; font-size:93%; line-height:normal; border-top: 1px solid black; border-left: 1px solid black; border-right: 1px solid black; margin: 0; } |
||
| 37 | #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 black; border-right: 1px solid black; margin-bottom: 12px; } |
||
| 38 | #buttonbar ul { margin:0; margin-top: 15px; padding:10px 10px 0; list-style:none; } |
||
| 39 | #buttonbar li { display:inline; margin:0; padding:0; } |
||
| 40 | #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; } |
||
| 41 | #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; } |
||
| 42 | /* Commented Backslash Hack hides rule from IE5-Mac \*/ |
||
| 43 | #buttonbar a span {float:none;} |
||
| 44 | /* End IE5-Mac hack */ |
||
| 45 | #buttonbar a:hover span { color:#333; } |
||
| 46 | #buttonbar #current a { background-position:0 -150px; border-width:0; } |
||
| 47 | #buttonbar #current a span { background-position:100% -150px; padding-bottom:5px; color:#333; } |
||
| 48 | #buttonbar a:hover { background-position:0 -150px; } |
||
| 49 | #buttonbar a:hover span { background-position:100% -150px; } |
||
| 50 | </style> |
||
| 51 | "; |
||
| 52 | |||
| 53 | global $xoopsModule, $xoopsConfig; |
||
| 54 | $myts = MyTextSanitizer::getInstance(); |
||
| 55 | |||
| 56 | $tblColors = array(); |
||
| 57 | $tblColors[0] = $tblColors[1] = $tblColors[2] = $tblColors[3] = $tblColors[4] = $tblColors[5] = $tblColors[6] = $tblColors[7] = $tblColors[8] = ''; |
||
| 58 | $tblColors[$currentoption] = 'current'; |
||
| 59 | // if (file_exists(XOOPS_ROOT_PATH . '/modules/' . $xoopsModule->getVar('dirname') . '/language/' . $xoopsConfig['language'] . '/modinfo.php')) { |
||
| 60 | // include_once XOOPS_ROOT_PATH . '/modules/xfguestbook/language/' . $xoopsConfig['language'] . '/modinfo.php'; |
||
| 61 | // } else { |
||
| 62 | // include_once XOOPS_ROOT_PATH . '/modules/xfguestbook/english/modinfo.php'; |
||
| 63 | // } |
||
| 64 | xoops_loadLanguage('modinfo', $xoopsModule->getVar('dirname')); |
||
| 65 | |||
| 66 | echo "<div id='buttontop'>"; |
||
| 67 | echo "<table style=\"width: 100%; padding: 0; \" cellspacing=\"0\"><tr>"; |
||
| 68 | //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>"; |
||
| 69 | echo "<td style='font-size: 10px; text-align: left; color: #2F5376; padding: 0 6px; line-height: 18px;'> |
||
| 70 | <a class='nobutton' href='" . XOOPS_URL . '/modules/system/admin.php?fct=preferences&op=showmod&mod=' . $xoopsModule->getVar('mid') . "'>" . _AM_XFGB_GENERALSET . "</a> |
||
| 71 | | <a href='" . XOOPS_URL . "/modules/xfguestbook/index.php'>" . _AM_XFGB_GOINDEX . "</a> |
||
| 72 | | <a href='" . XOOPS_URL . "/modules/xfguestbook/admin/flags_install.php'>" . _AM_XFGB_INSTALL_IMG . "</a> |
||
| 73 | | <a href='" . XOOPS_URL . "/modules/xfguestbook/admin/upgrade.php'>" . _AM_XFGB_UPGRADE . "</a> |
||
| 74 | | <a href='" . XOOPS_URL . "/modules/xfguestbook/admin/img_manager.php'>" . _AM_XFGB_MSGIMG . '</a> |
||
| 75 | </td>'; |
||
| 76 | echo "<td style='font-size: 10px; text-align: right; color: #2F5376; padding: 0 6px; line-height: 18px;'><b>" . $myts->displayTarea($xoopsModule->name()) . ' </b> </td>'; |
||
| 77 | echo '</tr></table>'; |
||
| 78 | echo '</div>'; |
||
| 79 | |||
| 80 | echo "<div id='buttonbar'>"; |
||
| 81 | echo '<ul>'; |
||
| 82 | echo "<li id='" . $tblColors[0] . "'><a href=\"" . XOOPS_URL . "/modules/xfguestbook/admin/index.php\"><span>" . _AM_XFGB_MSGMANAGE . '</span></a></li>'; |
||
| 83 | echo "<li id='" . $tblColors[1] . "'><a href=\"" . XOOPS_URL . "/modules/xfguestbook/admin/config.php\"><span>" . _AM_XFGB_FORMOPT . '</span></a></li>'; |
||
| 84 | echo "<li id='" . $tblColors[2] . "'><a href=\"" . XOOPS_URL . "/modules/xfguestbook/admin/country_manager.php\"><span>" . _AM_XFGB_COUNTRYMANAGE . '</span></a></li>'; |
||
| 85 | echo "<li id='" . $tblColors[3] . "'><a href=\"" . XOOPS_URL . "/modules/xfguestbook/admin/ip_manager.php\"><span>" . _AM_XFGB_BADIPSMANAGE . '</span></a></li>'; |
||
| 86 | echo '</ul></div> '; |
||
| 87 | } |
||
| 88 | |||
| 158 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.