Code Duplication    Length = 25-25 lines in 3 locations

htdocs/class/xoopseditor/fckeditor/fckeditor/editor/plugins/ImageManager/images.php 1 location

@@ 154-178 (lines=25) @@
151
        //we need to refesh the drop directory list
152
        //save the current dir, delete all select options
153
        //add the new list, re-select the saved dir.
154
        if($refreshDir)
155
        {
156
                $dirs = $manager->getDirs();
157
?>
158
                var selection = topDoc.getElementById('dirPath');
159
                var currentDir = selection.options[selection.selectedIndex].text;
160
161
                while(selection.length > 0)
162
                {        selection.remove(0); }
163
164
                selection.options[selection.length] = new Option("/","<?php echo rawurlencode('/'); ?>");
165
                <?php foreach($dirs as $relative=>$fullpath) { ?>
166
                selection.options[selection.length] = new Option("<?php echo $relative; ?>","<?php echo rawurlencode($relative); ?>");
167
                <?php } ?>
168
169
                for(var i = 0; i < selection.length; i++)
170
                {
171
                        var thisDir = selection.options[i].text;
172
                        if(thisDir == currentDir)
173
                        {
174
                                selection.selectedIndex = i;
175
                                break;
176
                        }
177
                }
178
<?php } ?>
179
        }
180
181
        function editImage(image)

htdocs/class/xoopseditor/xinha/plugins/ExtendedFileManager/images.php 1 location

@@ 358-382 (lines=25) @@
355
	//we need to refesh the drop directory list
356
	//save the current dir, delete all select options
357
	//add the new list, re-select the saved dir.
358
	if($refreshDir) 
359
	{ 
360
		$dirs = $manager->getDirs();
361
?>
362
		var selection = topDoc.getElementById('dirPath');
363
		var currentDir = selection.options[selection.selectedIndex].text;
364
365
		while(selection.length > 0)
366
		{	selection.remove(0); }
367
		
368
		selection.options[selection.length] = new Option("/","<?php echo rawurlencode('/'); ?>");
369
		<?php foreach($dirs as $relative=>$fullpath) { ?>
370
		selection.options[selection.length] = new Option("<?php echo $relative; ?>","<?php echo rawurlencode($relative); ?>");
371
		<?php } ?>
372
		
373
		for(var i = 0; i < selection.length; i++)
374
		{
375
			var thisDir = selection.options[i].text;
376
			if(thisDir == currentDir)
377
			{
378
				selection.selectedIndex = i;
379
				break;
380
			}
381
		}		
382
<?php } ?>
383
	}
384
    
385
	function editImage(image) 

htdocs/class/xoopseditor/xinha/plugins/ImageManager/images.php 1 location

@@ 270-294 (lines=25) @@
267
	//we need to refesh the drop directory list
268
	//save the current dir, delete all select options
269
	//add the new list, re-select the saved dir.
270
	if($refreshDir) 
271
	{ 
272
		$dirs = $manager->getDirs();
273
?>
274
		var selection = topDoc.getElementById('dirPath');
275
		var currentDir = selection.options[selection.selectedIndex].text;
276
277
		while(selection.length > 0)
278
		{	selection.remove(0); }
279
		
280
		selection.options[selection.length] = new Option("/","<?php echo rawurlencode('/'); ?>");	
281
		<?php foreach($dirs as $relative=>$fullpath) { ?>
282
		selection.options[selection.length] = new Option("<?php echo $relative; ?>","<?php echo rawurlencode($relative); ?>");		
283
		<?php } ?>
284
		
285
		for(var i = 0; i < selection.length; i++)
286
		{
287
			var thisDir = selection.options[i].text;
288
			if(thisDir == currentDir)
289
			{
290
				selection.selectedIndex = i;
291
				break;
292
			}
293
		}		
294
<?php } ?>
295
    update_selected();
296
	}	
297