Renders the manager modal

@param Request $request

@return Response
551576
public function indexAction(Request $request)
    {
        $config = $this->buildConfig($request);

        return $this->render('EkynaMediaBundle:Manager:index.html.twig', array('config' => $config));
    }
588545
public function indexAction(Request $request)
    {
        /* @var EntityManager $em */
        $em = $this->getDoctrine()->getManager();
        $aclHelper = $this->container->get('kunstmaan_admin.acl.helper');

        /* @var AdminList $adminList */
        $adminList = $this->get('kunstmaan_adminlist.factory')->createList(
            new FormPageAdminListConfigurator($em, $aclHelper, PermissionMap::PERMISSION_VIEW),
            $em
        );
        $adminList->bindRequest($request);

        return array('adminlist' => $adminList);
    }
1314481
public function contentAction(Request $request)
    {
        return $this->render('OpiferCmsBundle:CKEditor:content.html.twig', [
            'funcNum' => $request->get('CKEditorFuncNum'),
            'CKEditor' => $request->get('CKEditor'),
            'type' => $request->get('type'),
        ]);
    }
705570
public function indexAction(Request $request)
    {
        $response = $this->getCacheTimeKeeper()->getResponse('AnimeDbCatalogBundle:Label');
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        /* @var $rep Label */
        $rep = $this->getDoctrine()->getManager()->getRepository('AnimeDbCatalogBundle:Label');

        $form = $this->createForm('settings_labels', ['labels' => $rep->findAll()])
            ->handleRequest($request);
        if ($form->isValid()) {
            $rep->updateListLabels(new ArrayCollection($form->getData()['labels']));

            return $this->redirect($this->generateUrl('label'));
        }

        return $this->render('AnimeDbCatalogBundle:Label:index.html.twig', [
            'form' => $form->createView(),
        ], $response);
    }
252189
public function showAction(Request $request)
    {
        $em = $this->getDoctrine()->getManager();
        /* @var $rep NoticeRepository */
        $rep = $em->getRepository('AnimeDbAppBundle:Notice');

        $notice = $rep->getFirstShow();
        // caching
        /* @var $response JsonResponse */
        $response = $this->getCacheTimeKeeper()->getResponse([], -1, new JsonResponse());
        $response->setEtag(md5($notice ? $notice->getId() : 0));
        // response was not modified for this request
        if ($response->isNotModified($request)) {
            return $response;
        }

        // shown notice
        if (!is_null($notice)) {
            $notice->shown();
            $em->persist($notice);
            $em->flush();

            $response->setData([
                'notice' => $notice->getId(),
                'close' => $this->generateUrl('notice_close', ['id' => $notice->getId()]),
                'see_later' => $this->generateUrl('notice_see_later'),
                'content' => $this->renderView('AnimeDbAppBundle:Notice:show.html.twig', [
                    'notice' => $notice,
                    'link_all' => $request->query->getBoolean('all'),
                ]),
            ]);
        }

        return $response;
    }
1037290
public function index(Request $request)
    {
        $input = $request->all();

        $result = $this->repository->paginated();

        return view('cms::modules.images.index')
            ->with('images', $result)
            ->with('pagination', $result->render());
    }
1323651
public function render(Request $request)
    {
        /** @var \Railken\Amethyst\Managers\FileGeneratorManager */
        $manager = $this->manager;

        $dbm = new DataBuilderManager();

        /** @var \Railken\Amethyst\Models\DataBuilder */
        $data_builder = $dbm->getRepository()->findOneById(intval($request->input('data_builder_id')));

        if ($data_builder == null) {
            return $this->error([['message' => 'invalid data_builder_id']]);
        }

        $data = (array) $request->input('data', null);

        $result = $dbm->build($data_builder, $data);

        if (!$result->ok()) {
            return $this->error(['errors' => $result->getSimpleErrors()]);
        }

        $data = array_merge($data, $result->getResource());

        $result = $manager->render(
            $data_builder,
            strval($request->input('filetype')),
            [
                'body'     => strval($request->input('body')),
                'filename' => strval($request->input('filename')),
            ],
            $data
        );

        if (!$result->ok()) {
            return $this->error(['errors' => $result->getSimpleErrors()]);
        }

        $resource = $result->getResource();

        return $this->success(['resource' => [
            'body'     => base64_encode($resource['body']),
            'filename' => base64_encode($resource['filename']),
        ]]);
    }
