mirror of
https://github.com/Codappix/search_core.git
synced 2024-11-22 23:36:11 +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(
|
||||
ConfigurationManagerInterface::CONFIGURATION_TYPE_SETTINGS,
|
||||
'SearchCore',
|
||||
'Results'
|
||||
'Search'
|
||||
);
|
||||
if ($this->settings === null) {
|
||||
throw new NoConfigurationException('Could not fetch configuration.', 1484226842);
|
||||
|
|
|
@ -3,21 +3,12 @@
|
|||
use TYPO3\CMS\Extbase\Utility\ExtensionUtility;
|
||||
|
||||
call_user_func(function ($extension, $table) {
|
||||
$plugin = ExtensionUtility::registerPlugin(
|
||||
'Codappix.' . $extension,
|
||||
'Results',
|
||||
'LLL:EXT:search_core/Resources/Private/Language/locallang_be.xlf:plugin.results.title',
|
||||
'EXT:search_core/Resources/Public/Icons/PluginResults.svg'
|
||||
) ?? 'searchcore_results';
|
||||
ExtensionUtility::registerPlugin(
|
||||
'Codappix.' . $extension,
|
||||
'Search',
|
||||
'LLL:EXT:search_core/Resources/Private/Language/locallang_be.xlf:plugin.search.title',
|
||||
'plugin-' . $extension . '-search'
|
||||
);
|
||||
|
||||
$GLOBALS['TCA'][$table]['types']['list']['subtypes_excludelist'][$plugin] = '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';
|
||||
$GLOBALS['TCA'][$table]['types']['list']['subtypes_excludelist']['searchcore_search'] = 'recursive,pages';
|
||||
}, 'search_core', 'tt_content');
|
||||
|
|
|
@ -1,22 +1,12 @@
|
|||
mod.wizards.newContentElement.wizardItems.plugins {
|
||||
elements {
|
||||
searchcore_results {
|
||||
title = LLL:EXT:search_core/Resources/Private/Language/locallang_be.xlf:plugin.results.title
|
||||
description = LLL:EXT:search_core/Resources/Private/Language/locallang_be.xlf:plugin.results.description
|
||||
iconIdentifier = plugin-search_core-results
|
||||
searchcore_search {
|
||||
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.search.description
|
||||
iconIdentifier = plugin-search_core-search
|
||||
tt_content_defValues {
|
||||
CType = list
|
||||
list_type = searchcore_results
|
||||
}
|
||||
}
|
||||
|
||||
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
|
||||
list_type = searchcore_search
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3,18 +3,12 @@
|
|||
<file source-language="en" datatype="plaintext" original="messages">
|
||||
<header/>
|
||||
<body>
|
||||
<trans-unit id="plugin.results.title">
|
||||
<source>Search Core: Results</source>
|
||||
<trans-unit id="plugin.search.title">
|
||||
<source>Search Core: Search</source>
|
||||
</trans-unit>
|
||||
<trans-unit id="plugin.results.description">
|
||||
<trans-unit id="plugin.search.description">
|
||||
<source>List results from search</source>
|
||||
</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>
|
||||
</file>
|
||||
</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:section name="Content">
|
||||
<div class="core-search-form">
|
||||
<f:render partial="Form/SearchRequest" arguments="{searchRequest: searchRequest, result: result}"/>
|
||||
</div>
|
||||
|
||||
<f:if condition="{searchResult}">
|
||||
<f:then>
|
||||
<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']
|
||||
);
|
||||
$iconRegistry->registerIcon(
|
||||
'plugin-' . $extension . '-results',
|
||||
'plugin-' . $extension . '-search',
|
||||
\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
|
||||
|
@ -45,18 +45,10 @@ call_user_func(function ($extension, $configuration) {
|
|||
|
||||
TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
|
||||
'Codappix.' . $extension,
|
||||
'Results',
|
||||
['Search' => 'results'],
|
||||
'Search',
|
||||
['Search' => 'results']
|
||||
);
|
||||
|
||||
TYPO3\CMS\Extbase\Utility\ExtensionUtility::configurePlugin(
|
||||
'Codappix.' . $extension,
|
||||
'Form',
|
||||
['Search' => 'form'],
|
||||
['Search' => 'form']
|
||||
);
|
||||
|
||||
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::addPageTSConfig(
|
||||
'<INCLUDE_TYPOSCRIPT: source="FILE:EXT:' . $extension . '/Configuration/TSconfig/Page/Mod/Wizards/NewContentElement.tsconfig">'
|
||||
);
|
||||
|
@ -65,10 +57,10 @@ call_user_func(function ($extension, $configuration) {
|
|||
(isset($configuration['disable.']['elasticsearch']) &&
|
||||
filter_var($configuration['disable.']['elasticsearch'], FILTER_VALIDATE_BOOLEAN) === false)
|
||||
) {
|
||||
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\Container\Container::class)
|
||||
->registerImplementation(
|
||||
\Codappix\SearchCore\Connection\ConnectionInterface::class,
|
||||
\Codappix\SearchCore\Connection\Elasticsearch::class
|
||||
);
|
||||
$container = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\Container\Container::class);
|
||||
$container->registerImplementation(
|
||||
\Codappix\SearchCore\Connection\ConnectionInterface::class,
|
||||
\Codappix\SearchCore\Connection\Elasticsearch::class
|
||||
);
|
||||
}
|
||||
}, $_EXTKEY, $_EXTCONF);
|
||||
|
|
Loading…
Reference in a new issue