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