Index.

@param Request $request

@return JsonResponse
966813
public function indexAction(Request $request)
    {
        $formattedContent = [];

        /** @var ContentManager $manager */
        $contentManager = $this->get('opifer.content.content_manager');

        $contents = $contentManager->getRepository()->getContentFromRequest($request);

        foreach ($contents as $key => $content) {
            $formattedContent[$key]['id'] = $content->getId();
            $formattedContent[$key]['parent_id'] = ($content->getParent()) ? $content->getParent()->getId() : 0;
            $formattedContent[$key]['site_id'] = ($content->getSite()) ? $content->getSite()->getId() : null;
            $formattedContent[$key]['active'] = $content->getActive();
            $formattedContent[$key]['title'] = $content->getTitle();
            $formattedContent[$key]['short_title'] = $content->getShortTitle();
            $formattedContent[$key]['description'] = $content->getDescription();
            $formattedContent[$key]['slug'] = $content->getSlug();
            $formattedContent[$key]['created_at'] = $content->getCreatedAt()->format('Y-m-d H:i:s');
            $formattedContent[$key]['updated_at'] = $content->getUpdatedAt()->format('Y-m-d H:i:s');
            $formattedContent[$key]['publish_at'] = $content->getPublishAt()->format('Y-m-d H:i:s');
            $formattedContent[$key]['path'] = '/'.$content->getSlug();
            $formattedContent[$key]['coverImage'] = '';
            $formattedContent[$key]['content_type']['id'] = ($content->getContentType()) ? $content->getContentType()->getId() : '';
            $formattedContent[$key]['content_type']['name'] = ($content->getContentType()) ? $content->getContentType()->getName() : '';
        }

        $data = [
            'results' => $formattedContent,
        ];

        return new JsonResponse($data);
    }
802583
public function indexAction(Request $request)
    {
        $query = $request->query->get('query');
        $limit = $request->query->get('limit');
        $start = $request->query->get('start');

        $searchProviders = $this->get('search.providers');

        $content = '';
        $content .= '<h3>Registered Search Providers:</h3><table><tr><th>Class</th><th>Resource</th><th>Search key</th></tr>';
        foreach ($searchProviders as $searchProvider) {
            $content .= '<tr>';
            $content .= '<td>'.get_class($searchProvider).'</td>';
            $content .= '<td>'.$searchProvider->getResource().'</td>';
            $content .= '<td>'.$searchProvider->getSearchKey().'</td>';
            $content .= '</tr>';
        }
        $content .= '</table>';

        $content .= '<h3>Search:</h3>';
        $content .= '<form><input name="query" value="'.$query.'"/><input type="submit" value="send" /></form>';

        if ($query) {
            $content .= '<h3>Results:</h3>';
            $search = $this->getContainer()->get('search.search');
            $results = $search->search($query);
            $content .= '<pre>';
            $content .= print_r($results, true);
            $content .= '</pre>';
        }

        return new Response($content);
    }
678987
public function indexAction(Request $request)
    {
        $language = $this->getLanguage($request);
        $webspace = $this->getWebspace($request);

        $result = $this->getRepository()->getIndexNode($webspace, $language);

        return $this->handleView($this->view($result));
    }
827324
public function listAction(Request $request)
    {
        if (!$request->isXmlHttpRequest()) {
            throw new NotFoundHttpException();
        }

        $root = $this->getFolderRepository()->findRoot();
        if (null !== $id = $request->query->get('folderId')) {
            if (!$this->activateFolderById($id, $root)) {
                $root->setActive(true);
            }
        } else {
            $root->setActive(true);
        }

        $folders = $this->get('jms_serializer')->serialize(
            array($root),
            'json',
            SerializationContext::create()->setGroups(array('Manager'))
        );

        $response = new Response($folders);
        $response->headers->add(array('Content-Type' => 'application/json'));

        return $response;
    }
451392
public function ajaxIndexAction(Request $request): Response
    {
        if (!$request->isXmlHttpRequest()) {
            return $this->redirectToAction('index');
        }
        
        $attributeGroupId = (int)$request->request->get('id');
        $attributeGroup   = $this->getManager()->findAttributeGroup($attributeGroupId);
        
        return $this->jsonResponse([
            'attributes' => $this->getManager()->getRepository()->getAttributeSet($attributeGroup),
        ]);
    }
1256399
public function index(IndexRequest $request)
    {
        $user = $request->user();
        $pageSize = 20;
        $page = $request->get('page', 1);
        list($items, $unreadCount) = $this->repository->getItems($user, $page, $pageSize);
        return $this->sendResponse([
            'items'  => $items,
            'unread' => $unreadCount
        ], '');
    }
718241
public function index(Request $request)
    {
        // Set roles that have access
        $request->user()->authorizeRoles(['admin']);

        // Get all pagetypes
        $pagetypes = PageType::orderBy('updated_at', 'desc')
            ->orderBy('created_at', 'desc')
            ->paginate(self::PAGINATION_ITEMS);

        return view('page::pagetypes.index', ['pagetypes' => $pagetypes]);
    }
1176843
public function indexAction(Request $request)
    {
        $query = htmlspecialchars($request->query->get('q'));

        $queryMinLength = $this->getParameter('darvin_admin.search_query_min_length');

        $queryTooShort = mb_strlen($query) < $queryMinLength;

        $entityNames = $queryTooShort ? [] : $this->getSearcher()->getSearchableEntityNames();

        return $this->render('DarvinAdminBundle:Search:index.html.twig', [
            'entity_names'     => $entityNames,
            'query'            => $query,
            'query_min_length' => $queryMinLength,
            'query_too_short'  => $queryTooShort,
        ]);
    }
