local/modules/HookNavigation/Hook/FrontHook.php line 43

  1. <?php
  2. /*
  3.  * This file is part of the Thelia package.
  4.  * http://www.thelia.net
  5.  *
  6.  * (c) OpenStudio <info@thelia.net>
  7.  *
  8.  * For the full copyright and license information, please view the LICENSE
  9.  * file that was distributed with this source code.
  10.  */
  11. namespace HookNavigation\Hook;
  12. use HookNavigation\HookNavigation;
  13. use HookNavigation\Model\Config\HookNavigationConfigValue;
  14. use Thelia\Core\Event\Hook\HookRenderBlockEvent;
  15. use Thelia\Core\Event\Hook\HookRenderEvent;
  16. use Thelia\Core\Hook\BaseHook;
  17. /**
  18.  * Class FrontHook.
  19.  *
  20.  * @author Julien Chanséaume <jchanseaume@openstudio.fr>, Etienne PERRIERE <eperriere@openstudio.fr> - OpenStudio
  21.  */
  22. class FrontHook extends BaseHook
  23. {
  24.     public function onMainFooterBody(HookRenderBlockEvent $event): void
  25.     {
  26.         $bodyConfig HookNavigation::getConfigValue(HookNavigationConfigValue::FOOTER_BODY_FOLDER_ID);
  27.         $content trim($this->render('main-footer-body.html', ['bodyFolderId' => $bodyConfig]));
  28.         if ('' != $content) {
  29.             $event->add([
  30.                 'id' => 'navigation-footer-body',
  31.                 'class' => 'links',
  32.                 'title' => $this->trans('Latest articles', [], HookNavigation::MESSAGE_DOMAIN),
  33.                 'content' => $content,
  34.             ]);
  35.         }
  36.     }
  37.     public function onMainFooterBottom(HookRenderEvent $event): void
  38.     {
  39.         $bottomConfig HookNavigation::getConfigValue(HookNavigationConfigValue::FOOTER_BOTTOM_FOLDER_ID);
  40.         $content $this->render('main-footer-bottom.html', ['bottomFolderId' => $bottomConfig]);
  41.         $event->add($content);
  42.     }
  43. }