vendor/blackbit/data-director/Controller/MiscController.php line 24

Open in your IDE?
  1. <?php
  2. /*
  3.  * Copyright Blackbit digital Commerce GmbH <info@blackbit.de>
  4.  *  
  5.  *  This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3 of the License, or (at your option) any later version.
  6.  *  This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  7.  *  
  8.  *  You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  9.  */
  10. namespace Blackbit\DataDirectorBundle\Controller;
  11. use Symfony\Component\HttpFoundation\Request;
  12. use Symfony\Component\HttpFoundation\Response;
  13. use Symfony\Component\Routing\Annotation\Route;
  14. class MiscController
  15. {
  16.     /**
  17.      * @Route("/BlackbitDataDirector/translation-language-icons")
  18.      *
  19.      * those language icons are necessary for DeepL icons but Pimcore does not create all of them in admin_css.html.twig
  20.      */
  21.     public function translationLanguageIconsAction(Request $request)
  22.     {
  23.         $response = new Response();
  24.         $response->headers->set('Content-Type''text/css');
  25.         $css '';
  26.         foreach (MappingconfigController::getAutotranslateLanguages() as &$languageItem) {
  27.             $css .= '
  28. .pimcore_icon_language_'.strtolower($languageItem['value']).' {
  29.     background: url('.\Pimcore\Bundle\AdminBundle\Tool::getLanguageFlagFile($languageItem['value'], false).') center center/contain no-repeat;
  30. }';
  31.         }
  32.         unset($languageItem);
  33.         $response->setContent($css);
  34.         return $response;
  35.     }
  36. }