mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 15:03:25 +00:00
Use BaseController
This commit is contained in:
@@ -13,6 +13,7 @@ namespace Alchemy\Phrasea\Controller\Admin;
|
|||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Alchemy\Phrasea\Authentication\ACLProvider;
|
use Alchemy\Phrasea\Authentication\ACLProvider;
|
||||||
use Alchemy\Phrasea\Authentication\Authenticator;
|
use Alchemy\Phrasea\Authentication\Authenticator;
|
||||||
|
use Alchemy\Phrasea\Controller\Controller;
|
||||||
use Alchemy\Phrasea\Exception\RuntimeException;
|
use Alchemy\Phrasea\Exception\RuntimeException;
|
||||||
use Alchemy\Phrasea\Model\Entities\User;
|
use Alchemy\Phrasea\Model\Entities\User;
|
||||||
use Alchemy\Phrasea\Model\Repositories\UserRepository;
|
use Alchemy\Phrasea\Model\Repositories\UserRepository;
|
||||||
@@ -20,49 +21,8 @@ use Doctrine\DBAL\Connection;
|
|||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class CollectionController
|
class CollectionController extends Controller
|
||||||
{
|
{
|
||||||
/** @var Application */
|
|
||||||
private $app;
|
|
||||||
|
|
||||||
public function __construct(Application $app)
|
|
||||||
{
|
|
||||||
$this->app = $app;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return User|null
|
|
||||||
*/
|
|
||||||
private function getAuthenticatedUser()
|
|
||||||
{
|
|
||||||
/** @var Authenticator $authenticator */
|
|
||||||
$authenticator = $this->app['authentication'];
|
|
||||||
return $authenticator->getUser();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return \ACL
|
|
||||||
*/
|
|
||||||
private function getAuthenticatedUserAcl()
|
|
||||||
{
|
|
||||||
/** @var ACLProvider $acl */
|
|
||||||
$acl = $this->app['acl'];
|
|
||||||
return $acl->get($this->getAuthenticatedUser());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $template
|
|
||||||
* @param array $parameters
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
private function render($template, array $parameters = [])
|
|
||||||
{
|
|
||||||
/** @var \Twig_Environment $twig */
|
|
||||||
$twig = $this->app['twig'];
|
|
||||||
|
|
||||||
return $twig->render($template, $parameters);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display collection information page
|
* Display collection information page
|
||||||
*
|
*
|
||||||
@@ -76,7 +36,7 @@ class CollectionController
|
|||||||
|
|
||||||
$admins = [];
|
$admins = [];
|
||||||
|
|
||||||
if ($this->getAuthenticatedUserAcl()->has_right_on_base($bas_id, 'manage')) {
|
if ($this->getAclForUser()->has_right_on_base($bas_id, 'manage')) {
|
||||||
/** @var \User_Query $query */
|
/** @var \User_Query $query */
|
||||||
$query = $this->app['phraseanet.user-query'];
|
$query = $this->app['phraseanet.user-query'];
|
||||||
$admins = $query->on_base_ids([$bas_id])
|
$admins = $query->on_base_ids([$bas_id])
|
||||||
|
@@ -13,16 +13,15 @@ namespace Alchemy\Phrasea\Controller\Admin;
|
|||||||
use Alchemy\Geonames\Exception\ExceptionInterface;
|
use Alchemy\Geonames\Exception\ExceptionInterface;
|
||||||
use Alchemy\Geonames\Geoname;
|
use Alchemy\Geonames\Geoname;
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
use Alchemy\Phrasea\Controller\Controller;
|
||||||
use Alchemy\Phrasea\Model\Entities\Session;
|
use Alchemy\Phrasea\Model\Entities\Session;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
use Psr\Log\LoggerInterface;
|
use Psr\Log\LoggerInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\Translation\TranslatorInterface;
|
use Symfony\Component\Translation\TranslatorInterface;
|
||||||
|
|
||||||
class ConnectedUsersController
|
class ConnectedUsersController extends Controller
|
||||||
{
|
{
|
||||||
/** @var Application */
|
|
||||||
private $app;
|
|
||||||
/** @var TranslatorInterface */
|
/** @var TranslatorInterface */
|
||||||
private $translator;
|
private $translator;
|
||||||
protected $moduleNames;
|
protected $moduleNames;
|
||||||
@@ -31,7 +30,7 @@ class ConnectedUsersController
|
|||||||
|
|
||||||
public function __construct(Application $app)
|
public function __construct(Application $app)
|
||||||
{
|
{
|
||||||
$this->app = $app;
|
parent::__construct($app);
|
||||||
$this->translator = $app['translator'];
|
$this->translator = $app['translator'];
|
||||||
$this->logger = $app['monolog'];
|
$this->logger = $app['monolog'];
|
||||||
}
|
}
|
||||||
|
@@ -13,6 +13,7 @@ namespace Alchemy\Phrasea\Controller\Admin;
|
|||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Alchemy\Phrasea\Authentication\Authenticator;
|
use Alchemy\Phrasea\Authentication\Authenticator;
|
||||||
use Alchemy\Phrasea\Cache\Cache;
|
use Alchemy\Phrasea\Cache\Cache;
|
||||||
|
use Alchemy\Phrasea\Controller\Controller;
|
||||||
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
||||||
use Alchemy\Phrasea\Exception\RuntimeException;
|
use Alchemy\Phrasea\Exception\RuntimeException;
|
||||||
use Alchemy\Phrasea\Model\Manipulator\ACLManipulator;
|
use Alchemy\Phrasea\Model\Manipulator\ACLManipulator;
|
||||||
@@ -24,16 +25,8 @@ use Alchemy\Phrasea\Notification\Receiver;
|
|||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
class DashboardController
|
class DashboardController extends Controller
|
||||||
{
|
{
|
||||||
/** @var Application */
|
|
||||||
private $app;
|
|
||||||
|
|
||||||
public function __construct(Application $app)
|
|
||||||
{
|
|
||||||
$this->app = $app;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Display admin dashboard page
|
* Display admin dashboard page
|
||||||
*
|
*
|
||||||
@@ -161,18 +154,6 @@ class DashboardController
|
|||||||
return $this->app->redirectPath('admin_dashboard');
|
return $this->app->redirectPath('admin_dashboard');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $name
|
|
||||||
* @param array $context
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function render($name, array $context = [])
|
|
||||||
{
|
|
||||||
/** @var \Twig_Environment $twig */
|
|
||||||
$twig = $this->app['twig'];
|
|
||||||
return $twig->render($name, $context);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return UserRepository
|
* @return UserRepository
|
||||||
*/
|
*/
|
||||||
|
@@ -13,23 +13,15 @@ namespace Alchemy\Phrasea\Controller\Admin;
|
|||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Alchemy\Phrasea\Authentication\ACLProvider;
|
use Alchemy\Phrasea\Authentication\ACLProvider;
|
||||||
use Alchemy\Phrasea\Authentication\Authenticator;
|
use Alchemy\Phrasea\Authentication\Authenticator;
|
||||||
use Alchemy\Phrasea\Model\Entities\User;
|
use Alchemy\Phrasea\Controller\Controller;
|
||||||
use Alchemy\Phrasea\Model\Manipulator\TaskManipulator;
|
use Alchemy\Phrasea\Model\Manipulator\TaskManipulator;
|
||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class DataboxController
|
class DataboxController extends Controller
|
||||||
{
|
{
|
||||||
/** @var Application */
|
|
||||||
private $app;
|
|
||||||
|
|
||||||
public function __construct(Application $app)
|
|
||||||
{
|
|
||||||
$this->app = $app;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @param integer $databox_id
|
* @param integer $databox_id
|
||||||
@@ -772,68 +764,4 @@ class DataboxController
|
|||||||
'total' => $total
|
'total' => $total
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return \appbox
|
|
||||||
*/
|
|
||||||
private function getApplicationBox()
|
|
||||||
{
|
|
||||||
return $this->app['phraseanet.appbox'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param int $id
|
|
||||||
* @return \databox
|
|
||||||
*/
|
|
||||||
private function findDataboxById($id)
|
|
||||||
{
|
|
||||||
$appbox = $this->getApplicationBox();
|
|
||||||
|
|
||||||
return $appbox->get_databox($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param $name
|
|
||||||
* @param array $context
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
private function render($name, array $context = [])
|
|
||||||
{
|
|
||||||
/** @var \Twig_Environment $twig */
|
|
||||||
$twig = $this->app['twig'];
|
|
||||||
return $twig->render(
|
|
||||||
$name,
|
|
||||||
$context
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return ACLProvider
|
|
||||||
*/
|
|
||||||
private function getAclProvider()
|
|
||||||
{
|
|
||||||
return $this->app['acl'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Authenticator
|
|
||||||
*/
|
|
||||||
private function getAuthenticator()
|
|
||||||
{
|
|
||||||
return $this->app['authentication'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param User|null $user
|
|
||||||
* @return \ACL
|
|
||||||
*/
|
|
||||||
private function getAclForUser(User $user = null)
|
|
||||||
{
|
|
||||||
$aclProvider = $this->getAclProvider();
|
|
||||||
if (null === $user) {
|
|
||||||
$user = $this->getAuthenticator()->getUser();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $aclProvider->get($user);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -11,25 +11,15 @@
|
|||||||
namespace Alchemy\Phrasea\Controller\Admin;
|
namespace Alchemy\Phrasea\Controller\Admin;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Alchemy\Phrasea\Authentication\ACLProvider;
|
use Alchemy\Phrasea\Controller\Controller;
|
||||||
use Alchemy\Phrasea\Authentication\Authenticator;
|
|
||||||
use Alchemy\Phrasea\Model\Entities\User;
|
|
||||||
use Doctrine\DBAL\Connection;
|
use Doctrine\DBAL\Connection;
|
||||||
use Doctrine\DBAL\DBALException;
|
use Doctrine\DBAL\DBALException;
|
||||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class DataboxesController
|
class DataboxesController extends Controller
|
||||||
{
|
{
|
||||||
/** @var Application */
|
|
||||||
private $app;
|
|
||||||
|
|
||||||
public function __construct(Application $app)
|
|
||||||
{
|
|
||||||
$this->app = $app;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get Databases control panel
|
* Get Databases control panel
|
||||||
*
|
*
|
||||||
@@ -273,68 +263,4 @@ class DataboxesController
|
|||||||
}
|
}
|
||||||
return $this->app->redirectPath('admin_databases', ['success' => 0, 'error' => 'mount-failed']);
|
return $this->app->redirectPath('admin_databases', ['success' => 0, 'error' => 'mount-failed']);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return \appbox
|
|
||||||
*/
|
|
||||||
private function getApplicationBox()
|
|
||||||
{
|
|
||||||
return $this->app['phraseanet.appbox'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param int $id
|
|
||||||
* @return \databox
|
|
||||||
*/
|
|
||||||
private function findDataboxById($id)
|
|
||||||
{
|
|
||||||
$appbox = $this->getApplicationBox();
|
|
||||||
|
|
||||||
return $appbox->get_databox($id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param $name
|
|
||||||
* @param array $context
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
private function render($name, array $context = [])
|
|
||||||
{
|
|
||||||
/** @var \Twig_Environment $twig */
|
|
||||||
$twig = $this->app['twig'];
|
|
||||||
return $twig->render(
|
|
||||||
$name,
|
|
||||||
$context
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return ACLProvider
|
|
||||||
*/
|
|
||||||
private function getAclProvider()
|
|
||||||
{
|
|
||||||
return $this->app['acl'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Authenticator
|
|
||||||
*/
|
|
||||||
private function getAuthenticator()
|
|
||||||
{
|
|
||||||
return $this->app['authentication'];
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param User|null $user
|
|
||||||
* @return \ACL
|
|
||||||
*/
|
|
||||||
private function getAclForUser(User $user = null)
|
|
||||||
{
|
|
||||||
$aclProvider = $this->getAclProvider();
|
|
||||||
if (null === $user) {
|
|
||||||
$user = $this->getAuthenticator()->getUser();
|
|
||||||
}
|
|
||||||
|
|
||||||
return $aclProvider->get($user);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
@@ -11,22 +11,15 @@
|
|||||||
namespace Alchemy\Phrasea\Controller\Admin;
|
namespace Alchemy\Phrasea\Controller\Admin;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
|
use Alchemy\Phrasea\Controller\Controller;
|
||||||
use Alchemy\Phrasea\Metadata\TagProvider;
|
use Alchemy\Phrasea\Metadata\TagProvider;
|
||||||
use Alchemy\Phrasea\Vocabulary\Controller as VocabularyController;
|
use Alchemy\Phrasea\Vocabulary\Controller as VocabularyController;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
|
||||||
|
|
||||||
class FieldsController
|
class FieldsController extends Controller
|
||||||
{
|
{
|
||||||
/** @var Application */
|
|
||||||
private $app;
|
|
||||||
|
|
||||||
public function __construct(Application $app)
|
|
||||||
{
|
|
||||||
$this->app = $app;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function updateFields(Application $app, Request $request, $sbas_id)
|
public function updateFields(Application $app, Request $request, $sbas_id)
|
||||||
{
|
{
|
||||||
$fields = [];
|
$fields = [];
|
||||||
|
@@ -13,6 +13,7 @@ namespace Alchemy\Phrasea\Controller\Admin;
|
|||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Alchemy\Phrasea\Authentication\ACLProvider;
|
use Alchemy\Phrasea\Authentication\ACLProvider;
|
||||||
use Alchemy\Phrasea\Authentication\Authenticator;
|
use Alchemy\Phrasea\Authentication\Authenticator;
|
||||||
|
use Alchemy\Phrasea\Controller\Controller;
|
||||||
use Alchemy\Phrasea\Core\Response\CSVFileResponse;
|
use Alchemy\Phrasea\Core\Response\CSVFileResponse;
|
||||||
use Alchemy\Phrasea\Helper\User as UserHelper;
|
use Alchemy\Phrasea\Helper\User as UserHelper;
|
||||||
use Alchemy\Phrasea\Model\Entities\FtpCredential;
|
use Alchemy\Phrasea\Model\Entities\FtpCredential;
|
||||||
@@ -30,16 +31,8 @@ use Goodby\CSV\Import\Standard\Interpreter;
|
|||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class UserController
|
class UserController extends Controller
|
||||||
{
|
{
|
||||||
/** @var Application */
|
|
||||||
private $app;
|
|
||||||
|
|
||||||
public function __construct(Application $app)
|
|
||||||
{
|
|
||||||
$this->app = $app;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function editRightsAction(Request $request)
|
public function editRightsAction(Request $request)
|
||||||
{
|
{
|
||||||
$rights = $this->getUserEditHelper($request);
|
$rights = $this->getUserEditHelper($request);
|
||||||
@@ -925,19 +918,6 @@ class UserController
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $name
|
|
||||||
* @param array $context
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
private function render($name, array $context = [])
|
|
||||||
{
|
|
||||||
/** @var \Twig_Environment $twig */
|
|
||||||
$twig = $this->app['twig'];
|
|
||||||
|
|
||||||
return $twig->render($name, $context);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Request $request
|
* @param Request $request
|
||||||
* @return UserHelper\Edit
|
* @return UserHelper\Edit
|
||||||
@@ -983,16 +963,6 @@ class UserController
|
|||||||
return $exporter;
|
return $exporter;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return User|null
|
|
||||||
*/
|
|
||||||
private function getAuthenticatedUser()
|
|
||||||
{
|
|
||||||
/** @var Authenticator $authenticator */
|
|
||||||
$authenticator = $this->app['authentication'];
|
|
||||||
return $authenticator->getUser();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param array $template
|
* @param array $template
|
||||||
* @return array
|
* @return array
|
||||||
@@ -1031,17 +1001,6 @@ class UserController
|
|||||||
return $deny;
|
return $deny;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param User $user
|
|
||||||
* @return \ACL
|
|
||||||
*/
|
|
||||||
private function getAclForUser(User $user)
|
|
||||||
{
|
|
||||||
/** @var ACLProvider $aclProvider */
|
|
||||||
$aclProvider = $this->app['acl'];
|
|
||||||
return $aclProvider->get($user);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return RegistrationManipulator
|
* @return RegistrationManipulator
|
||||||
*/
|
*/
|
||||||
|
@@ -24,16 +24,8 @@ use Alchemy\Phrasea\Model\Repositories\BasketRepository;
|
|||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
|
|
||||||
class LightboxController
|
class LightboxController extends Controller
|
||||||
{
|
{
|
||||||
/** @var Application */
|
|
||||||
protected $app;
|
|
||||||
|
|
||||||
public function __construct(Application $app)
|
|
||||||
{
|
|
||||||
$this->app = $app;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function rootAction()
|
public function rootAction()
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
@@ -60,28 +52,6 @@ class LightboxController
|
|||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $template
|
|
||||||
* @param array $parameters
|
|
||||||
* @return Response
|
|
||||||
*/
|
|
||||||
private function renderResponse($template, array $parameters = [])
|
|
||||||
{
|
|
||||||
return new Response($this->render($template, $parameters));
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $template
|
|
||||||
* @param array $parameters
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
private function render($template, array $parameters = [])
|
|
||||||
{
|
|
||||||
/** @var \Twig_Environment $twig */
|
|
||||||
$twig = $this->app['twig'];
|
|
||||||
return $twig->render($template, $parameters);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param int $sselcont_id
|
* @param int $sselcont_id
|
||||||
* @return Response
|
* @return Response
|
||||||
@@ -444,16 +414,6 @@ class LightboxController
|
|||||||
return $this->app->json($ret);
|
return $this->app->json($ret);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return mixed
|
|
||||||
*/
|
|
||||||
private function getAuthenticatedUser()
|
|
||||||
{
|
|
||||||
/** @var Authenticator $authentication */
|
|
||||||
$authentication = $this->app['authentication'];
|
|
||||||
return $authentication->getUser();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param Basket $basket
|
* @param Basket $basket
|
||||||
* @return Response
|
* @return Response
|
||||||
|
@@ -21,28 +21,8 @@ use Doctrine\DBAL\Connection;
|
|||||||
use Silex\Application as SilexApplication;
|
use Silex\Application as SilexApplication;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
|
||||||
class SetupController
|
class SetupController extends Controller
|
||||||
{
|
{
|
||||||
/** @var Application */
|
|
||||||
private $app;
|
|
||||||
|
|
||||||
public function __construct(Application $app)
|
|
||||||
{
|
|
||||||
$this->app = $app;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $template
|
|
||||||
* @param array $parameters
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
private function render($template, array $parameters = [])
|
|
||||||
{
|
|
||||||
/** @var \Twig_Environment $twig */
|
|
||||||
$twig = $this->app['twig'];
|
|
||||||
return $twig->render($template, $parameters);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function rootInstaller(Request $request)
|
public function rootInstaller(Request $request)
|
||||||
{
|
{
|
||||||
$requirementsCollection = $this->getRequirementsCollection();
|
$requirementsCollection = $this->getRequirementsCollection();
|
||||||
|
Reference in New Issue
Block a user