mirror of
https://github.com/Codappix/search_core.git
synced 2024-11-27 00:56:12 +01:00
[TASK] Revert to only one plugin based on feedback
This commit is contained in:
parent
2ee4a88a67
commit
b8d708874e
8 changed files with 28 additions and 68 deletions
|
@ -45,7 +45,7 @@ class ConfigurationContainer implements ConfigurationContainerInterface
|
||||||
$this->settings = $configurationManager->getConfiguration(
|
$this->settings = $configurationManager->getConfiguration(
|
||||||
ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS,
|
ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS,
|
||||||
'SearchCore',
|
'SearchCore',
|
||||||
'Results'
|
'Search'
|
||||||
);
|
);
|
||||||
if ($this->settings === null) {
|
if ($this->settings === null) {
|
||||||
throw new NoConfigurationException('Could not fetch configuration.', 1484226842);
|
throw new NoConfigurationException('Could not fetch configuration.', 1484226842);
|
||||||
|
|
|
@ -3,21 +3,12 @@
|
||||||
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
|
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
|
||||||
|
|
||||||
call_user_func(function ($extension, $table) {
|
call_user_func(function ($extension, $table) {
|
||||||
$plugin = ExtensionUtility::registerPlugin(
|
ExtensionUtility::registerPlugin(
|
||||||
'Codappix.' . $extension,
|
'Codappix.' . $extension,
|
||||||
'Results',
|
'Search',
|
||||||
'LLL:EXT:search_core/Resources/Private/Language/locallang_be.xlf:plugin.results.title',
|
'LLL:EXT:search_core/Resources/Private/Language/locallang_be.xlf:plugin.search.title',
|
||||||
'EXT:search_core/Resources/Public/Icons/PluginResults.svg'
|
'plugin-' . $extension . '-search'
|
||||||
) ?? 'searchcore_results';
|
);
|
||||||
|
|
||||||
$GLOBALS['TCA'][$table]['types']['list']['subtypes_excludelist'][$plugin] = 'recursive,pages';
|
$GLOBALS['TCA'][$table]['types']['list']['subtypes_excludelist']['searchcore_search'] = 'recursive,pages';
|
||||||
|
|
||||||
$plugin = ExtensionUtility::registerPlugin(
|
|
||||||
'Codappix.' . $extension,
|
|
||||||
'Form',
|
|
||||||
'LLL:EXT:search_core/Resources/Private/Language/locallang_be.xlf:plugin.form.title',
|
|
||||||
'EXT:search_core/Resources/Public/Icons/PluginForm.svg'
|
|
||||||
) ?? 'searchcore_form';
|
|
||||||
|
|
||||||
$GLOBALS['TCA'][$table]['types']['list']['subtypes_excludelist'][$plugin] = 'recursive,pages';
|
|
||||||
}, 'search_core', 'tt_content');
|
}, 'search_core', 'tt_content');
|
||||||
|
|
|
@ -1,22 +1,12 @@
|
||||||
mod.wizards.newContentElement.wizardItems.plugins {
|
mod.wizards.newContentElement.wizardItems.plugins {
|
||||||
elements {
|
elements {
|
||||||
searchcore_results {
|
searchcore_search {
|
||||||
title = LLL:EXT:search_core/Resources/Private/Language/locallang_be.xlf:plugin.results.title
|
title = LLL:EXT:search_core/Resources/Private/Language/locallang_be.xlf:plugin.search.title
|
||||||
description = LLL:EXT:search_core/Resources/Private/Language/locallang_be.xlf:plugin.results.description
|
description = LLL:EXT:search_core/Resources/Private/Language/locallang_be.xlf:plugin.search.description
|
||||||
iconIdentifier = plugin-search_core-results
|
iconIdentifier = plugin-search_core-search
|
||||||
tt_content_defValues {
|
tt_content_defValues {
|
||||||
CType = list
|
CType = list
|
||||||
list_type = searchcore_results
|
list_type = searchcore_search
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
searchcore_form {
|
|
||||||
title = LLL:EXT:search_core/Resources/Private/Language/locallang_be.xlf:plugin.form.title
|
|
||||||
description = LLL:EXT:search_core/Resources/Private/Language/locallang_be.xlf:plugin.form.description
|
|
||||||
iconIdentifier = plugin-search_core-form
|
|
||||||
tt_content_defValues {
|
|
||||||
CType = list
|
|
||||||
list_type = searchcore_form
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,18 +3,12 @@
|
||||||
<file source-language="en" datatype="plaintext" original="messages">
|
<file source-language="en" datatype="plaintext" original="messages">
|
||||||
<header/>
|
<header/>
|
||||||
<body>
|
<body>
|
||||||
<trans-unit id="plugin.results.title">
|
<trans-unit id="plugin.search.title">
|
||||||
<source>Search Core: Results</source>
|
<source>Search Core: Search</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="plugin.results.description">
|
<trans-unit id="plugin.search.description">
|
||||||
<source>List results from search</source>
|
<source>List results from search</source>
|
||||||
</trans-unit>
|
</trans-unit>
|
||||||
<trans-unit id="plugin.form.title">
|
|
||||||
<source>Search Core: Form</source>
|
|
||||||
</trans-unit>
|
|
||||||
<trans-unit id="plugin.form.description">
|
|
||||||
<source>Just a search form to list page</source>
|
|
||||||
</trans-unit>
|
|
||||||
</body>
|
</body>
|
||||||
</file>
|
</file>
|
||||||
</xliff>
|
</xliff>
|
||||||
|
|
|
@ -1,11 +0,0 @@
|
||||||
<html xmlns:f="http://typo3.org/ns/TYPO3/CMS/Fluid/ViewHelpers"
|
|
||||||
data-namespace-typo3-fluid="true">
|
|
||||||
<f:layout name="Default"/>
|
|
||||||
|
|
||||||
<f:section name="Content">
|
|
||||||
<div class="core-search-form">
|
|
||||||
<f:render partial="Form/SearchRequest" arguments="{searchRequest: searchRequest, result: result}"/>
|
|
||||||
</div>
|
|
||||||
</f:section>
|
|
||||||
|
|
||||||
</html>
|
|
|
@ -3,6 +3,10 @@
|
||||||
<f:layout name="Default"/>
|
<f:layout name="Default"/>
|
||||||
|
|
||||||
<f:section name="Content">
|
<f:section name="Content">
|
||||||
|
<div class="core-search-form">
|
||||||
|
<f:render partial="Form/SearchRequest" arguments="{searchRequest: searchRequest, result: result}"/>
|
||||||
|
</div>
|
||||||
|
|
||||||
<f:if condition="{searchResult}">
|
<f:if condition="{searchResult}">
|
||||||
<f:then>
|
<f:then>
|
||||||
<ul class="core-search-results">
|
<ul class="core-search-results">
|
||||||
|
|
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB |
|
@ -12,9 +12,9 @@ call_user_func(function ($extension, $configuration) {
|
||||||
['source' => 'EXT:search_core/Resources/Public/Icons/PluginForm.svg']
|
['source' => 'EXT:search_core/Resources/Public/Icons/PluginForm.svg']
|
||||||
);
|
);
|
||||||
$iconRegistry->registerIcon(
|
$iconRegistry->registerIcon(
|
||||||
'plugin-' . $extension . '-results',
|
'plugin-' . $extension . '-search',
|
||||||
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
|
\TYPO3\CMS\Core\Imaging\IconProvider\SvgIconProvider::class,
|
||||||
['source' => 'EXT:search_core/Resources/Public/Icons/PluginResults.svg']
|
['source' => 'EXT:search_core/Resources/Public/Icons/PluginSearch.svg']
|
||||||
);
|
);
|
||||||
|
|
||||||
// TODO: Add hook for Extbase -> to handle records modified through
|
// TODO: Add hook for Extbase -> to handle records modified through
|
||||||
|
@ -45,18 +45,10 @@ call_user_func(function ($extension, $configuration) {
|
||||||
|
|
||||||
TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
|
TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
|
||||||
'Codappix.' . $extension,
|
'Codappix.' . $extension,
|
||||||
'Results',
|
'Search',
|
||||||
['Search' => 'results'],
|
|
||||||
['Search' => 'results']
|
['Search' => 'results']
|
||||||
);
|
);
|
||||||
|
|
||||||
TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
|
|
||||||
'Codappix.' . $extension,
|
|
||||||
'Form',
|
|
||||||
['Search' => 'form'],
|
|
||||||
['Search' => 'form']
|
|
||||||
);
|
|
||||||
|
|
||||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
|
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
|
||||||
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $extension . '/Configuration/TSconfig/Page/Mod/Wizards/NewContentElement.tsconfig">'
|
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $extension . '/Configuration/TSconfig/Page/Mod/Wizards/NewContentElement.tsconfig">'
|
||||||
);
|
);
|
||||||
|
@ -65,8 +57,8 @@ call_user_func(function ($extension, $configuration) {
|
||||||
(isset($configuration['disable.']['elasticsearch']) &&
|
(isset($configuration['disable.']['elasticsearch']) &&
|
||||||
filter_var($configuration['disable.']['elasticsearch'], FILTER_VALIDATE_BOOLEAN) === false)
|
filter_var($configuration['disable.']['elasticsearch'], FILTER_VALIDATE_BOOLEAN) === false)
|
||||||
) {
|
) {
|
||||||
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\Container\Container::class)
|
$container = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\Container\Container::class);
|
||||||
->registerImplementation(
|
$container->registerImplementation(
|
||||||
\Codappix\SearchCore\Connection\ConnectionInterface::class,
|
\Codappix\SearchCore\Connection\ConnectionInterface::class,
|
||||||
\Codappix\SearchCore\Connection\Elasticsearch::class
|
\Codappix\SearchCore\Connection\Elasticsearch::class
|
||||||
);
|
);
|
||||||
|
|
Loading…
Reference in a new issue