added plugin screen (#671)

This commit is contained in:
Kevin Papst
2019-04-08 18:38:56 +02:00
committed by GitHub
parent 5bea9915f5
commit 3a4aa5a001
68 changed files with 1392 additions and 490 deletions

View File

@@ -0,0 +1,51 @@
<?php
/*
* This file is part of the Kimai time-tracking app.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace App\Controller;
use App\Plugin\PluginManager;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Symfony\Component\Routing\Annotation\Route;
/**
* @Route(path="/admin/plugins")
* @Security("is_granted('plugins')")
*/
class PluginController extends AbstractController
{
/**
* @var PluginManager
*/
protected $plugins;
/**
* @param PluginManager $manager
*/
public function __construct(PluginManager $manager)
{
$this->plugins = $manager;
}
/**
* @Route(path="/", name="plugins", methods={"GET"})
*
* @return \Symfony\Component\HttpFoundation\Response
*/
public function indexAction()
{
$plugins = $this->plugins->getPlugins();
foreach ($this->plugins->getPlugins() as $plugin) {
$this->plugins->loadMetadata($plugin);
}
return $this->render('plugin/index.html.twig', [
'plugins' => $plugins,
]);
}
}