feat(main): Add banner option
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
namespace Websmid\CustomHtml\Module;
|
||||
|
||||
use Websmid\CustomHtml\Config\Config;
|
||||
use PrestaShop\PrestaShop\Adapter\SymfonyContainer;
|
||||
use PrestaShop\PrestaShop\Core\Grid\Data\GridData;
|
||||
use PrestaShop\PrestaShop\Core\Grid\Record\RecordCollection;
|
||||
use Tools;
|
||||
@@ -21,9 +22,10 @@ trait AdminHooks
|
||||
|
||||
public function hookActionAdminControllerSetMedia(): void
|
||||
{
|
||||
$controllerName = $this->context->controller->controller_name ?? '';
|
||||
$request = SymfonyContainer::getInstance()->get('request_stack')->getCurrentRequest();
|
||||
$routeName = $request ? (string) $request->attributes->get('_route') : '';
|
||||
|
||||
if (!in_array($controllerName, Config::ADMIN_CONTROLLERS, true)) {
|
||||
if (0 !== strpos($routeName, 'customhtml')) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user