782925
public function listAction(Request $request = null)
    {
        $this->admin->checkAccess('list');

        if ($listMode = $request->get('_list_mode')) {
            $this->admin->setListMode($listMode);
        }

        $datagrid = $this->admin->getDatagrid();
        $datagrid->setValue('context', null, $this->admin->getPersistentParameter('context'));

        $formView = $datagrid->getForm()->createView();

        // set the theme for the current Admin Form
        $this->setFormTheme($formView, $this->admin->getFilterTheme());

        return $this->render($this->admin->getTemplate('list'), [
            'action' => 'list',
            'form' => $formView,
            'datagrid' => $datagrid,
            'csrf_token' => $this->getCsrfToken('sonata.batch'),
        ]);
    }
415412
public function renderAction(Request $request)
    {
        /*
        $this->admin->checkAccess('compose');
        if (false === $this->get('sonata.dashboard.admin.block')->isGranted('LIST')) {
            throw $this->createAccessDeniedException();
        }
        */

        $admin = $this->getAdmin();

        $id = $request->get($admin->getIdParameter());

        $dashboard = $admin->getObject($id);

        if (!$dashboard) {
            throw $this->createNotFoundException(sprintf('unable to find the dashboard with id : %s', $id));
        }

        $containers = [];

        /** @var array $blocks */
        $blocks = $dashboard->getBlocks();

        // separate containers.
        foreach ($blocks as $block) {
            $containers[] = $block;
        }

        return $this->renderWithExtraParams('@CompoSonataDashboard/Dashboard/render.html.twig', [
            'action' => 'render',
            'admin' => $admin,
            'object' => $dashboard,

            'dashboard' => $dashboard,
            'containers' => $containers,
        ]);
    }
1051016
public function renderToolbarAction(Request $request)
    {
        $tools = $this->toolManager->getAdminToolsByRoles($this->tokenStorage->getToken()->getRoles());

        $current = null;
        if ('claro_admin_open_tool' === $request->get('_route')) {
            $params = $request->get('_route_params');
            if (!empty($params['toolName'])) {
                $current = $params['toolName'];
            }
        }

        return [
            'current' => $current,
            'tools' => array_map(function (AdminTool $tool) {
                return [
                    'icon' => $tool->getClass(),
                    'name' => $tool->getName(),
                    'open' => ['claro_admin_open_tool', ['toolName' => $tool->getName()]],
                ];
            }, $tools),
        ];
    }
436617
public function nodesFormAction(Request $request)
    {
        $node = new Node();
        // Manage edition mode
        $this->currentNode = $request->get('node');
        if ($this->currentNode) {
            $node = $this->get("ydle.node.manager")->find($request->get('node'));
        }
        $action = $this->get('router')->generate('submitNodeForm', array('node' => $this->currentNode));

        $form = $this->createForm("node_form", $node);
        $form->handleRequest($request);

        return $this->render('YdleHubBundle:Nodes:form.html.twig', array(
            'action' => $action,
            'entry' => $node,
            'form' => $form->createView()
        ));
    }
326743
public function homeAction(Request $request)
    {
        /** @var BlockManager $manager */
        $manager  = $this->get('opifer.content.content_manager');
        $host = $request->getHost();
        $em = $this->getDoctrine()->getManager();

        $siteCount = $em->getRepository(Site::class)->createQueryBuilder('s')
            ->select('count(s.id)')
            ->getQuery()
            ->getSingleScalarResult();

        $domain = $em->getRepository(Domain::class)->findOneByDomain($host);

        if ($siteCount && $domain->getSite()->getDefaultLocale()) {
            $request->setLocale($domain->getSite()->getDefaultLocale()->getLocale());
        }

        if (!$domain && $siteCount > 1) {
            return $this->render('OpiferContentBundle:Content:domain_not_found.html.twig');
        }

        $content = $manager->getRepository()->findActiveBySlug('index', $host);

        return $this->forward('OpiferContentBundle:Frontend/Content:view', [
            'content' => $content
        ]);
    }
