Conditions | 1 |
Paths | 1 |
Total Lines | 173 |
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 | public function getEditorHTML() { |
||
39 | |||
40 | $output = <<<EOT |
||
41 | {$this->getCanvasDiv()}<div style="display: none;"> |
||
42 | <div id="code-output-container" title="%1\$s"> |
||
43 | <textarea id="code-output" rows="15" readonly></textarea> |
||
44 | </div> |
||
45 | <div id="code-input-container" title="%2\$s" > |
||
46 | <p>%3\$s</p> |
||
47 | <textarea id="code-input" rows="15"></textarea> |
||
48 | </div> |
||
49 | <div id="marker-form" class="mapeditor-dialog" title="%4\$s"> |
||
50 | <div class="link-title-switcher"> |
||
51 | <input type="radio" name="switch" value="text" /> %5\$s |
||
52 | <input type="radio" name="switch" value="link" /> %6\$s |
||
53 | </div> |
||
54 | <form class="mapeditor-dialog-form"> |
||
55 | <fieldset> |
||
56 | <label for="m-title">%7\$s</label> |
||
57 | <input type="text" name="title" id="m-title" class="text ui-widget-content ui-corner-all"/> |
||
58 | <label for="m-text">%8\$s</label> |
||
59 | <input type="text" name="text" id="m-text" class="text ui-widget-content ui-corner-all"/> |
||
60 | <label for="m-link">%9\$s</label> |
||
61 | <input type="text" name="link" id="m-link" class="text ui-widget-content ui-corner-all"/> |
||
62 | <label for="m-icon">%10\$s</label> |
||
63 | <input type="text" name="icon" id="m-icon" class="text ui-widget-content ui-corner-all"/> |
||
64 | <label for="m-group">%11\$s</label> |
||
65 | <input type="text" name="group" id="m-group" class="text ui-widget-content ui-corner-all"/> |
||
66 | <label for="m-inlinelabel">%12\$s</label> |
||
67 | <input type="text" name="inlinelabel" id="m-inlinelabel" class="text ui-widget-content ui-corner-all"/> |
||
68 | <label for="m-visitedicon">%23\$s</label> |
||
69 | <input type="text" name="visitedicon" id="m-visitedicon" class="text ui-widget-content ui-corner-all"/> |
||
70 | </fieldset> |
||
71 | </form> |
||
72 | </div> |
||
73 | |||
74 | <div id="strokable-form" class="mapeditor-dialog" title="%4\$s"> |
||
75 | <div class="link-title-switcher"> |
||
76 | <input type="radio" name="switch" value="text" /> %5\$s |
||
77 | <input type="radio" name="switch" value="link" /> %6\$s |
||
78 | </div> |
||
79 | <form class="mapeditor-dialog-form"> |
||
80 | <fieldset> |
||
81 | <label for="s-title">%7\$s</label> |
||
82 | <input type="text" name="title" id="s-title" class="text ui-widget-content ui-corner-all"/> |
||
83 | <label for="s-text">%8\$s</label> |
||
84 | <input type="text" name="text" id="s-text" value="" class="text ui-widget-content ui-corner-all"/> |
||
85 | <label for="s-link">%9\$s</label> |
||
86 | <input type="text" name="link" id="s-link" class="text ui-widget-content ui-corner-all"/> |
||
87 | <label for="s-strokecolor">%13\$s</label> |
||
88 | <input type="text" name="strokeColor" id="s-strokecolor" class="text ui-widget-content ui-corner-all"/> |
||
89 | <label for="s-strokeopacity">%14\$s</label> |
||
90 | <input type="hidden" name="strokeOpacity" id="s-strokeopacity" class="text ui-widget-content ui-corner-all"/> |
||
91 | <label for="s-strokeweight">%15\$s</label> |
||
92 | <input type="text" name="strokeWeight" id="s-strokeweight" class="text ui-widget-content ui-corner-all"/> |
||
93 | </fieldset> |
||
94 | </form> |
||
95 | </div> |
||
96 | |||
97 | <div id="fillable-form" class="mapeditor-dialog" title="%4\$s"> |
||
98 | <div class="link-title-switcher"> |
||
99 | <input type="radio" name="switch" value="text" /> %5\$s |
||
100 | <input type="radio" name="switch" value="link" /> %6\$s |
||
101 | </div> |
||
102 | <form class="mapeditor-dialog-form"> |
||
103 | <fieldset> |
||
104 | <label for="f-title">%7\$s</label> |
||
105 | <input type="text" name="title" id="f-title" class="text ui-widget-content ui-corner-all"/> |
||
106 | <label for="f-text">%8\$s</label> |
||
107 | <input type="text" name="text" id="f-text" value="" class="text ui-widget-content ui-corner-all"/> |
||
108 | <label for="f-link">%9\$s</label> |
||
109 | <input type="text" name="link" id="f-link" class="text ui-widget-content ui-corner-all"/> |
||
110 | <label for="f-strokecolor">%13\$s</label> |
||
111 | <input type="text" name="strokeColor" id="f-strokecolor" class="text ui-widget-content ui-corner-all"/> |
||
112 | <label for="f-strokeopacity">%14\$s</label> |
||
113 | <input type="hidden" name="strokeOpacity" id="f-strokeopacity" class="text ui-widget-content ui-corner-all"/> |
||
114 | <label for="f-strokeweight">%15\$s</label> |
||
115 | <input type="text" name="strokeWeight" id="f-strokeweight" class="text ui-widget-content ui-corner-all"/> |
||
116 | <label for="f-fillcolor">%16\$s</label> |
||
117 | <input type="text" name="fillColor" id="f-fillcolor" class="text ui-widget-content ui-corner-all"/> |
||
118 | <label for="f-fillopacity">%17\$s</label> |
||
119 | <input type="hidden" name="fillOpacity" id="f-fillopacity" class="text ui-widget-content ui-corner-all"/> |
||
120 | </fieldset> |
||
121 | </form> |
||
122 | </div> |
||
123 | |||
124 | <div id="polygon-form" class="mapeditor-dialog" title="%4\$s"> |
||
125 | <div class="link-title-switcher"> |
||
126 | <input type="radio" name="switch" value="text" /> %5\$s |
||
127 | <input type="radio" name="switch" value="link" /> %6\$s |
||
128 | </div> |
||
129 | <form class="mapeditor-dialog-form"> |
||
130 | <fieldset> |
||
131 | <label for="p-title">%7\$s</label> |
||
132 | <input type="text" name="title" id="p-title" class="text ui-widget-content ui-corner-all"/> |
||
133 | <label for="p-text">%8\$s</label> |
||
134 | <input type="text" name="text" id="p-text" value="" class="text ui-widget-content ui-corner-all"/> |
||
135 | <label for="p-link">%9\$s</label> |
||
136 | <input type="text" name="link" id="p-link" class="text ui-widget-content ui-corner-all"/> |
||
137 | <label for="p-strokecolor">%13\$s</label> |
||
138 | <input type="text" name="strokeColor" id="p-strokecolor" class="text ui-widget-content ui-corner-all"/> |
||
139 | <label for="p-strokeopacity">%14\$s</label> |
||
140 | <input type="hidden" name="strokeOpacity" id="p-strokeopacity" class="text ui-widget-content ui-corner-all"/> |
||
141 | <label for="p-strokeweight">%15\$s</label> |
||
142 | <input type="text" name="strokeWeight" id="p-strokeweight" class="text ui-widget-content ui-corner-all"/> |
||
143 | <label for="p-fillcolor">%16\$s</label> |
||
144 | <input type="text" name="fillColor" id="p-fillcolor" class="text ui-widget-content ui-corner-all"/> |
||
145 | <label for="p-fillopacity">%17\$s</label> |
||
146 | <input type="hidden" name="fillOpacity" id="p-fillopacity" class="text ui-widget-content ui-corner-all"/> |
||
147 | <label for="p-showonhover">%18\$s</label> |
||
148 | <input type="checkbox" name="showOnHover" id="p-showonhover" class="text ui-widget-content ui-corner-all"/> |
||
149 | </fieldset> |
||
150 | </form> |
||
151 | </div> |
||
152 | <div id="map-parameter-form" class="mapeditor-dialog" title="%19\$s"> |
||
153 | <form class="mapeditor-dialog-form"> |
||
154 | <div> |
||
155 | <select name="key"> |
||
156 | <option value="">%20\$s</option> |
||
157 | </select> |
||
158 | </div> |
||
159 | </form> |
||
160 | </div> |
||
161 | <div id="imageoverlay-form" title="%22\$s"> |
||
162 | <div class="link-title-switcher"> |
||
163 | <input type="radio" name="switch" value="text" /> %5\$s |
||
164 | <input type="radio" name="switch" value="link" /> %6\$s |
||
165 | </div> |
||
166 | <form class="mapeditor-dialog-form"> |
||
167 | <fieldset> |
||
168 | <label for="i-title">%7\$s</label> |
||
169 | <input type="text" name="title" id="i-title" class="text ui-widget-content ui-corner-all"/> |
||
170 | <label for="i-text">%8\$s</label> |
||
171 | <input type="text" name="text" id="i-text" class="text ui-widget-content ui-corner-all"/> |
||
172 | <label for="i-link">%9\$s</label> |
||
173 | <input type="text" name="link" id="i-link" class="text ui-widget-content ui-corner-all"/> |
||
174 | <label for="i-image">%21\$s</label> |
||
175 | <input type="text" name="image" id="i-image" class="text ui-widget-content ui-corner-all"/> |
||
176 | </fieldset> |
||
177 | </form> |
||
178 | </div> |
||
179 | </div> |
||
180 | EOT; |
||
181 | |||
182 | $html = sprintf( |
||
183 | $output, |
||
184 | $this->msg( 'mapeditor-code-title' ), |
||
185 | $this->msg( 'mapeditor-import-title' ), |
||
186 | $this->msg( 'mapeditor-import-note' ), |
||
187 | $this->msg( 'mapeditor-form-title' ), |
||
188 | $this->msg( 'mapeditor-link-title-switcher-popup-text' ), |
||
189 | $this->msg( 'mapeditor-link-title-switcher-link-text' ), |
||
190 | $this->msg( 'mapeditor-form-field-title' ), |
||
191 | $this->msg( 'mapeditor-form-field-text' ), |
||
192 | $this->msg( 'mapeditor-form-field-link' ), |
||
193 | $this->msg( 'mapeditor-form-field-icon' ), |
||
194 | $this->msg( 'mapeditor-form-field-group' ), |
||
195 | $this->msg( 'mapeditor-form-field-inlinelabel' ), |
||
196 | $this->msg( 'mapeditor-form-field-strokecolor' ), |
||
197 | $this->msg( 'mapeditor-form-field-strokeopacity' ), |
||
198 | $this->msg( 'mapeditor-form-field-strokeweight' ), |
||
199 | $this->msg( 'mapeditor-form-field-fillcolor' ), |
||
200 | $this->msg( 'mapeditor-form-field-fillopcaity' ), |
||
201 | $this->msg( 'mapeditor-form-field-showonhover' ), |
||
202 | $this->msg( 'mapeditor-mapparam-title' ), |
||
203 | $this->msg( 'mapeditor-mapparam-defoption' ), |
||
204 | $this->msg( 'mapeditor-form-field-image' ), |
||
205 | $this->msg( 'mapeditor-imageoverlay-title' ), |
||
206 | $this->msg( 'mapeditor-form-field-visitedicon' ) |
||
207 | ); |
||
208 | |||
209 | return $html; |
||
210 | } |
||
211 | |||
224 |