local/modules/MondialRelayPickupPoint/Hook/AdminHookManager.php line 39

  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. namespace MondialRelayPickupPoint\Hook;
  11. use MondialRelayPickupPoint\MondialRelayPickupPoint;
  12. use Thelia\Core\Event\Hook\HookRenderBlockEvent;
  13. use Thelia\Core\Event\Hook\HookRenderEvent;
  14. use Thelia\Core\Hook\BaseHook;
  15. use Thelia\Tools\URL;
  16. class AdminHookManager extends BaseHook
  17. {
  18.     public function onModuleConfigure(HookRenderEvent $event)
  19.     {
  20.         $vars = [
  21.             'code_enseigne' => MondialRelayPickupPoint::getConfigValue(MondialRelayPickupPoint::CODE_ENSEIGNE),
  22.             'private_key' =>  MondialRelayPickupPoint::getConfigValue(MondialRelayPickupPoint::PRIVATE_KEY),
  23.             'allow_relay_delivery' =>  MondialRelayPickupPoint::getConfigValue(MondialRelayPickupPoint::ALLOW_RELAY_DELIVERY),
  24.             'allow_home_delivery' =>  MondialRelayPickupPoint::getConfigValue(MondialRelayPickupPoint::ALLOW_HOME_DELIVERY),
  25.             'allow_insurance' =>  MondialRelayPickupPoint::getConfigValue(MondialRelayPickupPoint::ALLOW_INSURANCE),
  26.             "mondial_relay_pickup_point_free_shipping_active" => MondialRelayPickupPoint::getConfigValue("mondial_relay_pickup_point_free_shipping_active"),
  27.             'module_id' =>  MondialRelayPickupPoint::getModuleId()
  28.         ];
  29.         $event->add(
  30.             $this->render('mondialrelaypickuppoint/module-configuration.html'$vars)
  31.         );
  32.     }
  33.     public function onMainTopMenuTools(HookRenderBlockEvent $event)
  34.     {
  35.         $event->add(
  36.             [
  37.                 'id' => 'tools_mondial_relay',
  38.                 'class' => '',
  39.                 'url' => URL::getInstance()->absoluteUrl('/admin/module/MondialRelayPickupPoint'),
  40.                 'title' => $this->trans('Mondial Relay pickup point', [], MondialRelayPickupPoint::DOMAIN_NAME)
  41.             ]
  42.         );
  43.     }
  44.     public function onModuleConfigureJs(HookRenderEvent $event)
  45.     {
  46.         $event
  47.             ->add($this->render("mondialrelaypickuppoint/assets/js/mondialrelaypickuppoint.js.html"))
  48.             ->add($this->addJS("mondialrelaypickuppoint/assets/js/bootstrap-notify.min.js"))
  49.         ;
  50.     }
  51. }