src/Contao/View/Contao2BackendView/ActionHandler/AbstractListShowAllHandler.php
protected function renderPasteTopButton(EnvironmentInterface $environment, $sorting)
    {
        $definition     = $environment->getDataDefinition();
        $dispatcher     = $environment->getEventDispatcher();
        $languageDomain = 'contao_' . $definition->getName();

        $filter = new Filter();
        $filter->andModelIsFromProvider($definition->getBasicDefinition()->getDataProvider());

        if (!$sorting || $environment->getClipboard()->isEmpty($filter)) {
            return null;
        }
        if (!ViewHelpers::getManualSortingProperty($environment)) {
            return null;
        }

        /** @var AddToUrlEvent $urlEvent */
        $urlEvent = $dispatcher->dispatch(
            ContaoEvents::BACKEND_ADD_TO_URL,
            new AddToUrlEvent(
                'act=paste&after=' . ModelId::fromValues($definition->getName(), '0')->getSerialized()
            )
        );

        /** @var GenerateHtmlEvent $imageEvent */
        $imageEvent = $dispatcher->dispatch(
            ContaoEvents::IMAGE_GET_HTML,
            new GenerateHtmlEvent(
                'pasteafter.svg',
                $this->translate('pasteafter.0', $languageDomain),
                'class="blink"'
            )
        );

        return \sprintf(
            '<a href="%s" title="%s" onclick="Backend.getScrollOffset()">%s</a>',
            $urlEvent->getUrl(),
            StringUtil::specialchars($this->translate('pasteafter.0', $languageDomain)),
            $imageEvent->getHtml()
        );
    }
protected function renderPasteTopButton(EnvironmentInterface $environment, $sorting)
    {
        $definition     = $environment->getDataDefinition();
        $dispatcher     = $environment->getEventDispatcher();
        $languageDomain = 'contao_' . $definition->getName();

        $filter = new Filter();
        $filter->andModelIsFromProvider($definition->getBasicDefinition()->getDataProvider());

        if (!$sorting || $environment->getClipboard()->isEmpty($filter)) {
            return null;
        }
        if (!ViewHelpers::getManualSortingProperty($environment)) {
            return null;
        }

        /** @var AddToUrlEvent $urlEvent */
        $urlEvent = $dispatcher->dispatch(
            ContaoEvents::BACKEND_ADD_TO_URL,
            new AddToUrlEvent(
                'act=paste&after=' . ModelId::fromValues($definition->getName(), '0')->getSerialized()
            )
        );

        /** @var GenerateHtmlEvent $imageEvent */
        $imageEvent = $dispatcher->dispatch(
            ContaoEvents::IMAGE_GET_HTML,
            new GenerateHtmlEvent(
                'pasteafter.svg',
                $this->translate('pasteafter.0', $languageDomain),
                'class="blink"'
            )
        );

        return \sprintf(
            '<a href="%s" title="%s" onclick="Backend.getScrollOffset()">%s</a>',
            $urlEvent->getUrl(),
            StringUtil::specialchars($this->translate('pasteafter.0', $languageDomain)),
            $imageEvent->getHtml()
        );
    }
protected function renderPasteTopButton ( EnvironmentInterface $ environment , $ sorting ) { $ definition = $ environment -> getDataDefinition ( ) ; $ dispatcher = $ environment -> getEventDispatcher ( ) ; $ languageDomain = 'contao_' . $ definition -> getName ( ) ; $ filter = new Filter ( ) ; $ filter -> andModelIsFromProvider ( $ definition -> getBasicDefinition ( ) -> getDataProvider ( ) ) ; if ( ! $ sorting || $ environment -> getClipboard ( ) -> isEmpty ( $ filter ) ) { return null ; } if ( ! ViewHelpers :: getManualSortingProperty ( $ environment ) ) { return null ; } /** @var AddToUrlEvent $urlEvent */ $ urlEvent = $ dispatcher -> dispatch ( ContaoEvents :: BACKEND_ADD_TO_URL , new AddToUrlEvent ( 'act=paste&after=' . ModelId :: fromValues ( $ definition -> getName ( ) , '0' ) -> getSerialized ( ) ) ) ; /** @var GenerateHtmlEvent $imageEvent */ $ imageEvent = $ dispatcher -> dispatch ( ContaoEvents :: IMAGE_GET_HTML , new GenerateHtmlEvent ( 'pasteafter.svg' , $ this -> translate ( 'pasteafter.0' , $ languageDomain ) , 'class="blink"' ) ) ; return \ sprintf ( '<a href="%s" title="%s" onclick="Backend.getScrollOffset()">%s</a>' , $ urlEvent -> getUrl ( ) , StringUtil :: specialchars ( $ this -> translate ( 'pasteafter.0' , $ languageDomain ) ) , $ imageEvent -> getHtml ( ) ) ; }
Render paste top button. Returns null if no button should be rendered.

@param EnvironmentInterface                    $environment The environment.
@param GroupAndSortingDefinitionInterface|null $sorting     The sorting mode.

@return string
Render paste top button . Returns null if no button should be rendered .