Code Duplication    Length = 7-7 lines in 2 locations

main/document/create_document.php 1 location

@@ 423-429 (lines=7) @@
420
			foreach ($folders as & $folder) {
421
				$selected = (substr($dir, 0, -1) == $folder) ? ' selected="selected"' : '';
422
				$label = $folder_titles[$folder];
423
				if ($folder == $group_dir) {
424
					$label = '/ (' . get_lang('HomeDirectory') . ')';
425
				} else {
426
					$path_parts = explode('/', str_replace($group_dir, '', $folder));
427
					$label = cut($label, 80);
428
					$label = str_repeat('   ', count($path_parts) - 2) . ' — ' . $label;
429
				}
430
				$parent_select->addOption($label, $folder);
431
				if ($selected != '') {
432
					$parent_select->setSelected($folder);

main/inc/lib/document.lib.php 1 location

@@ 5197-5203 (lines=7) @@
5194
                foreach ($folders as $folder_id => & $folder) {
5195
                    $selected = ($document_id == $folder_id) ? ' selected="selected"' : '';
5196
                    $label = $folder_titles[$folder];
5197
                    if ($folder == $group_dir) {
5198
                        $label = get_lang('Documents');
5199
                    } else {
5200
                        $path_parts = explode('/', str_replace($group_dir, '', $folder));
5201
                        $label = cut($label, 80);
5202
                        $label = str_repeat('   ', count($path_parts) - 2) . ' — ' . $label;
5203
                    }
5204
                    $parent_select->addOption($label, $folder_id);
5205
                    if ($selected != '') {
5206
                        $parent_select->setSelected($folder_id);