Project

General

Profile

Feature #89894 » feature-89894.extensionmanager.patch

Michael Schams, 2019-12-07 00:08

View differences:

typo3/sysext/extensionmanager/Classes/Controller/ListController.php
*/
public function indexAction()
{
$filter = null;
if ($this->request->hasArgument('filter')) {
$filter = $this->request->getArgument('filter');
}
$this->addComposerModeNotification();
$availableAndInstalledExtensions = $this->listUtility->getAvailableAndInstalledExtensionsWithAdditionalInformation();
$availableAndInstalledExtensions = $this->listUtility->getAvailableAndInstalledExtensionsWithAdditionalInformation($filter);
ksort($availableAndInstalledExtensions);
$this->view->assignMultiple(
[
typo3/sysext/extensionmanager/Classes/Utility/ListUtility.php
/**
* Returns the list of available, but not necessarily loaded extensions
*
* @param null|string
* @return array[] All extensions with info
*/
public function getAvailableExtensions()
public function getAvailableExtensions($filter = null)
{
if ($this->availableExtensions === null) {
$this->availableExtensions = [];
$this->emitPackagesMayHaveChangedSignal();
foreach ($this->packageManager->getAvailablePackages() as $package) {
$installationType = $this->getInstallTypeForPackage($package);
$this->availableExtensions[$package->getPackageKey()] = [
'siteRelPath' => str_replace(Environment::getPublicPath() . '/', '', $package->getPackagePath()),
'type' => $installationType,
'key' => $package->getPackageKey(),
'ext_icon' => ExtensionManagementUtility::getExtensionIcon($package->getPackagePath()),
];
if ($filter == null || $filter == $installationType) {
$this->availableExtensions[$package->getPackageKey()] = [
'siteRelPath' => str_replace(Environment::getPublicPath() . '/', '', $package->getPackagePath()),
'type' => $installationType,
'key' => $package->getPackageKey(),
'ext_icon' => ExtensionManagementUtility::getExtensionIcon($package->getPackagePath()),
];
}
}
}
......
* Gets all available and installed extension with additional information
* from em_conf and TER (if available)
*
* @param null|string
* @return array
*/
public function getAvailableAndInstalledExtensionsWithAdditionalInformation()
public function getAvailableAndInstalledExtensionsWithAdditionalInformation($filter = null)
{
$availableExtensions = $this->getAvailableExtensions();
$availableExtensions = $this->getAvailableExtensions($filter);
$availableAndInstalledExtensions = $this->getAvailableAndInstalledExtensions($availableExtensions);
$availableAndInstalledExtensions = $this->enrichExtensionsWithIconInformation($availableAndInstalledExtensions);
return $this->enrichExtensionsWithEmConfAndTerInformation($availableAndInstalledExtensions);
typo3/sysext/extensionmanager/Resources/Private/Language/locallang.xlf
<trans-unit id="extensionList.search" resname="extensionList.search">
<source>Search</source>
</trans-unit>
<trans-unit id="extensionList.filter.showAll" resname="extensionList.filter.showAll">
<source>All</source>
</trans-unit>
<trans-unit id="extensionList.filter.showSystemExtensions" resname="extensionList.filter.showSystemExtensions">
<source>System</source>
</trans-unit>
<trans-unit id="extensionList.filter.showLocalExtensions" resname="extensionList.filter.showLocalExtensions">
<source>Local</source>
</trans-unit>
<trans-unit id="searchTemplate.submitButton" resname="searchTemplate.submitButton">
<source>Go</source>
</trans-unit>
typo3/sysext/extensionmanager/Resources/Private/Templates/List/Index.html
<f:section name="content">
<f:render partial="List/UploadForm" />
<form class="form-inline">
<div class="form-group">
<f:form.textfield name="Tx_Extensionmanager_extensionkey" placeholder="{f:translate(key:'extensionList.search')}" id="Tx_Extensionmanager_extensionkey" value="{search}" class="form-control" />
<div class="row">
<div class="col-sm-6">
<div class="form-group">
<f:form.textfield name="Tx_Extensionmanager_extensionkey" placeholder="{f:translate(key:'extensionList.search')}" id="Tx_Extensionmanager_extensionkey" value="{search}" class="form-control" />
</div>
</div>
<div class="col-sm-6">
<div class="pull-right">
<f:link.action
action="index"
controller="List"
title="{f:translate(key:'extensionList.filter.showAll')}"
class="btn btn-default"
style="width: 80px;">
<f:translate key="extensionList.filter.showAll" />
</f:link.action>
<f:link.action
action="index"
controller="List"
arguments="{filter:'System'}"
title="{f:translate(key:'extensionList.filter.showSystemExtensions')}"
class="btn btn-default"
style="width: 80px;">
<f:translate key="extensionList.filter.showSystemExtensions" />
</f:link.action>
<f:link.action
action="index"
controller="List"
arguments="{filter:'Local'}"
title="{f:translate(key:'extensionList.filter.showLocalExtensions')}"
class="btn btn-default"
style="width: 80px;">
<f:translate key="extensionList.filter.showLocalExtensions" />
</f:link.action>
</div>
</div>
</div>
</form>
<br>
(2-2/2)