Code Duplication    Length = 11-11 lines in 2 locations

calendar/inc/class.calendar_uiforms.inc.php 2 locations

@@ 648-658 (lines=11) @@
645
			$content['link_to']['to_id'] = array('to_app' => 'calendar', 'to_id' => 0);
646
			foreach(Link::get_links('calendar', $content['id']) as $link)
647
			{
648
				if ($link['app'] != Link::VFS_APPNAME)
649
				{
650
					Link::link('calendar', $content['link_to']['to_id'], $link['app'], $link['id'], $link['remark']);
651
				}
652
				elseif ($link['app'] == Link::VFS_APPNAME)
653
				{
654
					Link::link('calendar', $content['link_to']['to_id'], Link::VFS_APPNAME, array(
655
						'tmp_name' => Link::vfs_path($link['app2'], $link['id2']).'/'.$link['id'],
656
						'name' => $link['id'],
657
					), $link['remark']);
658
				}
659
			}
660
			unset($link);
661
			$preserv['view'] = $preserv['edit_single'] = false;
@@ 1124-1134 (lines=11) @@
1121
		foreach(Link::get_links($event['link_to']['to_app'], $event['id']) as $link)
1122
		{
1123
			if(!$link['id']) continue;
1124
			if ($link['app'] != Link::VFS_APPNAME)
1125
			{
1126
				Link::link('calendar', $event['link_to']['to_id'], $link['app'], $link['id'], $link['remark']);
1127
			}
1128
			elseif ($link['app'] == Link::VFS_APPNAME)
1129
			{
1130
				Link::link('calendar', $event['link_to']['to_id'], Link::VFS_APPNAME, array(
1131
					'tmp_name' => Link::vfs_path($link['app2'], $link['id2']).'/'.$link['id'],
1132
					'name' => $link['id'],
1133
				), $link['remark']);
1134
			}
1135
		}
1136
1137
		$event['links'] = $event['link_to'];