feat(main): Add FAQ accordion
This commit is contained in:
@@ -3,6 +3,8 @@
|
||||
namespace Websmid\CustomHtml\Module;
|
||||
|
||||
use Websmid\CustomHtml\Config\Config;
|
||||
use PrestaShop\PrestaShop\Core\Grid\Data\GridData;
|
||||
use PrestaShop\PrestaShop\Core\Grid\Record\RecordCollection;
|
||||
use Tools;
|
||||
|
||||
trait AdminHooks
|
||||
@@ -27,4 +29,17 @@ trait AdminHooks
|
||||
|
||||
$this->context->controller->addCSS($this->getPathUri() . 'views/css/admin/grid.css');
|
||||
}
|
||||
|
||||
public function hookActionCustomhtmlblockGridDataModifier(array $params): void
|
||||
{
|
||||
$gridData = $params['data'];
|
||||
|
||||
$records = array_map(static function (array $row) {
|
||||
$row['type'] = Config::BLOCK_TYPES[$row['type']] ?? $row['type'];
|
||||
|
||||
return $row;
|
||||
}, $gridData->getRecords()->all());
|
||||
|
||||
$params['data'] = new GridData(new RecordCollection($records), $gridData->getRecordsTotal(), $gridData->getQuery());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user