{namespace bu = TYPO3\CMS\Beuser\ViewHelpers}

<f:layout name="Default" />

<f:section name="iconButtons">
	<f:link.action action="index"><bu:spriteManagerIcon iconName="actions-view-go-back" /></f:link.action>
</f:section>

<f:section name="headline">
	<h1><f:translate key="compareBackendUsers">Compare backend users</f:translate></h1>
</f:section>

<f:section name="content">
	<table border="0" cellpadding="0" cellspacing="0" id="tx_beuser_compare" class="t3-table">
		<thead>
			<tr class="t3-row-header">
				<th class="label"></th>
				<f:for each="{compareUserList}" as="compareUser">
					<th>
						<a href="#" onClick="Clickmenu.show('be_users', '{compareUser.uid}', '1', '', '', ''); return false;" title="id={compareUser.uid}">
							<bu:spriteIconForRecord table="be_users" object="{compareUser}" /></a>
						{compareUser.userName}
					</th>
				</f:for>
			</tr>
		</thead>
		<tbody>
			<tr>
				<td><h5><f:translate key="realName">Real name</f:translate></h5></td>
				<f:for each="{compareUserList}" as="compareUser">
					<td>{compareUser.realName}</td>
				</f:for>
			</tr>
			<tr>
				<td><h5><f:translate key="email">Email</f:translate></h5></td>
				<f:for each="{compareUserList}" as="compareUser">
					<td>
						<f:if condition="{compareUser.email}">
							<f:then>
								<f:link.email email="{compareUser.email}" />
							</f:then>
							<f:else>
								-
							</f:else>
						</f:if>
					</td>
				</f:for>
			</tr>
			<tr>
				<td><h5><f:translate key="admin">Admin</f:translate></h5></td>
				<f:for each="{compareUserList}" as="compareUser">
					<td>
						<f:if condition="{compareUser.isAdministrator}">
							<f:then>
								<f:translate key="yes">Yes</f:translate>
							</f:then>
							<f:else>
								<f:translate key="no">No</f:translate>
							</f:else>
						</f:if>
					</td>
				</f:for>
			</tr>
			<tr>
				<td><h5><f:translate key="disable">Disable</f:translate></h5></td>
				<f:for each="{compareUserList}" as="compareUser">
					<td>
						<f:if condition="{compareUser.isDisabled} == 1">
							<f:then>
								<a href="<bu:issueCommand parameters="tce_db.php?&data[be_users][{compareUser.uid}][disable]=0&redirect={redirectUrl}" />">
									<bu:spriteManagerIcon iconName="actions-edit-unhide" options="{title: 'unhide'}" />
								</a>
							</f:then>
							<f:else>
								<a href="<bu:issueCommand parameters="tce_db.php?&data[be_users][{compareUser.uid}][disable]=1&redirect={redirectUrl}" />">
									<bu:spriteManagerIcon iconName="actions-edit-hide" options="{title: 'hide'}" />
								</a>
							</f:else>
						</f:if>
					</td>
				</f:for>
			</tr>
			<tr>
				<td><h5><f:translate key="startDateAndTime" /></h5></td>
				<f:for each="{compareUserList}" as="compareUser">
					<td>
						<f:if condition="{compareUser.startDateAndTime}">
							<f:then>
								<f:format.date format="{dateFormat} {timeFormat}">{compareUser.startDateAndTime}</f:format.date>
							</f:then>
							<f:else>
								-
							</f:else>
						</f:if>
					</td>
				</f:for>
			</tr>
			<tr>
				<td><h5><f:translate key="endDateAndTime" /></h5></td>
				<f:for each="{compareUserList}" as="compareUser">
					<td>
						<f:if condition="{compareUser.endDateAndTime}">
							<f:then>
								<f:format.date format="{dateFormat} {timeFormat}">{compareUser.endDateAndTime}</f:format.date>
							</f:then>
							<f:else>
								-
							</f:else>
						</f:if>
					</td>
				</f:for>
			</tr>
			<tr>
				<td><h5><f:translate key="lastLogin">Last login</f:translate></h5></td>
				<f:for each="{compareUserList}" as="compareUser">
					<td>
						<f:if condition="{compareUser.lastLoginDateAndTime}">
							<f:then>
								<f:format.date format="{dateFormat} {timeFormat}">{compareUser.lastLoginDateAndTime}</f:format.date>
							</f:then>
							<f:else>
								<f:translate key="never">Never</f:translate>
							</f:else>
						</f:if>
					</td>
				</f:for>
			</tr>
			<tr>
				<td><h5><f:translate key="backendUserGroups">Member of groups</f:translate></h5></td>
				<f:for each="{compareUserList}" as="compareUser">
					<td>
						<f:for each="{compareUser.BackendUserGroups}" as="backendUserGroup">
							<a href="#" onClick="Clickmenu.show('be_groups', '{backendUserGroup.uid}', '1', '', '', ''); return false;" title="id={backendUserGroup.uid}">
								<bu:spriteIconForRecord table="be_users" object="{backendUserGroup}" />
							</a>
							{backendUserGroup.title}<br />
						</f:for>
					</td>
				</f:for>
			</tr>
			<tr>
				<td><h5><f:translate key="allowedLanguages">Limit to languages</f:translate></h5></td>
				<f:for each="{compareUserList}" as="compareUser">
					<td>
						<f:if condition="{compareUser.allowedLanguages}">
							<f:then>
								<bu:display.sysLanguage uids="{compareUser.allowedLanguages}" />
							</f:then>
							<f:else>
								-
							</f:else>
						</f:if>
					</td>
				</f:for>
			</tr>
			<tr>
				<td><h5><f:translate key="dbMountPoints">DB mountpoints</f:translate></h5></td>
				<f:for each="{compareUserList}" as="compareUser">
					<td>
						<f:if condition="{compareUser.dbMountPoints}">
							<f:then>
								<bu:display.pages uids="{compareUser.dbMountPoints}" />
							</f:then>
							<f:else>
								-
							</f:else>
						</f:if>
					</td>
				</f:for>
			</tr>
			<tr>
				<td><h5><f:translate key="fileMounts">File mountpoints</f:translate></h5></td>
				<f:for each="{compareUserList}" as="compareUser">
					<td>
						<f:if condition="{compareUser.fileMountPoints}">
							<f:then>
								<bu:display.sysFileMounts uids="{compareUser.fileMountPoints}" />
							</f:then>
							<f:else>
								-
							</f:else>
						</f:if>
					</td>
				</f:for>
			</tr>
			<tr>
				<td><h5><f:translate key="disableIpLock">Disable IP lock</f:translate></h5></td>
				<f:for each="{compareUserList}" as="compareUser">
					<td>
						<f:if condition="{compareUser.ipLockIsDisabled} == 1">
							<f:then>
								<f:translate key="yes">Yes</f:translate>
							</f:then>
							<f:else>
								<f:translate key="no">No</f:translate>
							</f:else>
						</f:if>
					</td>
				</f:for>
			</tr>
		</table>
	</table>
</f:section>