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,34 @@
<?php
namespace Websmid\CustomHtml\Form\DataProvider;
use PrestaShop\PrestaShop\Core\Form\IdentifiableObject\DataProvider\FormDataProviderInterface;
use Websmid\CustomHtml\Model\CustomHtmlGroup;
use Validate;
final class CustomHtmlGroupDataProvider implements FormDataProviderInterface
{
public function getData($id)
{
$group = new CustomHtmlGroup((int) $id);
if (!Validate::isLoadedObject($group)) {
return $this->getDefaultData();
}
return [
'title' => $group->title,
'hook_name' => $group->hook_name,
'active' => (bool) $group->active,
];
}
public function getDefaultData()
{
return [
'title' => '',
'hook_name' => '',
'active' => true,
];
}
}