Skip to content

Commit

Permalink
Merge pull request #202 from dertimon/master
Browse files Browse the repository at this point in the history
Fix #201 summed up information in backend opreview
  • Loading branch information
FamousWolf authored Oct 12, 2022
2 parents bea6933 + e9d020d commit fed9f0d
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions Classes/Hooks/CmsLayout.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,13 +42,6 @@ public function __construct(ResourceFactory $resourceFactory = null)
$this->resourceFactory = $resourceFactory ?? GeneralUtility::makeInstance(ResourceFactory::class);
}

/**
* Table information
*
* @var array
*/
public $tableData = [];

/**
* Flexform information
*
Expand All @@ -64,6 +57,7 @@ public function __construct(ResourceFactory $resourceFactory = null)
*/
public function getExtensionSummary(array $params)
{
$tableData = [];
$result = '<u><strong>' . $this->sL('plugin.title') . '</strong></u>';

if ($params['row']['list_type'] === 'falsecuredownload_filetree') {
Expand All @@ -78,20 +72,20 @@ public function getExtensionSummary(array $params)
}

if ($storageName) {
$this->tableData[] = [
$tableData[] = [
$this->sL('flexform.storage'),
$storageName
];
}

// Folder
$folder = $this->getFieldFromFlexform('settings.folder');
$this->tableData[] = [
$tableData[] = [
$this->sL('flexform.folder'),
$folder
];

$result .= $this->renderSettingsAsTable();
$result .= $this->renderSettingsAsTable($tableData);
$result = '<div style="background-color:#f1f1f1; padding:8px; margin-top:8px" class="t3-page-ce-info">' . $result . '</div>';
}

Expand All @@ -102,16 +96,17 @@ public function getExtensionSummary(array $params)
* Render the settings as table for Web>Page module
* System settings are displayed in mono font
*
* @param array $tableData
* @return string
*/
protected function renderSettingsAsTable()
protected function renderSettingsAsTable(array $tableData)
{
if (count($this->tableData) == 0) {
if (count($tableData) == 0) {
return '';
}

$content = '';
foreach ($this->tableData as $line) {
foreach ($tableData as $line) {
$content .= '<tr><td><em><strong>' . $line[0] . '</strong></em></td><td>&nbsp; ' . ' ' . $line[1] . '</td></tr>';
}

Expand Down

0 comments on commit fed9f0d

Please sign in to comment.