Create page that replace the "home" folder

Now it works in different languages and portals.
pull/2635/head
Julio Montoya 6 years ago
parent aada9288ee
commit 32790d9788
  1. 3
      composer.json
  2. 1
      config/bundles.php
  3. 70
      config/packages/lunetics_locale.yaml
  4. 4
      config/packages/sonata_page.yaml
  5. 1
      config/services.yaml
  6. 2
      main/admin/configure_homepage.php
  7. 4
      main/admin/configure_inscription.php
  8. 2
      main/auth/inscription.php
  9. 1
      main/inc/lib/course.lib.php
  10. 10
      main/inc/lib/sessionmanager.lib.php
  11. 73
      src/CoreBundle/Controller/IndexController.php
  12. 6
      src/CoreBundle/EventListener/LegacyListener.php
  13. 47
      src/CoreBundle/EventListener/LocaleListener.php
  14. 29
      src/CoreBundle/Framework/Container.php
  15. 60
      src/CoreBundle/Resources/views/Admin/switcher_links.html.twig
  16. 2
      src/CoreBundle/Resources/views/Index/index.html.twig
  17. 11
      src/CoreBundle/Resources/views/Index/inscription_edit.html.twig
  18. 2
      src/CoreBundle/Resources/views/Index/page.html.twig
  19. 15
      src/CoreBundle/Resources/views/Index/page_edit.html.twig
  20. 11
      src/CoreBundle/Resources/views/Index/welcome_edit.html.twig
  21. 145
      src/PageBundle/Controller/PageController.php
  22. 42
      src/ThemeBundle/Resources/views/Sidebar/login.html.twig
  23. 2
      src/UserBundle/Entity/User.php

@ -154,7 +154,8 @@
"knplabs/knp-menu-bundle": "^2.0",
"symfony/requirements-checker": "^1.1",
"liip/theme-bundle": "^1.5",
"a2lix/translation-form-bundle": "^3.0"
"a2lix/translation-form-bundle": "^3.0",
"lunetics/locale-bundle": "^2.6"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.7",

@ -68,4 +68,5 @@ return [
A2lix\AutoFormBundle\A2lixAutoFormBundle::class => ['all' => true],
A2lix\TranslationFormBundle\A2lixTranslationFormBundle::class => ['all' => true],
Ivory\CKEditorBundle\IvoryCKEditorBundle::class => ['all' => true],
Lunetics\LocaleBundle\LuneticsLocaleBundle::class => ['all' => true],
];

@ -0,0 +1,70 @@
lunetics_locale:
guessing_order:
- query
- session
- cookie
- browser
- router
switcher:
show_current_locale: true
allowed_locales: # From DB table languages
- 'ar'
- 'ast'
- 'eu'
- 'bn'
- 'bs'
- 'pt-BR'
- 'bg'
- 'ca'
- 'hr'
- 'cs'
- 'da'
- 'prs'
- 'nl'
- 'en'
- 'eo'
- 'fo'
- 'fi'
- 'fr'
- 'fur'
- 'gl'
- 'ka'
- 'de'
- 'el'
- 'he'
- 'hi'
- 'hu'
- 'id'
- 'it'
- 'ja'
- 'ko'
- 'lv'
- 'lt'
- 'mk'
- 'ms'
- 'no'
- 'oc'
- 'ps'
- 'fa'
- 'pl'
- 'pt'
- 'qu'
- 'ro'
- 'ru'
- 'sr'
- 'zh'
- 'sk'
- 'sl'
- 'so'
- 'es'
- 'sw'
- 'sv'
- 'tl'
- 'th'
- 'bo'
- 'zh-TW'
- 'tr'
- 'uk'
- 'vi'
- 'xh'
- 'yo'

@ -33,6 +33,7 @@ sonata_page:
- ^/_profiler/(.*)
- ^/userportal
- ^/userportal/(.*)
- ^/internal_page/(.*)
- ^/js/(.*)
- ^/faq/(.*)
- ^/faq
@ -48,8 +49,7 @@ sonata_page:
- sylius_flow(.*)
ignore_routes:
- home
- edit_welcome
- edit_inscription
- internal_page
- elfinder
- login
- logout

@ -14,7 +14,6 @@ services:
exclude: '../src/PageBundle/{Entity,Migrations,Tests}'
public: true
# Put parameters here that don't need to change on each machine where the app is deployed
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
parameters:

