Code Duplication    Length = 39-39 lines in 2 locations

class/class.datafield.php 1 location

@@ 133-171 (lines=39) @@
130
            case "radio":
131
                return $myts->makeTboxData4Show($value);
132
                break;
133
            case "rating":
134
                $xoops_url = XOOPS_URL;
135
                switch ($value) {
136
                    case 1:
137
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_1.gif";
138
                        break;
139
                    case 2:
140
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_2.gif";
141
                        break;
142
                    case 3:
143
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_3.gif";
144
                        break;
145
                    case 4:
146
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_4.gif";
147
                        break;
148
                    case 5:
149
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_5.gif";
150
                        break;
151
                    case 6:
152
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_6.gif";
153
                        break;
154
                    case 7:
155
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_7.gif";
156
                        break;
157
                    case 8:
158
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_8.gif";
159
                        break;
160
                    case 9:
161
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_9.gif";
162
                        break;
163
                    case 10:
164
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_10.gif";
165
                        break;
166
                    default:
167
                        $src = "";
168
                }
169
                $rating = "<img src=\"$src\" />";
170
171
                return $rating;
172
                break;
173
            case "select":
174
                return $myts->makeTboxData4Show($value);

class/class.datafieldmanager.php 1 location

@@ 233-271 (lines=39) @@
230
                return $myts->htmlSpecialChars($value);
231
            case 'dhtml':
232
                return $myts->displayTarea($value);
233
            case 'rating':
234
                $xoops_url = XOOPS_URL;
235
                switch ($value) {
236
                    case 1:
237
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_1.gif";
238
                        break;
239
                    case 2:
240
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_2.gif";
241
                        break;
242
                    case 3:
243
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_3.gif";
244
                        break;
245
                    case 4:
246
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_4.gif";
247
                        break;
248
                    case 5:
249
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_5.gif";
250
                        break;
251
                    case 6:
252
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_6.gif";
253
                        break;
254
                    case 7:
255
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_7.gif";
256
                        break;
257
                    case 8:
258
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_8.gif";
259
                        break;
260
                    case 9:
261
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_9.gif";
262
                        break;
263
                    case 10:
264
                        $src = "$xoops_url/modules/$moddir/assets/images/rating_10.gif";
265
                        break;
266
                    default:
267
                        $src = '';
268
                }
269
                $rating = "<img src=\"$src\">";
270
271
                return $rating;
272
            case 'address':
273
                $fieldtitles   = array(
274
                    'address'  => _MD_DF_ADDRESS,