public function renderNav($numberOfPages, $currentPage = 1, $queryParameters = array(), $maxPagesDisplayedAroundCurrent = 2)
    {
        $navigation = array();

        $firstPageDisplayed = 1;
        $lastPageDisplayed = (int)$numberOfPages;

        $leftPartUrl = $this->prepareQueryString($queryParameters);

        if ($currentPage > $maxPagesDisplayedAroundCurrent) {
            $firstPageDisplayed = $currentPage - $maxPagesDisplayedAroundCurrent;
            $navigation[] = '<a href="' . $leftPartUrl . '1" class="navigatorShortcut1">'
                . $this->translator->trans('open_orchestra_display.twig.navigator.first')
                . '</a>';
        }

        if ($currentPage > 1) {
            $navigation[] = '<a href="' . $leftPartUrl . ($currentPage - 1) . ' "class="navigatorShortcut2">'
                . $this->translator->trans('open_orchestra_display.twig.navigator.previous')
                . '</a>';
        }

        if ($firstPageDisplayed > 1) {
            $navigation[] = '...';
        }

        if ($currentPage < $numberOfPages - $maxPagesDisplayedAroundCurrent) {
            $lastPageDisplayed = $currentPage + $maxPagesDisplayedAroundCurrent;
        }

        for ($i = $firstPageDisplayed; $i <= $lastPageDisplayed; $i++) {
            if ($i == $currentPage) {
                $navigation[] = '<span class="navigatorCurrent">' . $i . '</span>';
            } else {
                $navigation[] = ' <a href="' . $leftPartUrl . $i . '" class="navigatorPage">' . $i . '</a>';
            }
        }

        if ($lastPageDisplayed < $numberOfPages) {
            $navigation[] = '...';
        }

        if ($currentPage < $numberOfPages) {
            $navigation[]= '<a href="' . $leftPartUrl . ($currentPage + 1) . '" class="navigatorShortcut2">'
                . $this->translator->trans('open_orchestra_display.twig.navigator.next')
                . '</a>';
        }

        if ($currentPage < $numberOfPages - $maxPagesDisplayedAroundCurrent) {
            $navigation[]= '<a href="' . $leftPartUrl . $numberOfPages . '" class="navigatorShortcut1">'
                . $this->translator->trans('open_orchestra_display.twig.navigator.last')
                . '</a>';
        }

        return implode(' ', $navigation);
    }