<%@ include file="/includes.jsp" %>
<%@ taglib prefix="smvc" uri="http://www.springframework.org/tags/form"%>
<br/>
<smvc:form action="../admin/moduleAccessAction.form">
	<input type="hidden" name="redirectParams" value="<c:out value="${requestScope['javax.servlet.forward.query_string']}" />" />
	<table>
		<tr>
			<td>
				<tags:dialogBox title="Module Access">
					<table>
						<tr>
							<td>Module</td>
							<td>Roles</td>
						</tr>
						<tr>
							<td colspan="2"><hr/></td>
						</tr>
						<c:forEach var="module" items="${webapp.modules}">
							<tr>
								<td><img style="vertical-align: bottom; " width="16" height="16" src="../<c:out value="${module.moduleInfo.name}"/>/<c:out value="${module.moduleInfo.icon}"/>"/> <c:out value="${module.moduleInfo.label}"/></td>
								<td>
									<c:forEach var="role" items="${webapp.roles}">
										<smvc:checkbox path="moduleRoles(${module.moduleInfo.name})" value="${role.name}"/>&nbsp;<c:out value="${role.name}"/><br/>
									</c:forEach>
								</td>
							</tr>
							<tr>
								<td colspan="2"><hr/></td>
							</tr>
						</c:forEach>
						<tr>
							<td colspan="2" align="right">
								<input type="reset"/>&nbsp;<input type="submit" value="Save"/>
							</td>
						</tr>
					</table>
				</tags:dialogBox>
			</td>
		</tr>
	</table>
</smvc:form>
