src/Contao/View/Contao2BackendView/TreeView.php
public static function renderPasteRootButton(GetPasteRootButtonEvent $event)
    {
        if (null !== $event->getHtml()) {
            return $event->getHtml();
        }
        $environment = $event->getEnvironment();
        $label       = $environment->getTranslator()->translate(
            'pasteinto.0',
            $environment->getDataDefinition()->getName()
        );
        if ($event->isPasteDisabled()) {
            /** @var GenerateHtmlEvent $imageEvent */
            $imageEvent = $environment->getEventDispatcher()->dispatch(
                ContaoEvents::IMAGE_GET_HTML,
                new GenerateHtmlEvent(
                    'pasteinto_.svg',
                    $label,
                    'class="blink"'
                )
            );

            return $imageEvent->getHtml();
        }

        /** @var GenerateHtmlEvent $imageEvent */
        $imageEvent = $environment->getEventDispatcher()->dispatch(
            ContaoEvents::IMAGE_GET_HTML,
            new GenerateHtmlEvent(
                'pasteinto.svg',
                $label,
                'class="blink"'
            )
        );

        return \sprintf(
            ' <a href="%s" title="%s" %s>%s</a>',
            $event->getHref(),
            StringUtil::specialchars($label),
            'onclick="Backend.getScrollOffset()"',
            $imageEvent->getHtml()
        );
    }
public static function renderPasteRootButton(GetPasteRootButtonEvent $event)
    {
        if (null !== $event->getHtml()) {
            return $event->getHtml();
        }
        $environment = $event->getEnvironment();
        $label       = $environment->getTranslator()->translate(
            'pasteinto.0',
            $environment->getDataDefinition()->getName()
        );
        if ($event->isPasteDisabled()) {
            /** @var GenerateHtmlEvent $imageEvent */
            $imageEvent = $environment->getEventDispatcher()->dispatch(
                ContaoEvents::IMAGE_GET_HTML,
                new GenerateHtmlEvent(
                    'pasteinto_.svg',
                    $label,
                    'class="blink"'
                )
            );

            return $imageEvent->getHtml();
        }

        /** @var GenerateHtmlEvent $imageEvent */
        $imageEvent = $environment->getEventDispatcher()->dispatch(
            ContaoEvents::IMAGE_GET_HTML,
            new GenerateHtmlEvent(
                'pasteinto.svg',
                $label,
                'class="blink"'
            )
        );

        return \sprintf(
            ' <a href="%s" title="%s" %s>%s</a>',
            $event->getHref(),
            StringUtil::specialchars($label),
            'onclick="Backend.getScrollOffset()"',
            $imageEvent->getHtml()
        );
    }
public static function renderPasteRootButton ( GetPasteRootButtonEvent $ event ) { if ( null !== $ event -> getHtml ( ) ) { return $ event -> getHtml ( ) ; } $ environment = $ event -> getEnvironment ( ) ; $ label = $ environment -> getTranslator ( ) -> translate ( 'pasteinto.0' , $ environment -> getDataDefinition ( ) -> getName ( ) ) ; if ( $ event -> isPasteDisabled ( ) ) { /** @var GenerateHtmlEvent $imageEvent */ $ imageEvent = $ environment -> getEventDispatcher ( ) -> dispatch ( ContaoEvents :: IMAGE_GET_HTML , new GenerateHtmlEvent ( 'pasteinto_.svg' , $ label , 'class="blink"' ) ) ; return $ imageEvent -> getHtml ( ) ; } /** @var GenerateHtmlEvent $imageEvent */ $ imageEvent = $ environment -> getEventDispatcher ( ) -> dispatch ( ContaoEvents :: IMAGE_GET_HTML , new GenerateHtmlEvent ( 'pasteinto.svg' , $ label , 'class="blink"' ) ) ; return \ sprintf ( ' <a href="%s" title="%s" %s>%s</a>' , $ event -> getHref ( ) , StringUtil :: specialchars ( $ label ) , 'onclick="Backend.getScrollOffset()"' , $ imageEvent -> getHtml ( ) ) ; }
Render the paste button for pasting into the root of the tree.

@param GetPasteRootButtonEvent $event The event that has been triggered.

@return string
Render the paste button for pasting into the root of the tree .