<?php

namespace Modules\Contrat\MenuContextuel;

use Helpers\Outil\MenuContextuel;
use Helpers\Trad\ITrad;
use Skeleton\Router;

class ArticleContextuel extends MenuContextuel
{
    public function __construct(\PDO $pdo, Router $router, ITrad $trad)
    {
        parent::__construct($pdo, $router, $trad);
    }

    /**
     * @param string $article
     * @param string $type
     * @param string $id
     * @return array<mixed>
     */
    public function generate($article = '', $type = '', $id = '')
    {
        $menuContextuel = [];
        
        /* Principal */
        $menuContextuel['listeSecondaire'][] = [
            'libelle' => $this->trad->t('Modifier'),
            'lien' => $this->router->generateUri('Contrat.article.formArticleUpdate', ['type' => $type, 'idacc' => $id, 'idart' => $article]),
        ];

        $menuContextuel['listeSecondaire'][] = [
            'libelle' => $this->trad->t('Supprimer'),
            'lien' => $this->router->generateUri('Contrat.article.supprimerArticle', ['type' => $type, 'idacc' => $id, 'idart' => $article]),
        ];

        return $menuContextuel;
    }
}
