Initial Commit

This commit is contained in:
2019-11-21 12:25:31 +01:00
commit f4aabcb9b1
13959 changed files with 787761 additions and 0 deletions

View File

@@ -0,0 +1,63 @@
<?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 Slide\Hook;
use Slide\Slide;
use Thelia\Core\Event\Hook\HookRenderBlockEvent;
use Thelia\Core\Event\Hook\HookRenderEvent;
use Thelia\Core\Hook\BaseHook;
use Thelia\Tools\URL;
/**
* Class BackHook
* @package Slide\Hook
* @author Julien Chanséaume <jchanseaume@openstudio.fr>
*/
class BackHook extends BaseHook
{
public function onMainTopMenuTools(HookRenderBlockEvent $event)
{
$event->add(
[
'id' => 'tools_menu_slide',
'class' => '',
'url' => URL::getInstance()->absoluteUrl('/admin/module/slides'),
'title' => $this->trans('Slides', [], Slide::getModuleCode())
]
);
}
public function onTabContent(HookRenderEvent $event)
{
$event->add(
$this->render(
'tab-content.html',
[
'ref' => $event->getArgument('view'),
'ref_id' => $event->getArgument('id')
]
)
);
}
public function onTabContentJs(HookRenderEvent $event)
{
$event->add(
$this->render(
'tab-content-js.html'
)
);
}
}

View File

@@ -0,0 +1,123 @@
<?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 Slide\Hook;
use Thelia\Core\Event\Hook\HookRenderEvent;
use Thelia\Core\Hook\BaseHook;
/**
* Class FrontHook
* @package Slide\Hook
* @author Julien Chanséaume <jchanseaume@openstudio.fr>
*/
class FrontHook extends BaseHook
{
public function onMainContentTop(HookRenderEvent $event)
{
$view = $this->getView();
if ($this->isAcceptedView($view)) {
if($view!=="index"){
$content = $this->render(
'main-content-top.html',
[
"ref" => $view,
"ref_id" => $this->getRequest()->get(
sprintf("%s_id", $view)
),
]
);
}
else {
$content = $this->render(
'main-content-top.html',
[
"ref" => 'folder',
"ref_id" => '1',
]
);
}
if (!empty($content)) {
$event->add($content);
}
}
}
protected function isAcceptedView($view)
{
$acceptedViews = [
'category',
'product',
'folder',
'content',
'brand',
'index'
];
return in_array($view, $acceptedViews);
}
public function onMainJavascriptInitialization (HookRenderEvent $event)
{
$view = $this->getView();
if ($this->isAcceptedView($view)) {
$content = $this->render(
'main-javascript-initialization.html'
);
if (!empty($content)) {
$event->add($content);
}
}
}
public function onMainStylesheet (HookRenderEvent $event)
{
$view = $this->getView();
if ($this->isAcceptedView($view)) {
$content = $this->render(
'main-stylesheet.html'
);
if (!empty($content)) {
$event->add($content);
}
}
}
public function onMainAfterJavascriptInclude (HookRenderEvent $event)
{
$view = $this->getView();
if ($this->isAcceptedView($view)) {
$content = $this->render(
'main-after-javascript-include.html'
);
if (!empty($content)) {
$event->add($content);
}
}
}
}