##<!-- $Header: /cvs/sakai2/legacy/tools/src/webapp/vm/sitesetup/chef_site-importSites.vm,v 1.3 2005/05/25 20:24:30 zqian.umich.edu Exp $ -->
<div class="portletBody">
	<h3>
		$tlang.getString("import.reuse")
	</h3>
	<p class="step">
		$tlang.getString("import.reuse2")
	</p>
	<p class="instruction">
	$tlang.getString("import.choose")
	</p>
	<form name="importSitesForm" action="#toolForm("$action")" method="post">
		<table class ="listHier lines nolines" cellspacing="0" summary="$tlang.getString("import.choose.list.summary")" border="0">
			<tr>
				<th>
					&nbsp;
				</th>
				#foreach($site in $importSites.keys())
					<th>
						$validator.escapeHtml($site.getTitle())
					</th>
				#end
			</tr>
			#set ($toolCount=0)
			#foreach($toolId in $selectedTools)
			#set($selectedSites = $!importSitesTools.get($toolId))
			#set ($toolCount=$toolCount + 1)
				#if ($importSupportedTools.contains($toolId))
					<tr>
						<td>
							#set($toolTitle = "")
							#foreach($t in $toolRegistrationList)
								#if ($t.getId() == $toolId)
									#set($toolTitle = $t.getTitle())
								#end
							#end
							<h4>$toolTitle</h4>
						</td>
						#set ($siteCount=0)
						#foreach($site in $importSites.keys())
						#set ($siteCount=$siteCount + 1)
							<td>
								#set($toolFound = false)
								#set($allPages = $site.getPages())
								#foreach ($page in $allPages)
									#set($pageTools = $page.getTools())
									#foreach ($pageTool in $pageTools)
										#if ($pageTool.getTool().getId() == $toolId)
											#set($toolFound = true)
										#end
									#end
								#end
								#if ($toolFound)
									<input type="checkbox" id="toolSite$toolCount$siteCount" name="$toolId" value="$site.Id" #if($!selectedSites.contains($site.Id))checked="checked"#end />
									<label  class="skip" for="toolSite$toolCount$siteCount">$tlang.getString('import.choose.label1')  $toolTitle $tlang.getString('import.choose.label2') $validator.escapeHtml($site.getTitle())</label>
								#else
									<input type="checkbox" id="toolSite$toolCount$siteCount"  name="$toolId" value="$site.Id" disabled="disabled" />
								#end
							</td>
						#end
					</tr>
				#end
			#end
		</table>
		<input type="hidden" name="back" value="$back" />
		<input type="hidden" name="template-index" value="27" />
		<input type="hidden" name="continue" value="$continue" />
		<p class="act">
			<input type="submit" accesskey="s" class="active" name="eventSubmit_doContinue" value="$tlang.getString('gen.continue')" />
			<input type="submit" accesskey="b" name="eventSubmit_doBack" value="$tlang.getString('gen.back')" />
			<input type="submit" accesskey="x"  name="eventSubmit_doCancel" value="$tlang.getString('gen.cancel')" />
		</p>
	</form>
</div>
