show registered export renderers in admin submit without required tpl block extension
This commit is contained in:
bovenliggende
500f226399
commit
e1502b274e
@ -103,7 +103,15 @@ abstract class ExportBase implements QueryBase
|
||||
*/
|
||||
public function getRenderer($format): ExportRenderer\RendererInterface
|
||||
{
|
||||
return oxNew(RendererBridge::class)->getRenderer($format);
|
||||
return $this->getRendererBridge()->getRenderer($format);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return RendererBridge
|
||||
*/
|
||||
public function getRendererBridge()
|
||||
{
|
||||
return oxNew(RendererBridge::class);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -74,4 +74,12 @@ class Csv implements RendererInterface
|
||||
|
||||
return $csv;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTitleTranslationId(): string
|
||||
{
|
||||
return 'D3_DATAWIZARD_EXPORT_FORMAT_CSV';
|
||||
}
|
||||
}
|
@ -38,4 +38,12 @@ class Pretty implements RendererInterface
|
||||
{
|
||||
return 'txt';
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTitleTranslationId(): string
|
||||
{
|
||||
return "D3_DATAWIZARD_EXPORT_FORMAT_PRETTY";
|
||||
}
|
||||
}
|
@ -33,6 +33,21 @@ class RendererBridge
|
||||
];
|
||||
}
|
||||
|
||||
public function getTranslatedRendererIdList()
|
||||
{
|
||||
$rendererList = $this->getRendererList();
|
||||
array_walk($rendererList, [$this, 'translateRendererId']);
|
||||
return $rendererList;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param RendererInterface $instance
|
||||
*/
|
||||
protected function translateRendererId(RendererInterface &$instance)
|
||||
{
|
||||
$instance = $instance->getTitleTranslationId();
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $format
|
||||
*
|
||||
|
@ -29,4 +29,9 @@ interface RendererInterface
|
||||
* @return string
|
||||
*/
|
||||
public function getFileExtension() : string;
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getTitleTranslationId() : string;
|
||||
}
|
@ -11,12 +11,12 @@
|
||||
</button>
|
||||
<div class="dropdown-menu">
|
||||
[{block name="dataWizardFormat"}]
|
||||
<button class="dropdown-item" onclick="startTask('[{$id}]', 'CSV')">
|
||||
[{oxmultilang ident="D3_DATAWIZARD_EXPORT_FORMAT_CSV"}]
|
||||
</button>
|
||||
<button class="dropdown-item" onclick="startTask('[{$id}]', 'Pretty')">
|
||||
[{oxmultilang ident="D3_DATAWIZARD_EXPORT_FORMAT_PRETTY"}]
|
||||
</button>
|
||||
[{assign var="rendererBridge" value=$item->getRendererBridge()}]
|
||||
[{foreach from=$rendererBridge->getTranslatedRendererIdList() key="key" item="translationId"}]
|
||||
<button class="dropdown-item" onclick="startTask('[{$id}]', '[{$key}]')">
|
||||
[{oxmultilang ident=$translationId}]
|
||||
</button>
|
||||
[{/foreach}]
|
||||
[{/block}]
|
||||
</div>
|
||||
</div>
|
Laden…
Verwijs in nieuw issue
Block a user