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

[BUGFIX] Remove header and content links from plugin preview

parent 2ef487b2
No related branches found
Tags 4.2.2
1 merge request!1[FEATURE] Add backend preview for the YouTube Videos plugin
...@@ -50,20 +50,11 @@ class PluginRenderer implements PageLayoutViewDrawItemHookInterface { ...@@ -50,20 +50,11 @@ class PluginRenderer implements PageLayoutViewDrawItemHookInterface {
$labelPluginName = BackendUtility::getLabelFromItemListMerged( $labelPluginName = BackendUtility::getLabelFromItemListMerged(
$row['pid'], 'tt_content', 'list_type', $row['list_type'] $row['pid'], 'tt_content', 'list_type', $row['list_type']
); );
$labelHeader = BackendUtility::getItemLabel(
'tt_content', 'header'
);
$labelHeaderLink = BackendUtility::getItemLabel(
'tt_content', 'header_link'
);
$labelSubheader = BackendUtility::getItemLabel( $labelSubheader = BackendUtility::getItemLabel(
'tt_content', 'subheader' 'tt_content', 'subheader'
); );
$labelContentLink = BackendUtility::getItemLabel(
'tt_content', 'tx_sgcontentlink_contentlink'
);
// Make instance of TranslationService class // Instantiate TranslationService class
$translationServiceObject = GeneralUtility::makeInstance(TranslationService::class); $translationServiceObject = GeneralUtility::makeInstance(TranslationService::class);
// Begin rendering of content element fields // Begin rendering of content element fields
...@@ -81,27 +72,12 @@ class PluginRenderer implements PageLayoutViewDrawItemHookInterface { ...@@ -81,27 +72,12 @@ class PluginRenderer implements PageLayoutViewDrawItemHookInterface {
} }
} }
//Header link
if ($row['header_link']) {
$headerContent .= '<div><strong>' . $translationServiceObject->translate(
$labelHeaderLink
) . '&nbsp;(' . $translationServiceObject->translate(
$labelHeader
) . ')</strong>:&nbsp;' . $row['header_link'] . '</div>';
}
// Subheader // Subheader
if ($row['subheader']) { if ($row['subheader']) {
$headerContent .= '<div>' . '<strong>' . $translationServiceObject->translate( $headerContent .= '<div>' . '<strong>' . $translationServiceObject->translate(
$labelSubheader $labelSubheader
) . '</strong>' . ':&nbsp;' . $row['subheader'] . '</div>'; ) . '</strong>' . ':&nbsp;' . $row['subheader'] . '</div>';
} }
// Content link
if ($row['tx_sgcontentlink_contentlink']) {
$headerContent .= '<div>' . '<strong>' . $translationServiceObject->translate(
$labelContentLink
) . '</strong>' . ':&nbsp;' . $row['tx_sgcontentlink_contentlink'] . '</div>';
}
// Set plugin options array // Set plugin options array
$pluginOptions = GeneralUtility::xml2array($row['pi_flexform'], 'T3:'); $pluginOptions = GeneralUtility::xml2array($row['pi_flexform'], 'T3:');
...@@ -154,7 +130,7 @@ class PluginRenderer implements PageLayoutViewDrawItemHookInterface { ...@@ -154,7 +130,7 @@ class PluginRenderer implements PageLayoutViewDrawItemHookInterface {
// Get storage page(s) // Get storage page(s)
$backendUtilityObject = GeneralUtility::makeInstance(BackendUtility::class); $backendUtilityObject = GeneralUtility::makeInstance(BackendUtility::class);
$storagePageIds = explode(',', $row['pages']); $storagePageIds = explode(',', $row['pages']);
$storagePages = []; $storagePages = array();
foreach ($storagePageIds as $i => $storagePageId) { foreach ($storagePageIds as $i => $storagePageId) {
$storagePages[] = $backendUtilityObject->getRecord( $storagePages[] = $backendUtilityObject->getRecord(
......
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