
<div class="alert alert-notice">
	<h4>About</h4>
	<p>
		TYPO3 uses this directory for temporary files, mainly processed and cached images.
		The filenames are cryptic. They are unique representations of the file properties
		made by md5-hashing a serialized array with information.
	</p>
	<p>
		This directory may contain many thousands of files and a lot of them may be of no use anymore.
	</p>
	<p>
		With this action you can delete the files in this folder. Afterwards, you
		should also clear the cache database tables.
	</p>
	<p>
		This tool will delete files only if the last 10 characters before the file extension
		('.' + 3 chars) are hexadecimal valid ciphers, which are lowercase a-f and 0-9.
	</p>
</div>

<form method="post" class="form-horizontal">
<div class="row">
	<div class="col-sm-4"><strong class="pull-right">Number of temporary files</strong></div>
	<div class="col-sm-8">{typo3TempData.numberOfFilesInSelectedDirectory}</div>
</div>
<div class="row">
	<div class="col-sm-4"><strong class="pull-right">Number matching</strong></div>
	<div class="col-sm-8">{typo3TempData.numberOfFilesMatchingCriteria}	</div>
</div>
<div class="row">
	<div class="col-sm-4"><strong class="pull-right">Number deleted</strong></div>
	<div class="col-sm-8">{typo3TempData.numberOfDeletedFiles}</div>
</div>
<br>
<div class="row">
	<div class="form-group">
		<label for="t3-install-delete" class="col-sm-4 control-label">Delete files by condition</label>
		<div class="col-sm-7">
			<select
					id="t3-install-delete"
					name="install[values][condition]"
					class="form-control"
					>
				<option value="0">All</option>
				<option value="day" {f:if(condition:'{typo3TempData.selectedCondition} == \'day\'', then:'selected="selected"')}>Last access more than a day ago</option>
				<option value="week" {f:if(condition:'{typo3TempData.selectedCondition} == \'week\'', then:'selected="selected"')}>Last access more than a week ago</option>
				<option value="month" {f:if(condition:'{typo3TempData.selectedCondition} == \'month\'', then:'selected="selected"')}>Last access more than a month ago</option>
				<option value="10" {f:if(condition:'{typo3TempData.selectedCondition} == \'10\'', then:'selected="selected"')}>File size greater than 10K</option>
				<option value="50" {f:if(condition:'{typo3TempData.selectedCondition} == \'50\'', then:'selected="selected"')}>File size greater than 50K</option>
				<option value="100" {f:if(condition:'{typo3TempData.selectedCondition} == \'100\'', then:'selected="selected"')}>File size greater than 100K</option>
			</select>
		</div>
	</div>
	<div class="form-group">
		<label for="t3-install-action" class="col-sm-4 control-label">Number of files at a time</label>
		<div class="col-sm-7">
			<select
					id="t3-install-action"
					name="install[values][numberOfFiles]"
					class="form-control"
					>
				<option value="0">Don't delete, just display statistics</option>
				<option value="500" {f:if(condition:'{typo3TempData.numberOfFiles} == \'500\'', then:'selected="selected"')}>Delete 500</option>
				<option value="1000" {f:if(condition:'{typo3TempData.numberOfFiles} == \'1000\'', then:'selected="selected"')}>Delete 1000</option>
				<option value="5000" {f:if(condition:'{typo3TempData.numberOfFiles} == \'5000\'', then:'selected="selected"')}>Delete 5000</option>
			</select>
		</div>
	</div>

	<div class="form-group">
		<label for="t3-install-subdirectory" class="col-sm-4 control-label">From sub-directory</label>
		<div class="col-sm-7">
			<select
				id="t3-install-subdirectory"
				name="install[values][subDirectory]"
				class="form-control"
				>
			<f:for each="{typo3TempData.subDirectories}" as="subDirectory">
				<option
						value="{subDirectory.name}"
						{f:if(condition:subDirectory.selected, then:'selected="selected"')}
				>
				<f:if condition="{subDirectory.name}">
					{subDirectory.name}/ (Files: {subDirectory.filesNumber})
				</f:if>
				</option>
			</f:for>
			</select>
		</div>
	</div>
	<f:render partial="Action/Common/HiddenFormFields" arguments="{_all}" />
	<div class="col-sm-12">
		<f:render
			partial="Action/Common/SubmitButton"
			arguments="{name:'deleteTypo3TempFiles', text:'Empty selected folders'}"
		/>
	</div>
</div>
</form>