1315162
public function indexAction( Request $request )
	{
		if( Auth::check() === false
			|| $request->user()->can( 'admin', [AdminController::class, ['admin', 'editor']] ) === false
		) {
			return redirect()->guest( 'login' );
		}

		$siteId = $request->user()->siteid;
		$context = app( 'aimeos.context' )->get( false );
		$siteManager = \Aimeos\MShop::create( $context, 'locale/site' );
		$siteCode = ( $siteId ? $siteManager->getItem( $siteId )->getCode() : 'default' );
		$locale = $request->user()->langid ?: config( 'app.locale', 'en' );

		$param = array(
			'resource' => 'dashboard',
			'site' => Route::input( 'site', Input::get( 'site', $siteCode ) ),
			'lang' => Route::input( 'lang', Input::get( 'lang', $locale ) )
		);

		return redirect()->route( 'aimeos_shop_jqadm_search', $param );
	}
1125177
public function index(Request $request)
    {
        $spammers = $this->paginate($this->blocker->all(), $request, $this->perPage);

        $this->setTitle($title = trans('seo::spammers.titles.spammers-list'));
        $this->addBreadcrumb($title);

        return $this->view('admin.spammers.index', compact('spammers'));
    }
1228616
public function index(Request $request)
    {
        $images = $this->imageRepository->getPaginated($request->get('limit', 50));

        if($request->ajax()) return $images;

        return view('laramanager::images.index', compact('images'));
    }
978101
public function searchAction(Request $request)
    {
        $queryString = $request->query->get('q');
        $index = $request->query->get('index', null);
        $locale = $request->query->get('locale', null);

        $page = $this->listRestHelper->getPage();
        $limit = $this->listRestHelper->getLimit();
        $startTime = microtime(true);

        $indexes = $index ? [$index] : $this->getAllowedIndexes();

        $query = $this->searchManager->createSearch($queryString);

        if ($locale) {
            $query->locale($locale);
        }

        $query->indexes($indexes);
        $query->setLimit($limit);

        $time = microtime(true) - $startTime;

        $adapter = new ArrayAdapter(iterator_to_array($query->execute()));
        $pager = new Pagerfanta($adapter);
        $pager->setMaxPerPage($limit);
        $pager->setCurrentPage($page);

        $representation = new SearchResultRepresentation(
            new CollectionRepresentation($pager->getCurrentPageResults(), 'result'),
            'sulu_search_search',
            [
                'locale' => $locale,
                'query' => $query,
                'index' => $index,
            ],
            (int) $page,
            (int) $limit,
            $pager->getNbPages(),
            'page',
            'limit',
            false,
            $adapter->getNbResults(),
            $this->getIndexTotals($adapter->getArray()),
            number_format($time, 8)
        );

        $view = View::create($representation);
        $context = new Context();
        $context->enableMaxDepth();
        $view->setContext($context);

        return $this->viewHandler->handle($view);
    }
1003458
public function listAction(Request $request)
    {
        $query = $this->addOrganizationFilter($request->query->all());

        return new JsonResponse($this->finder->search(
            $this->getClass(),
            $query,
            []
        ));
    }
488416
public function search(Request $request)
    {
        $images = $this->imageRepository->search($request->term);

        if($request->ajax()) return response()->json([
            'images' => view('laramanager::browser.images', compact('images'))->render()
        ]);

        return view('laramanager::images.index', compact('images'));
    }
657744
public function index(Request $request)
    {
        $query = Tag::query();

        if ($request->has('filter.containing')) {
            $query->containing($request['filter']['containing']);
        }

        if ($request->has('filter.type')) {
            $query->where('type', $request['filter']['type']);
        }

        if ($request->has('limit')) {
            $query->limit($request['limit']);
        }

        return $query->get()->map(function (Tag $tag) {
            return $tag->name;
        });
    }
204695
public function index(Request $request)
    {
        $notifications = $this->service->paginated();
        return view('admin.notifications.index')->with('notifications', $notifications);
    }
1152635
public function indexAction(Request $request)
    {
        exit('deprecated');
        $this->get('white_october_breadcrumbs')
            ->addItem('Home', $this->get('router')->generate('_homepage'))
            ->addItem('Vendors', $this->get('router')->generate('phospr_vendor'))
        ;

        $organization = $this->get('phospr.organization_handler')
            ->getOrganization()
        ;

        $vendor = new Vendor();
        $vendor->setOrganization($organization);

        $form = $this->createForm(new VendorType(), $vendor, array(
            'label' => 'Create',
            'action' => $this->generateUrl('phospr_vendor_new'),
        ));

        $vendors = $organization->getVendors();

        if ('json' == $request->getRequestFormat()) {
            $vendorsArray = array();

            foreach ($vendors as $vendor) {
                $vendorsArray[] = array(
                  'label'                     => $vendor->getName(),
                  'value'                     => $vendor->getName(),
                  'defaultOffsetAccount'      => $vendor
                      ->getDefaultOffsetAccountSegmentation(),
                  'defaultJournalDescription' => $vendor
                      ->getDefaultJournalDescription(),
                  'defaultJournalCreditAmount' => $vendor
                      ->getDefaultJournalCreditAmount(),
                  'defaultJournalDebitAmount' => $vendor
                      ->getDefaultJournalDebitAmount(),
                );
            }

            $response = new Response(json_encode($vendorsArray, JSON_PRETTY_PRINT));
            $response->headers->set('Content-Type', 'application/json');

            return $response;
        }

        return array(
            'vendors' => $vendors,
            'form'     => $form->createView(),
        );
    }