local/modules/RewriteUrl/Hook/ConfigurationHook.php line 38

  1. <?php
  2. /*************************************************************************************/
  3. /*      This file is part of the RewriteUrl module for Thelia.                       */
  4. /*                                                                                   */
  5. /*      Copyright (c) OpenStudio                                                     */
  6. /*      email : dev@thelia.net                                                       */
  7. /*      web : http://www.thelia.net                                                  */
  8. /*                                                                                   */
  9. /*      For the full copyright and license information, please view the LICENSE.txt  */
  10. /*      file that was distributed with this source code.                             */
  11. /*************************************************************************************/
  12. namespace RewriteUrl\Hook;
  13. use Thelia\Core\Event\Hook\HookRenderEvent;
  14. use Thelia\Core\Hook\BaseHook;
  15. use Thelia\Model\ConfigQuery;
  16. /**
  17.  * Class ConfigurationHook
  18.  * @package RewriteUrl\Hook
  19.  * @author Tom Pradat <tpradat@openstudio.fr>
  20.  */
  21. class ConfigurationHook extends BaseHook
  22. {
  23.     public function onModuleConfiguration(HookRenderEvent $event)
  24.     {
  25.         $event->add(
  26.             $this->render(
  27.                 'RewriteUrl/module-configuration.html',
  28.                 [
  29.                     "isRewritingEnabled" => ConfigQuery::isRewritingEnable()
  30.                 ]
  31.             )
  32.         );
  33.     }
  34.     public function onModuleConfigurationJavascript(HookRenderEvent $event)
  35.     {
  36.         $event->add(
  37.             $this->render(
  38.                 'RewriteUrl/module-configuration-js.html',
  39.                 [
  40.                     "isRewritingEnabled" => ConfigQuery::isRewritingEnable()
  41.                 ]
  42.             )
  43.         );
  44.     }
  45.     public function onConfigurationCatalogTop(HookRenderEvent $event)
  46.     {
  47.         $event->add($this->render(
  48.             'configuration-catalog.html'
  49.         ));
  50.     }
  51. }