Conditions | 12 |
Paths | 2048 |
Total Lines | 37 |
Code Lines | 27 |
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 |
||
69 | function b_lxentries_top_edit($options) |
||
70 | { |
||
71 | $form = "<table width='100%' border='0' class='bg2'>"; |
||
72 | $form .= "<tr><th width='50%'>" . _OPTIONS . "</th><th width='50%'>" . _MB_LEXIKON_SETTINGS . '</th></tr>'; |
||
73 | $form .= "<tr><td class='even'>" . _MB_LEXIKON_ORDER . "</td><td class='odd'>"; |
||
74 | $form .= " <select name='options[0]'>"; |
||
75 | $form .= "<option value='datesub' " . (('datesub' === $options[0]) ? ' selected' : '') . '>' . _MB_LEXIKON_DATE . "</option>\n"; |
||
76 | $form .= "<option value='counter' " . (('counter' === $options[0]) ? ' selected' : '') . '>' . _MB_LEXIKON_HITS . "</option>\n"; |
||
77 | $form .= "<option value='term' " . (('term' === $options[0]) ? ' selected' : '') . '>' . _MB_LEXIKON_NAME . "</option>\n"; |
||
78 | $form .= '</select><br></td></tr>'; |
||
79 | //--- |
||
80 | $form .= "<tr><td class='even'>" . _MB_LEXIKON_DISP . "</td><td class='odd'><input type='text' name='options[]' value='" . $options[1] . "' > " . _MB_LEXIKON_TERMS . '<br></td></tr>'; |
||
81 | //--- |
||
82 | $form .= "<tr><td class='even'>" . _MB_LEXIKON_MARQUEE . "</td><td class='odd'>"; |
||
83 | $form .= "<input type='radio' name='options[2]' value='1'" . ((1 == $options[2]) ? ' checked' : '') . ' >' . _YES . ' '; |
||
84 | $form .= "<input type='radio' name='options[2]' value='0'" . ((0 == $options[2]) ? ' checked' : '') . ' >' . _NO . '<br></td></tr>'; |
||
85 | //--- |
||
86 | $form .= "<tr><td class='even'>" . _MB_LEXIKON_ALTERNATE . "</td><td class='odd'>"; |
||
87 | $form .= "<input type='radio' name='options[3]' value='1'" . ((1 == $options[3]) ? ' checked' : '') . ' >' . _YES . ' '; |
||
88 | $form .= "<input type='radio' name='options[3]' value='0'" . ((0 == $options[3]) ? ' checked' : '') . ' >' . _NO . '<br></td></tr>'; |
||
89 | $form .= '</td></tr>'; |
||
90 | //--- |
||
91 | $form .= "<tr><td class='even'>" . _MB_LEXIKON_SHOWCOUNT . "</td><td class='odd'>"; |
||
92 | $form .= "<input type='radio' name='options[4]' value='1'" . ((1 == $options[4]) ? ' checked' : '') . ' >' . _YES . ' '; |
||
93 | $form .= "<input type='radio' name='options[4]' value='0'" . ((0 == $options[4]) ? ' checked' : '') . ' >' . _NO . '<br></td></tr>'; |
||
94 | //--- |
||
95 | $form .= "<tr><td class='even'>" . _MB_LEXIKON_DIRECTION . "</td><td class='odd'><select name='options[5]'>"; |
||
96 | $form .= "<option value='up' " . (('up' === $options[5]) ? ' selected' : '') . '>' . _MB_LEXIKON_UP . "</option>\n"; |
||
97 | $form .= "<option value='down' " . (('down' === $options[5]) ? ' selected' : '') . '>' . _MB_LEXIKON_DOWN . "</option>\n"; |
||
98 | $form .= "</select></td></tr>\n"; |
||
99 | //--- |
||
100 | $form .= "<tr><td class='even'>" . _MB_LEXIKON_BSPEED . "</td><td class='odd'><input type='text' name='options[6]' size='16' maxlength=2 value='" . $options[6] . "' ></td></tr>"; |
||
101 | $form .= "<tr><td class='even'>" . _MB_LEXIKON_BACKGROUNDCOLOR . "</td><td class='odd'><input type='text' name='options[7]' size='16' value='" . $options[7] . "' ></td></tr>"; |
||
102 | $form .= '</table>'; |
||
103 | |||
104 | //---- |
||
105 | return $form; |
||
106 | } |
||
107 |