Skip to content
Snippets Groups Projects
Commit 698beec5 authored by Ciprian Hossu's avatar Ciprian Hossu
Browse files

[BUGFIX] Use icons for displaying the value of the Show API result field

parent 14cad4e8
No related branches found
No related tags found
1 merge request!1[FEATURE] Add backend preview for the YouTube Videos plugin
......@@ -23,6 +23,8 @@ namespace SGalinski\SgYoutube\Hooks;
use TYPO3\CMS\Backend\Utility\BackendUtility;
use TYPO3\CMS\Backend\View\PageLayoutView;
use TYPO3\CMS\Backend\View\PageLayoutViewDrawItemHookInterface;
use TYPO3\CMS\Core\Imaging\Icon;
use TYPO3\CMS\Core\Imaging\IconFactory;
use TYPO3\CMS\Core\Utility\GeneralUtility;
use TYPO3\CMS\Form\Service\TranslationService;
......@@ -107,18 +109,36 @@ class PluginRenderer implements PageLayoutViewDrawItemHookInterface {
$labelvalue
) . '</th>' . '</tr>';
// Table content rows
// Loop through plugin options
// Loop through plugin options and render rows
foreach ($pluginOptions['data']['sDEF']['lDEF'] as $key => $setting) {
// if plugin option exists within the Flexform configuration file
if (array_key_exists($key, $arrayJobs['sheets']['sDEF']['ROOT']['el'])) {
// Display label
$labelId = $arrayJobs['sheets']['sDEF']['ROOT']['el'][$key]['TCEforms']['label'];
$itemContent .= '<row>' . '<td><strong>' . $translationServiceObject->translate(
trim($labelId)
) . '</strong></td>';
// Display value
$itemContent .= '<td>' . $setting['vDEF'] . '</td>' . '</tr>';
// Show different icon for the 'Show API Result' field, depending on checkbox value
if ($key === 'settings.showApiResult') {
if ($setting['vDEF'] === '0') {
$itemContent .= '<td>' . GeneralUtility::makeInstance(IconFactory::class)->getIcon(
'actions-close', Icon::SIZE_SMALL
)
->render('inline') . '</td>' . '</tr>';
} else {
$itemContent .= '<td>' . GeneralUtility::makeInstance(IconFactory::class)->getIcon(
'actions-check', Icon::SIZE_SMALL
)
->render('inline') . '</td>' . '</tr>';
}
// Remaining values
} else {
$itemContent .= '<td>' . $setting['vDEF'] . '</td>' . '</tr>';
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment