public function listAction()
{
if (false === $this->admin->isGranted('LIST')) {
throw new AccessDeniedException();
}
/** @var Request $request */
$request = $this->container->get('request_stack')->getCurrentRequest();
$galleryListMode = $request->get('pcode') ? true : false;
$datagrid = $this->admin->getDatagrid();
$persistentParameters = $this->admin->getPersistentParameters();
$formView = $datagrid->getForm()->createView();
$this->get('twig')->getExtension('form')->renderer->setTheme($formView, $this->admin->getFilterTheme());
return $this->render($this->admin->getTemplate('list'), array('providers' => $this->get('sonata.media.pool')->getProvidersByContext($request->get('context', $persistentParameters['context'])), 'action' => 'list', 'form' => $formView, 'datagrid' => $datagrid, 'galleryListMode' => $galleryListMode, 'csrf_token' => $this->getCsrfToken('sonata.batch'), 'show_actions' => true));
}