<commit_before><?php

/*
 * This file is part of the CSBill package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace CSBill\CoreBundle\Menu;

use Knp\Menu\ItemInterface;
use CSBill\CoreBundle\Menu\Core\AuthenticatedMenu;

class Main extends AuthenticatedMenu
{
    /**
     * Menu builder for the quotes index
     *
     * @param ItemInterface $menu
     */
    public function topMenu(ItemInterface $menu)
    {
        $user = $this->container->get('security.context')->getToken()->getUser();

        $username = $user->getUsername() . ' <b class="caret"></b>';

        $menu->addChild(
            $username,
            array(
                'uri' => '#',
                'allow_safe_labels' => true,
                'extras' => array(
                    'safe_label' => true,
                    'icon' => 'user'
                )
            )
        );

        $topMenu = $menu[$username];

        $topMenu->setAttributes(array('class' => 'dropdown'));
        $topMenu->setLinkAttributes(array('class' => 'dropdown-toggle', 'data-toggle' => 'dropdown'));

        $topMenu->addChild('Settings', array('route' => '_settings', 'extras' => array('icon' => 'cog')));
        $topMenu->addDivider();
        $topMenu->addChild('Logout', array('uri' => '_logout', 'extras' => array('icon' => 'power-off')));

        $topMenu->setChildrenAttributes(array('class' => 'dropdown-menu'));
    }
}<commit_msg>[CoreBundle] Fix logout route in top menu<commit_after><?php

/*
 * This file is part of the CSBill package.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace CSBill\CoreBundle\Menu;

use Knp\Menu\ItemInterface;
use CSBill\CoreBundle\Menu\Core\AuthenticatedMenu;

class Main extends AuthenticatedMenu
{
    /**
     * Menu builder for the quotes index
     *
     * @param ItemInterface $menu
     */
    public function topMenu(ItemInterface $menu)
    {
        $user = $this->container->get('security.context')->getToken()->getUser();

        $username = $user->getUsername() . ' <b class="caret"></b>';

        $menu->addChild(
            $username,
            array(
                'uri' => '#',
                'allow_safe_labels' => true,
                'extras' => array(
                    'safe_label' => true,
                    'icon' => 'user'
                )
            )
        );

        $topMenu = $menu[$username];

        $topMenu->setAttributes(array('class' => 'dropdown'));
        $topMenu->setLinkAttributes(array('class' => 'dropdown-toggle', 'data-toggle' => 'dropdown'));

        $topMenu->addChild('Settings', array('route' => '_settings', 'extras' => array('icon' => 'cog')));
        $topMenu->addDivider();
        $topMenu->addChild('Logout', array('uri' => 'logout', 'extras' => array('icon' => 'power-off')));

        $topMenu->setChildrenAttributes(array('class' => 'dropdown-menu'));
    }
}
{'fraction_non_alphanumeric': 0.16822429906542055, 'fraction_numerical': 0.0, 'mean_word_length': 2.4298342541436466, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 67, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4993585', 'n_tokens_mistral': 915, 'n_tokens_neox': 890, 'n_words': 196}