local/modules/ColissimoHomeDelivery/Hook/HookManager.php line 28

Open in your IDE?
  1. <?php
  2. /*************************************************************************************/
  3. /*      Copyright (c) Franck Allimant, CQFDev                                        */
  4. /*      email : thelia@cqfdev.fr                                                     */
  5. /*      web : http://www.cqfdev.fr                                                   */
  6. /*                                                                                   */
  7. /*      For the full copyright and license information, please view the LICENSE      */
  8. /*      file that was distributed with this source code.                             */
  9. /*************************************************************************************/
  10. /**
  11.  * Created by Franck Allimant, CQFDev <franck@cqfdev.fr>
  12.  * Date: 17/08/2019 14:34
  13.  */
  14. namespace ColissimoHomeDelivery\Hook;
  15. use ColissimoHomeDelivery\ColissimoHomeDelivery;
  16. use ColissimoHomeDelivery\Model\ColissimowsLabelQuery;
  17. use Thelia\Core\Event\Hook\HookRenderBlockEvent;
  18. use Thelia\Core\Event\Hook\HookRenderEvent;
  19. use Thelia\Core\Hook\BaseHook;
  20. use Thelia\Model\ModuleConfig;
  21. use Thelia\Model\ModuleConfigQuery;
  22. use Thelia\Tools\URL;
  23. class HookManager extends BaseHook
  24. {
  25.     public function onModuleConfigure(HookRenderEvent $event)
  26.     {
  27.         $vars = [ ];
  28.         if (null !== $params ModuleConfigQuery::create()->findByModuleId(ColissimoHomeDelivery::getModuleId())) {
  29.             /** @var ModuleConfig $param */
  30.             foreach ($params as $param) {
  31.                 $vars$param->getName() ] = $param->getValue();
  32.             }
  33.         }
  34.         $event->add(
  35.             $this->render(
  36.                 'module_configuration.html',
  37.                 $vars
  38.             )
  39.         );
  40.     }
  41.     public function onModuleConfigJs(HookRenderEvent $event)
  42.     {
  43.         $event->add($this->render('module-config-js.html'));
  44.     }
  45. }