Module Recettes : on avance encore...
This commit is contained in:
@@ -2,7 +2,9 @@
|
||||
|
||||
namespace Recettes\Hook;
|
||||
|
||||
use Recettes\Recettes;
|
||||
use Thelia\Core\Event\Hook\HookRenderBlockEvent;
|
||||
use Thelia\Core\Event\Hook\HookRenderEvent;
|
||||
use Thelia\Core\Hook\BaseHook;
|
||||
use Thelia\Model\ContentFolderQuery;
|
||||
use Thelia\Model\FolderI18nQuery;
|
||||
@@ -14,23 +16,27 @@ use Thelia\Model\FolderI18nQuery;
|
||||
class HookManager extends baseHook
|
||||
{
|
||||
|
||||
public function onEditTab(HookRenderBlockEvent $event)
|
||||
public function onAddTab(HookRenderBlockEvent $event)
|
||||
{
|
||||
$contentId = $event->getArgument('id');
|
||||
$parentFolderId = ContentFolderQuery::create()->findOneByContentId($contentId)->getFolderId();
|
||||
$parentFolder = FolderI18nQuery::create()->findOneById($parentFolderId)->getTitle();
|
||||
|
||||
if (0 != strpos($parentFolder, 'recette')) {
|
||||
if (0 != strpos($parentFolder, Recettes::MOT_CLE_RECETTE)) {
|
||||
|
||||
$event->add(
|
||||
[
|
||||
"id" => 'admin-content-recipe',
|
||||
"id" => 'recipe',
|
||||
"title" => 'Recette',
|
||||
"content" => ($this->render('recette-tab.html',
|
||||
[ "people" => "2" ]
|
||||
))
|
||||
"content" => ($this->render('recette-tab.html'))
|
||||
]
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
public function onAddCss(HookRenderEvent $event)
|
||||
{
|
||||
$event->add($this->addCSS('assets/css/Recettes.css'));
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user