667063
public function createMediaAction(Request $request)
    {
        if (!$request->isXmlHttpRequest()) {
            throw new NotFoundHttpException();
        }

        $folderId = $request->attributes->get('id');
        $folder = $this->findFolderById($folderId);

        $upload = new MediaUpload();

        $form = $this->createForm('ekyna_media_upload', $upload, array(
            'action' => $this->generateUrl(
                'ekyna_media_browser_admin_create_media',
                array('id' => $folderId)
            ),
            'method' => 'POST',
            'attr'   => array(
                'class' => 'form-horizontal form-with-tabs',
            ),
            'folder' => $folder,
        ));

        $modal = $this->createModal();
        $modal->setTitle('ekyna_media.upload.title');
        $modal->setVars(array(
            'form_template' => 'EkynaMediaBundle:Manager:upload.html.twig',
        ));

        $success = false;
        $form->handleRequest($request);
        if ($form->isValid()) {
            $success = true;
            // TODO use ResourceManager
            foreach ($upload->getMedias() as $media) {
                $event = $this->get('ekyna_media.media.operator')->create($media);
                if ($event->hasErrors()) {
                    $success = false;
                    break;
                }
            }
        }
        if ($success) {
            $modal->setContent(array('success' => true));
        } else {
            $modal->setContent($form->createView());
        }

        return $this->get('ekyna_core.modal')->render($modal);
    }
407196
public function listAction(Request $request)
    {
        return $this->render('SynapsePageBundle:Admin/Page:list.html.twig', array(
            'pages' => $this->container->get('synapse.page.loader')->retrieveAll(),
            'page_rendering_route' => $this->container->getParameter('synapse.page.rendering_route'),
        ));
    }
759932
public function editModalAction(Request $request, $id)
    {
        $activityService = $this->get('campaignchain.core.activity');
        $this->activity = $activityService->getActivity($id);
        $this->location = $this->activity->getLocation();
        $this->campaign = $this->activity->getCampaign();

        if($this->parameters['equals_operation']) {
            // Get the one operation.
            $this->operations[0] = $activityService->getOperation($id);
        } else {
            throw new \Exception(
                'Multiple Operations for one Activity not implemented yet.'
            );
        }

        $this->handler->preFormSubmitEditModalEvent($this->operations[0]);

        $form = $this->createForm(
            ActivityType::class,
            $this->activity,
            $this->getActivityFormTypeOptions('default')
        );

        $form->handleRequest($request);

        /*
         * Define default rendering options and then apply those defined by the
         * module's handler if applicable.
         */
        $defaultRenderOptions = array(
            'template' => 'CampaignChainCoreBundle:Base:new_modal.html.twig',
            'vars' => array(
                'page_title' => 'Edit Activity',
                'form' => $form->createView()
            )
        );

        $handlerRenderOptions = $this->handler->getEditModalRenderOptions(
            $this->operations[0]
        );

        return $this->renderWithHandlerOptions($defaultRenderOptions, $handlerRenderOptions);
    }
439596
public function updateVisibilityAction(Request $request): Response
    {
        $form = $this->formFactory->updateVisibilityLocation();
        $form->handleRequest($request);

        if ($form->isSubmitted() && $form->isValid()) {
            $data = $form->getData();

            /** @var \eZ\Publish\API\Repository\Values\Content\Location $location */
            $location = $data->getLocation();
            $hidden = $data->getHidden();

            try {
                /** @var \eZ\Publish\API\Repository\Values\Content\ContentInfo $contentInfo */
                $contentInfo = $location->getContentInfo();

                if ($hidden) {
                    $this->locationService->hideLocation($location);
                    $message = $this->translator->trans(
                        /** @Desc("Location '%name%' hidden.") */
                        'location.update_success.success.hidden',
                        ['%name%' => $contentInfo->name],
                        'location'
                    );
                } else {
                    $this->locationService->unhideLocation($location);
                    $message = $this->translator->trans(
                        /** @Desc("Location '%name%' unhidden.") */
                        'location.update_success.success.unhidden',
                        ['%name%' => $contentInfo->name],
                        'location'
                    );
                }
            } catch (APIRepositoryUnauthorizedException $e) {
                return new JsonResponse(['errors' => [$e->getMessage()]], Response::HTTP_UNAUTHORIZED);
            }
        } else {
            $errors = [];
            foreach ($form->getErrors(true, true) as $formError) {
                $errors[] = $formError->getMessage();
            }

            return new JsonResponse(['errors' => $errors], Response::HTTP_UNPROCESSABLE_ENTITY);
        }

        return new JsonResponse(['message' => $message]);
    }
624849
public function listAction(Request $request)
    {
        $dataGrid = $this->getDataGrid();

        $this->bindDataGridRequest($dataGrid, $request);

        return $this->renderAction(
            array_merge(
                $this->getViewParameters($request),
                ['datagrid' => $dataGrid]
            )
        );
    }