feat(main): Groups and blocks

This commit is contained in:
2026-08-10 16:13:15 +02:00
parent 6aff506cd6
commit 635c13a0ed
39 changed files with 1188 additions and 237 deletions
@@ -0,0 +1,38 @@
<?php
namespace Websmid\CustomHtml\Form\DataProvider;
use PrestaShop\PrestaShop\Core\Form\IdentifiableObject\DataProvider\FormDataProviderInterface;
use Websmid\CustomHtml\Model\CustomHtmlBlock;
use Validate;
final class CustomHtmlBlockDataProvider implements FormDataProviderInterface
{
public function getData($id)
{
$block = new CustomHtmlBlock((int) $id);
if (!Validate::isLoadedObject($block)) {
return $this->getDefaultData();
}
return [
'id_ws_customhtml_group' => (int) $block->id_ws_customhtml_group,
'title' => $block->title,
'show_title' => (bool) $block->show_title,
'content' => $block->content,
'active' => (bool) $block->active,
];
}
public function getDefaultData()
{
return [
'id_ws_customhtml_group' => 0,
'title' => '',
'show_title' => false,
'content' => '',
'active' => true,
];
}
}