<?php
/*
* Copyright Blackbit digital Commerce GmbH <info@blackbit.de>
*
* 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.
* 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.
*
* 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
*/
namespace Blackbit\DataDirectorBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route;
class MiscController
{
/**
* @Route("/BlackbitDataDirector/translation-language-icons")
*
* those language icons are necessary for DeepL icons but Pimcore does not create all of them in admin_css.html.twig
*/
public function translationLanguageIconsAction(Request $request)
{
$response = new Response();
$response->headers->set('Content-Type', 'text/css');
$css = '';
foreach (MappingconfigController::getAutotranslateLanguages() as &$languageItem) {
$css .= '
.pimcore_icon_language_'.strtolower($languageItem['value']).' {
background: url('.\Pimcore\Bundle\AdminBundle\Tool::getLanguageFlagFile($languageItem['value'], false).') center center/contain no-repeat;
}';
}
unset($languageItem);
$response->setContent($css);
return $response;
}
}