70 lines
2.3 KiB
PHP
70 lines
2.3 KiB
PHP
<?php
|
|
/*************************************************************************************/
|
|
/* This file is part of the Thelia package. */
|
|
/* */
|
|
/* Copyright (c) OpenStudio */
|
|
/* email : dev@thelia.net */
|
|
/* web : http://www.thelia.net */
|
|
/* */
|
|
/* For the full copyright and license information, please view the LICENSE.txt */
|
|
/* file that was distributed with this source code. */
|
|
/*************************************************************************************/
|
|
|
|
namespace Beds24\Hook;
|
|
|
|
use Beds24\Beds24;
|
|
use Beds24\Model\Beds24ProductInfoQuery;
|
|
use Thelia\Core\Event\Hook\HookRenderEvent;
|
|
use Thelia\Core\Hook\BaseHook;
|
|
|
|
/**
|
|
* Class HookManager
|
|
*
|
|
* @package Cheque\Hook
|
|
* @author Franck Allimant <franck@cqfdev.fr>
|
|
*/
|
|
class FrontHookManager extends BaseHook {
|
|
|
|
public function onHomeBody(HookRenderEvent $event)
|
|
{
|
|
$event->add(
|
|
$this->render(
|
|
"hook/home-body.html"
|
|
)
|
|
);
|
|
}
|
|
|
|
public function onHomeJavascriptInitialization(HookRenderEvent $event)
|
|
{
|
|
$event->add(
|
|
$this->render(
|
|
"hook/search.js.html"
|
|
)
|
|
);
|
|
}
|
|
|
|
public function onProductDetailsTop(HookRenderEvent $event)
|
|
{
|
|
if (null !== Beds24ProductInfoQuery::create()->findOneByProductId($event->getArgument('product'))) {
|
|
$event->add(
|
|
$this->render(
|
|
"hook/product.details-top.html",
|
|
$event->getArguments()
|
|
)
|
|
);
|
|
}
|
|
}
|
|
|
|
public function onProductJavascriptInitialization(HookRenderEvent $event)
|
|
{
|
|
if (null !== Beds24ProductInfoQuery::create()->findOneByProductId($event->getArgument('product'))) {
|
|
$event->add(
|
|
$this->render(
|
|
"/hook/product.javascript-initialization.js.html",
|
|
$event->getArguments()
|
|
)
|
|
);
|
|
}
|
|
}
|
|
}
|