{namespace em=TYPO3\CMS\Extensionmanager\ViewHelpers}

<f:layout name="main" />

<f:section name="docheader-buttons">
	<f:be.buttons.icon uri="{f:uri.action(action:'form',controller:'UploadExtensionFile')}" icon="actions-edit-upload" title="{f:translate(key:'extensionList.uploadExtension')}"/>
</f:section>

<f:section name="module-headline">
	<h1><f:translate key="manageExtensions">Manage extensions</f:translate></h1>
</f:section>

<f:section name="Content">
	<f:flashMessages renderMode="div" />

	<f:render partial="List/UploadForm" />

	<div class="headerRow ui-helper-clearfix">
		<div class="typo3-extensionmanager-headerRowLeft">
		</div>
		<div class="typo3-extensionmanager-headerRowRight">
		</div>
	</div>
	<table id="typo3-extension-list" class="t3-table typo3-extension-list">
		<thead>
			<tr>
				<th title="{f:translate(key:'extensionList.header.title.update')}"><f:translate key="extensionList.header.update"/></th>
				<th title="{f:translate(key:'extensionList.header.title.activate')}"><f:translate key="extensionList.header.activate"/></th>
				<th><f:translate key="extensionList.header.extensionName"/></th>
				<th><f:translate key="extensionList.header.extensionKey"/></th>
				<th><f:translate key="extensionList.header.extensionVersion"/></th>
				<th><f:translate key="extensionList.header.extensionActions"/></th>
				<th><f:translate key="extensionList.header.extensionState"/></th>
			</tr>
		</thead>
		<tbody>
			<f:for each="{extensions}" as="extension" key="extensionKey">
				<f:if condition="{extension.terObject}">
					<f:then>
						<tr id="{extensionKey}" class="{f:if(condition:'{extension.terObject.reviewState} == -1', then:'insecure')}{f:if(condition:'{extension.terObject.reviewState} == -2', then:'outdated')} {f:if(condition:'{extension.installed}', then: '', else: 'inactive')}">
					</f:then>
					<f:else>
						<tr id="{extensionKey}" class="{f:if(condition:'{extension.installed}', then: '', else: 'inactive')}">
					</f:else>
				</f:if>
				<td>
					<f:if condition="{extension.updateAvailable}">
						<f:if condition="{extension.state} == 'excludeFromUpdates'">
							<f:then>
								<f:be.buttons.icon
									icon="actions-system-extension-update-disabled"
									title="{f:translate(key:'extensionList.updateDisabled')}"
								/>
							</f:then>
							<f:else>
								<f:be.buttons.icon
									uri="{f:uri.action(action:'updateCommentForUpdatableVersions',controller:'Download',arguments:{extension:extension.key, integerVersionStart: extension.terObject.integerVersion, integerVersionStop: extension.updateToVersion.integerVersion},format:'json')}"
									icon="actions-system-extension-update"
									title="{f:translate(key:'extensionList.updateToVersion', arguments:{0:extension.updateToVersion.version})}"
								/>
							</f:else>
						</f:if>
					</f:if>
				</td>
				<td>
					<em:toggleExtensionInstallationState extension="{extension}" />
				</td>
				<f:if condition="{extension.description}">
					<f:then>
						<td title="{extension.description}">
					</f:then>
					<f:else>
						<td>
					</f:else>
				</f:if>
					<f:if condition="{extension.ext_icon}">
						<img class="ext-icon" src="../{extension.siteRelPath}{extension.ext_icon}" alt="{extension.title}" />
					</f:if>
					<em:configureExtension extension="{extension}" forceConfiguration="0" showDescription="1">{extension.title}</em:configureExtension>
				</td>
				<td>
					{extensionKey}
				</td>
				<td>
					{extension.version}
				</td>
				<td class="icons">
					<em:processAvailableActions extension="{extension}">
						<em:configureExtension extension="{extension}"><f:be.buttons.icon icon="actions-system-extension-configure" title="{f:translate(key:'extensionList.configure')}" /></em:configureExtension>
						<em:updateScript extensionKey="{extension.key}" />
						<em:removeExtension extension="{extension}" />
						<f:be.buttons.icon uri="{f:uri.action(action:'downloadExtensionZip',controller:'Action',arguments:'{extension:extension.key}')}" icon="actions-system-extension-download" title="{f:translate(key:'extensionList.downloadzip')}"/>
						<em:downloadExtensionData extension="{extension}" />
					</em:processAvailableActions>
				</td>
				<td class="state {extension.state}">
					{extension.state}
				</td>
				</tr>
			</f:for>
		</tbody>
	</table>
</f:section>