@ -1122,7 +1122,7 @@ switch ($action) {
</div>
<div class="col-md-9">
<div class="actions">
<a href="<?php echo $selfUrl; ?>?action=edit_top&language=<?php echo $languageGet; ?>">
<a href="<?php echo api_get_path(WEB_PUBLIC_PATH); ?>?action=edit_top&language=<?php echo $languageGet; ?>">
<?php echo Display::return_icon('edit.png', get_lang('EditHomePage'), null, ICON_SIZE_SMALL).'&nbsp;'.get_lang('EditHomePage'); ?>
</a>
</div>

@ -155,7 +155,6 @@ if (!empty($action)) {
}
}*/
$form = new FormValidator('registration');
if (api_get_setting('allow_terms_conditions') === 'true') {
$display_all_form = !isset($_SESSION['update_term_and_condition']['user_id']);
@ -354,11 +353,12 @@ if (!empty($_GET['openid_msg']) && $_GET['openid_msg'] == 'idnotfound') {
$content .= Display::return_message(get_lang('OpenIDCouldNotBeFoundPleaseRegister'), 'warning');
}
$url = api_get_path(WEB_PUBLIC_PATH).'internal_page/edit/inscription';
//Form of language
//$content .= api_display_language_form();
$content .= '&nbsp;&nbsp;<a href="'.api_get_self().'?action=edit_top">'.
Display::return_icon('edit.gif', get_lang('Edit')).'</a>
<a href="'.api_get_path(WEB_PUBLIC_PATH).'edit_inscription">'.get_lang('EditNotice').'</a>';
<a href="'.$url.'">'.get_lang('EditNotice').'</a>';
$content .= $form->returnForm();

@ -1,8 +1,8 @@
<?php
/* For licensing terms, see /license.txt */
use ChamiloSession as Session;
use Chamilo\CoreBundle\Framework\Container;
use ChamiloSession as Session;
/**
* This script displays a form for registering new users.

@ -6767,7 +6767,6 @@ class CourseManager
return (int) $row['count'];
}
/**
* @param ToolChain $toolList
*/

@ -27,11 +27,11 @@ use Monolog\Logger;
class SessionManager
{
// See BT#4871
public CONST SESSION_CHANGE_USER_REASON_SCHEDULE = 1;
public CONST SESSION_CHANGE_USER_REASON_CLASSROOM = 2;
public CONST SESSION_CHANGE_USER_REASON_LOCATION = 3;
public CONST SESSION_CHANGE_USER_REASON_ENROLLMENT_ANNULATION = 4;
public CONST DEFAULT_VISIBILITY = 4; //SESSION_AVAILABLE
public const SESSION_CHANGE_USER_REASON_SCHEDULE = 1;
public const SESSION_CHANGE_USER_REASON_CLASSROOM = 2;
public const SESSION_CHANGE_USER_REASON_LOCATION = 3;
public const SESSION_CHANGE_USER_REASON_ENROLLMENT_ANNULATION = 4;
public const DEFAULT_VISIBILITY = 4; //SESSION_AVAILABLE
public static $_debug = false;

@ -29,73 +29,6 @@ use Symfony\Component\HttpFoundation\Response;
*/
class IndexController extends BaseController
{
/**
* The Chamilo index home page.
*
* @Route("/edit_welcome", name="edit_welcome")
* @Method({"GET|POST"})
* @Security("has_role('ROLE_ADMIN')")
*
* @return Response
*/
public function editWelcomeAction()
{
return $this->forward(
'Chamilo\PageBundle\Controller\PageController:createPage',
array('pageSlug' => 'welcome')
);
}
/**
* The Chamilo index home page.
*
* @Route("/edit_inscription", name="edit_inscription")
* @Method({"GET|POST"})
* @Security("has_role('ROLE_ADMIN')")
*
* @return Response
*/
public function editInscriptionAction()
{
$redirect = $this->generateUrl('legacy_main', ['name' => 'admin/configure_inscription.php']);
return $this->forward(
'Chamilo\PageBundle\Controller\PageController:createPage',
array('pageSlug' => 'inscription', 'redirect' => $redirect)
);
}
/**
* The Chamilo index home page.
*
* @Route("/welcome", name="welcome")
* @Method({"GET"})
*
* @return Response
*/
public function welcomeAction()
{
$siteSelector = $this->get('sonata.page.site.selector');
$site = $siteSelector->retrieve();
$page = null;
if ($site) {
$pageManager = $this->get('sonata.page.manager.page');
// Parents only of homepage
$criteria = ['site' => $site, 'enabled' => true, 'parent' => 1, 'slug' => 'welcome'];
/** @var Page $page */
$page = $pageManager->findOneBy($criteria);
}
return $this->render(
'@ChamiloCore/Index/welcome.html.twig',
[
'page' => $page,
'content' => 'welcome',
]
);
}
/**
* The Chamilo index home page.
*
@ -108,7 +41,7 @@ class IndexController extends BaseController
*
* @return Response
*/
public function indexAction(Request $request)
public function indexAction(Request $request): Response
{
/** @var \PageController $pageController */
//$pageController = $this->get('page_controller');
@ -184,13 +117,13 @@ class IndexController extends BaseController
*
* @return Response
*/
public function toggleStudentViewAction(Request $request)
public function toggleStudentViewAction(Request $request): Response
{
if (!api_is_allowed_to_edit(false, false, false, false)) {
return '';
}
$studentView = $request->getSession()->get('studentview');
if (empty($studentView) || $studentView == 'studentview') {
if (empty($studentView) || $studentView === 'studentview') {
$request->getSession()->set('studentview', 'teacherview');
return 'teacherview';

@ -100,7 +100,11 @@ class LegacyListener
$twig->addGlobal($index, $value);
}
$userObject = $container->get('security.token_storage')->getToken()->getUser();
$token = $container->get('security.token_storage')->getToken();
$userObject = null;
if ($token !== null) {
$userObject = $container->get('security.token_storage')->getToken()->getUser();
}
$userInfo = [];
$userInfo['is_anonymous'] = true;

@ -30,7 +30,7 @@ class LocaleListener implements EventSubscriberInterface
/**
* @param string $defaultLocale
*/
public function __construct($defaultLocale = 'en', $container)
public function __construct($defaultLocale, $container)
{
$this->defaultLocale = $defaultLocale;
$this->container = $container;
@ -55,23 +55,8 @@ class LocaleListener implements EventSubscriberInterface
}
$request = $event->getRequest();
$courseCode = $request->get('course');
// Detect if the course was set with a cidReq:
if (empty($courseCode)) {
$courseCodeFromRequest = $request->get('cidReq');
$courseCode = $courseCodeFromRequest;
}
/** @var EntityManager $em */
$em = $container->get('doctrine')->getManager();
if (!empty($courseCode)) {
/** @var Course $course */
$course = $em->getRepository('ChamiloCoreBundle:Course')->findOneByCode($courseCode);
}
// try to see if the locale has been set as a _locale routing parameter
// Try to see if the locale has been set as a _locale routing parameter (from lang switcher)
if ($locale = $request->attributes->get('_locale')) {
$request->getSession()->set('_locale', $locale);
} else {
@ -92,11 +77,27 @@ class LocaleListener implements EventSubscriberInterface
}
// 3. Check course locale
/** @var Course $course */
if (!empty($course)) {
$courseLocale = $course->getCourseLanguage();
if (!empty($courseLocale)) {
$locale = $courseLocale;
$courseCode = $request->get('course');
// Detect if the course was set with a cidReq:
if (empty($courseCode)) {
$courseCodeFromRequest = $request->get('cidReq');
$courseCode = $courseCodeFromRequest;
}
/** @var EntityManager $em */
$em = $container->get('doctrine')->getManager();
if (!empty($courseCode)) {
/** @var Course $course */
$course = $em->getRepository('ChamiloCoreBundle:Course')->findOneByCode($courseCode);
// 3. Check course locale
/** @var Course $course */
if (!empty($course)) {
$courseLocale = $course->getCourseLanguage();
if (!empty($courseLocale)) {
$locale = $courseLocale;
}
}
}
@ -119,7 +120,7 @@ class LocaleListener implements EventSubscriberInterface
{
return [
// must be registered before the default Locale listener
KernelEvents::REQUEST => [['onKernelRequest', 17]],
KernelEvents::REQUEST => [['onKernelRequest', 20]],
];
}
}

@ -428,14 +428,27 @@ class Container
public static function getPage($slug)
{
$container = self::$container;
$siteSelector = $container->get('sonata.page.site.selector');
$site = $siteSelector->retrieve();
$pageManager = $container->get('sonata.page.manager.page');
// Parents only of homepage
$criteria = ['site' => $site, 'enabled' => true, 'parent' => 1, 'slug' => $slug];
/** @var Page $page */
$page = $pageManager->findOneBy($criteria);
/*$siteSelector = $container->get('sonata.page.site.selector');
$site = $siteSelector->retrieve();*/
$siteManager = $container->get('sonata.page.manager.site');
$request = Container::getRequest();
$page = null;
if ($request) {
$host = $request->getHost();
$criteria = [
'locale' => $request->getLocale(),
'host' => $host,
];
$site = $siteManager->findOneBy($criteria);
$pageManager = $container->get('sonata.page.manager.page');
// Parents only of homepage
$criteria = ['site' => $site, 'enabled' => true, 'slug' => $slug];
/** @var Page $page */
$page = $pageManager->findOneBy($criteria);
return $page;
}
return $page;
}

@ -1,22 +1,44 @@
<div class="dropdown">
<button type="button" id="dropdownMenu1" data-toggle="dropdown"
aria-haspopup="true" aria-expanded="true">
<span class="lang-sm lang-lbl-full"
lang="{{ app.request.locale }}"></span> <span
class="caret"></span>
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="flag-icon flag-icon-{{ current_locale_iso }}"></span>
{{ current_locale_iso }}
<span class="caret">
</span>
</button>
<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
{% for locale in locales %}
{{ locale }}julio
<li>
<a href="{{ locale.link }}"
title="{{ locale.locale_target_language }}">
{#<span class="lang-sm lang-lbl-full" lang="{{ locale.locale }}"></span>#}
<span class="flag-icon flag-icon-{{ locale.locale }}"></span>
{{ locale.locale_target_language }}
</a>
</li>
{% endfor %}
<ul class="dropdown-menu" role="menu">
{% autoescape false %}
{% for index, locale in available_locales %}
<li>
<a href="{{ app.request.attributes.get('_route') }}?_locale={{ index }}">
<span class="flag-icon flag-icon-{{ index }}"></span>
{{ locale }}
</a>
</li>
{% endfor %}
{% endautoescape %}
</ul>
</div>
{#<div class="dropdown">#}
{#<button type="button" id="dropdownMenu1" data-toggle="dropdown"#}
{#aria-haspopup="true" aria-expanded="true">#}
{#<span class="lang-sm lang-lbl-full"#}
{#lang="{{ app.request.locale }}"></span> <span#}
{#class="caret"></span>#}
{#</button>#}
{#<ul class="dropdown-menu" aria-labelledby="dropdownMenu1">#}
{#{% for locale in locales %}#}
{#{{ locale }}julio#}
{#<li>#}
{#<a href="{{ locale.link }}"#}
{#title="{{ locale.locale_target_language }}">#}
{#<span class="lang-sm lang-lbl-full" lang="{{ locale.locale }}"></span>#}
{#<span class="flag-icon flag-icon-{{ locale.locale }}"></span>#}
{#{{ locale.locale_target_language }}#}
{#</a>#}
{#</li>#}
{#{% endfor %}#}
{#</ul>#}
{#</div>#}

@ -2,7 +2,7 @@
{% block chamilo_right_column %}
{% autoescape false %}
{{ render(controller('ChamiloCoreBundle:Index:welcome')) }}
{{ render(controller('ChamiloPageBundle:Page:renderPage', {'slug': 'welcome'} )) }}
{{ announcements_block }}
{{ content }}

@ -1,11 +0,0 @@
{% extends "@ChamiloTheme/Layout/layout_two_col.html.twig" %}
{% block chamilo_right_column %}
Edit inscription!
{{ form_start(form, {'attr': {'novalidate': 'novalidate'}}) }}
{{ form_widget(form) }}
{{ form_end(form) }}
{% endblock %}

@ -1,5 +1,5 @@
{% if is_granted('ROLE_ADMIN') %}
<a href="{{ url('edit_welcome') }}" >
<a href="{{ url('edit_page', { 'slug': slug }) }}" >
{{ "header.edit_page"|trans({}, 'SonataPageBundle') }}
</a>
{% endif %}

@ -0,0 +1,15 @@
{% extends "@ChamiloTheme/Layout/layout_two_col.html.twig" %}
{% block chamilo_right_column %}
{{ locale_switcher(null, null, 'ChamiloCoreBundle:Admin:switcher_links.html.twig') }}
Edit page '{{ page.slug }}' in '{{ page.site.locale }}'
{{ sonata_page_render_container('content', page) }}
{{ form_start(form, {'attr': {'novalidate': 'novalidate'}}) }}
{{ form_widget(form) }}
{{ form_end(form) }}
{% endblock %}

@ -1,11 +0,0 @@
{% extends "@ChamiloTheme/Layout/layout_two_col.html.twig" %}
{% block chamilo_right_column %}
Edit welcome!
{{ form_start(form, {'attr': {'novalidate': 'novalidate'}}) }}
{{ form_widget(form) }}
{{ form_end(form) }}
{% endblock %}

@ -6,7 +6,10 @@ namespace Chamilo\PageBundle\Controller;
use Chamilo\CoreBundle\Controller\BaseController;
use Chamilo\PageBundle\Entity\Page;
use Chamilo\PageBundle\Entity\Snapshot;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Security;
use Sonata\PageBundle\Entity\PageManager;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Ivory\CKEditorBundle\Form\Type\CKEditorType;
use Symfony\Bundle\FrameworkBundle\Controller\ControllerTrait;
@ -57,15 +60,74 @@ class PageController extends BaseController
}
/**
* Creates a site if needed checking the host and locale.
* Creates a first root page.
* Creates a page if it doesn't exists.
* Updates the page if page exists.
*
* @param string $pageSlug
* @param string $redirect
* @param Request $request
*
* @return \Symfony\Component\HttpFoundation\RedirectResponse|Response
*/
public function createPage($pageSlug, $redirect, Request $request)
{
$siteSelector = $this->container->get('sonata.page.site.selector');
$site = $siteSelector->retrieve();
$container = $this->container;
//$siteSelector = $container->get('sonata.page.site.selector');
$siteManager = $container->get('sonata.page.manager.site');
$host = $request->getHost();
$criteria = [
'locale' => $request->getLocale(),
'host' => $host,
];
$site = $siteManager->findOneBy($criteria);
//$site = $siteSelector->retrieve();
if ($request->getLocale() !== $site->getLocale()) {
// Check if there's site for this locale
$siteManager = $container->get('sonata.page.manager.site');
$host = $request->getHost();
$criteria = [
'locale' => $request->getLocale(),
'host' => $host,
];
$site = $siteManager->findOneBy($criteria);
if (!$site) {
// Create new site for this host and language
$site = $siteManager->create();
$site->setHost($host);
$site->setEnabled(true);
$site->setName($host.' in language '.$request->getLocale());
$site->setEnabledFrom(new \DateTime('now'));
$site->setEnabledTo(new \DateTime('+20 years'));
$site->setRelativePath('');
$site->setIsDefault(false);
$site->setLocale($request->getLocale());
$site = $siteManager->save($site);
// Create first root page
/** @var PageManager $pageManager */
$pageManager = $container->get('sonata.page.manager.page');
/** @var \Sonata\PageBundle\Model\Page $page */
$page = $pageManager->create();
$page->setSlug('homepage');
$page->setUrl('/');
$page->setName('homepage');
$page->setTitle('home');
$page->setEnabled(true);
$page->setDecorate(1);
$page->setRequestMethod('GET|POST|HEAD|DELETE|PUT');
$page->setTemplateCode('default');
$page->setRouteName('homepage');
//$page->setParent($this->getReference('page-homepage'));
$page->setSite($site);
$pageManager->save($page);
}
}
$em = $this->getDoctrine()->getManager();
$page = null;
@ -77,8 +139,15 @@ class PageController extends BaseController
$blockToEdit = null;
if ($site) {
$pageManager = $this->get('sonata.page.manager.page');
// Parents only of homepage
$criteria = ['site' => $site, 'enabled' => true, 'parent' => 1, 'slug' => $pageSlug];
// Getting parent
$criteria = ['site' => $site, 'enabled' => true, 'parent' => null];
/** @var Page $page */
$parent = $pageManager->findOneBy($criteria);
// Check if a page exists for this site
$criteria = ['site' => $site, 'enabled' => true, 'parent' => $parent, 'slug' => $pageSlug];
/** @var Page $page */
$page = $pageManager->findOneBy($criteria);
if ($page) {
@ -102,10 +171,6 @@ class PageController extends BaseController
} else {
$pageManager = $this->get('sonata.page.manager.page');
$criteria = ['site' => $site, 'enabled' => true, 'parent' => null, 'slug' => 'homepage'];
/** @var Page $page */
$parent = $pageManager->findOneBy($criteria);
$page = $pageManager->create();
$page->setSlug($pageSlug);
$page->setUrl('/'.$pageSlug);
@ -191,14 +256,72 @@ class PageController extends BaseController
return $this->redirectToRoute('home');
}
$template = $pageSlug.'_edit.html.twig';
return $this->render(
'@ChamiloCore/Index/'.$template,
'@ChamiloCore/Index/page_edit.html.twig',
[
'page' => $page,
'form' => $form->createView(),
]
);
}
/**
* The Chamilo index home page.
*
* @Route("/internal_page/edit/{slug}", name="edit_page")
* @Method({"GET|POST"})
* @Security("has_role('ROLE_ADMIN')")
*
* @param string $slug
*
* @return Response
*/
public function editPageAction($slug): Response
{
return $this->forward(
'Chamilo\PageBundle\Controller\PageController:createPage',
['pageSlug' => $slug, 'redirect' => $this->generateUrl('edit_page', ['slug' => $slug ])]
);
}
/**
* @Route("/internal_page/{slug}")
*
* @param string $slug
* @param Request $request
*
* @return Response
*/
public function renderPageAction(string $slug, Request $request): Response
{
/*$siteSelector = $this->get('sonata.page.site.selector');
$site = $siteSelector->retrieve();*/
$container = $this->container;
$siteManager = $container->get('sonata.page.manager.site');
$host = $request->getHost();
$criteria = [
'locale' => $request->getLocale(),
'host' => $host,
];
$site = $siteManager->findOneBy($criteria);
$page = null;
if ($site) {
$pageManager = $this->get('sonata.page.manager.page');
// Parents only of homepage
$criteria = ['site' => $site, 'enabled' => true, 'slug' => $slug];
/** @var Page $page */
$page = $pageManager->findOneBy($criteria);
}
return $this->render(
'@ChamiloCore/Index/page.html.twig',
[
'page' => $page,
'slug' => $slug,
'content' => 'welcome',
]
);
}
}

@ -1,23 +1,25 @@
<div class="btn-group">
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
<span class="flag-icon flag-icon-{{ current_locale_iso }}"></span>
{{ current_locale_iso }}
<span class="caret">
</span>
</button>
<ul class="dropdown-menu" role="menu">
{% autoescape false %}
{% for index, locale in available_locales %}
<li>
<a href="{{ app.request.attributes.get('_route') }}?_locale={{ index }}">
<span class="flag-icon flag-icon-{{ index }}"></span>
{{ locale }}
</a>
</li>
{% endfor %}
{% endautoescape %}
</ul>
</div>
{{ locale_switcher(null, null, 'ChamiloCoreBundle:Admin:switcher_links.html.twig') }}
{#<div class="btn-group">#}
{#<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">#}
{#<span class="flag-icon flag-icon-{{ current_locale_iso }}"></span>#}
{#{{ current_locale_iso }}#}
{#<span class="caret">#}
{#</span>#}
{#</button>#}
{#<ul class="dropdown-menu" role="menu">#}
{#{% autoescape false %}#}
{#{% for index, locale in available_locales %}#}
{#<li>#}
{#<a href="{{ app.request.attributes.get('_route') }}?_locale={{ index }}">#}
{#<span class="flag-icon flag-icon-{{ index }}"></span>#}
{#{{ locale }}#}
{#</a>#}
{#</li>#}
{#{% endfor %}#}
{#{% endautoescape %}#}
{#</ul>#}
{#</div>#}
<form class="form-horizontal" action="{{ path("fos_user_security_check") }}" method="post" name="formLogin" id="formLogin">
<input type="hidden" name="_csrf_token" value="{{ csrf_token('authenticate') }}"/>
<fieldset>

@ -1962,7 +1962,7 @@ class User extends BaseUser implements ThemeUser, EquatableInterface //implement
/**
* @return string
*/
public function getPictureLegacy() : string
public function getPictureLegacy(): string
{
$id = $this->id;

Loading…
Cancel
Save