mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-10-01 19:09:45 +00:00
61 lines
1.8 KiB
PHP
61 lines
1.8 KiB
PHP
<?php
|
|
|
|
/**
|
|
* Chill is a software for social workers.
|
|
*
|
|
* For the full copyright and license information, please view
|
|
* the LICENSE file that was distributed with this source code.
|
|
*
|
|
* @see https://www.champs-libres.coop/
|
|
*/
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Chill\PersonBundle\Menu;
|
|
|
|
use Chill\MainBundle\Routing\LocalMenuBuilderInterface;
|
|
use Knp\Menu\MenuItem;
|
|
use Symfony\Contracts\Translation\TranslatorInterface;
|
|
|
|
class AccompanyingCourseMenuBuilder implements LocalMenuBuilderInterface
|
|
{
|
|
/**
|
|
* @var TranslatorInterface
|
|
*/
|
|
protected $translator;
|
|
|
|
public function __construct(TranslatorInterface $translator)
|
|
{
|
|
$this->translator = $translator;
|
|
}
|
|
|
|
public function buildMenu($menuId, MenuItem $menu, array $parameters): void
|
|
{
|
|
$menu->addChild($this->translator->trans('Resume Accompanying Course'), [
|
|
'route' => 'chill_person_accompanying_course_index',
|
|
'routeParameters' => [
|
|
'accompanying_period_id' => $parameters['accompanyingCourse']->getId(),
|
|
], ])
|
|
->setExtras(['order' => 10]);
|
|
|
|
$menu->addChild($this->translator->trans('Edit Accompanying Course'), [
|
|
'route' => 'chill_person_accompanying_course_show',
|
|
'routeParameters' => [
|
|
'accompanying_period_id' => $parameters['accompanyingCourse']->getId(),
|
|
], ])
|
|
->setExtras(['order' => 20]);
|
|
|
|
$menu->addChild($this->translator->trans('Accompanying Course Details'), [
|
|
'route' => 'chill_person_accompanying_course_history',
|
|
'routeParameters' => [
|
|
'accompanying_period_id' => $parameters['accompanyingCourse']->getId(),
|
|
], ])
|
|
->setExtras(['order' => 30]);
|
|
}
|
|
|
|
public static function getMenuIds(): array
|
|
{
|
|
return ['accompanyingCourse'];
|
|
}
|
|
}
|