From 7b700df8814c7cc98b3c3a91a05aeebb424d3997 Mon Sep 17 00:00:00 2001 From: Mantas Date: Wed, 16 Mar 2016 16:09:06 +0200 Subject: [PATCH] made list of locales to be formed from config --- Controller/ListController.php | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/Controller/ListController.php b/Controller/ListController.php index e998790..569dbf0 100644 --- a/Controller/ListController.php +++ b/Controller/ListController.php @@ -71,19 +71,12 @@ public function listAction(Request $request) */ private function buildLocalesList($filter) { - $search = $this->repository->createSearch(); - - $localeAgg = new TermsAggregation('locale_agg'); - $localeAgg->setField('messages.locale'); - $search->addAggregation($localeAgg); - $result = $this->repository->execute($search, Result::RESULTS_RAW); + $locales = $this->container->getParameter('ongr_translations.managed_locales'); $list = []; - - foreach ($result['aggregations']['locale_agg']['buckets'] as $value) { - $list[$value['key']] = true; + foreach ($locales as $locale) { + $list[$locale] = true; } ksort($list); - $activeLocales = []; if ($filter->getState()->isActive()) {