Render the paste into button.

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

@return string
345618
private function renderPasteIntoButton(GetPasteButtonEvent $event)
    {
        if (null !== ($value = $event->getHtmlPasteInto())) {
            return $value;
        }

        $label = $this->translate('pasteinto.0');
        if ($event->isPasteIntoDisabled()) {
            return $this->renderImageAsHtml('pasteinto_.svg', $label, 'class="blink"');
        }

        if ('pasteinto.1' !== ($opDesc = $this->translate('pasteinto.1'))) {
            $title = \sprintf($opDesc, $event->getModel()->getId());
        } else {
            $title = \sprintf('%s id %s', $label, $event->getModel()->getId());
        }

        return \sprintf(
            ' <a href="%s" title="%s" onclick="Backend.getScrollOffset()">%s</a>',
            $event->getHrefInto(),
            StringUtil::specialchars($title),
            $this->renderImageAsHtml('pasteinto.svg', $label, 'class="blink"')
        );
    }
108864
public function render() {
	
		$ret = '<button type="' . $this->type . '"' ;
	
		if ($this->id) {
			$ret .= 'id=' . $this->id;
		}
	
		if ($this->name) {
			$ret .= ' ' . $this->getNameProperty();
		}
	
		$ret .= $this->processProperties() . '>';
	
		if ($this->faIcon) {
			$ret .= '<i class="fa ' . $this->faIcon . '"></i> ';
		}
	
		$ret .= trim(htmlspecialchars($this->value)) . ' </button>';
	
		return $ret;
	
	}
931558
public function renderButtonAdd()
	{
		$a = Html::el('a')->href('')->data('datagrid-toggle-inline-add', true);

		$this->tryAddIcon($a, $this->getIcon(), $this->getText());

		$a->addText($this->text);

		if ($this->title) {
			$a->title($this->grid->getTranslator()->translate($this->title));
		}
		if ($this->class) {
			$a->class($this->class);
		}

		return $a;
	}
709846
def OnPasteFormat(self, event):
        """"""

        with undo.group(_("Paste format")):
            self.grid.actions.paste_format()

        self.grid.ForceRefresh()
        self.grid.update_attribute_toolbar()
        self.grid.actions.zoom()
460978
protected function buildBackgroundCommand(Event $event)
    {
        $output = ProcessUtils::escapeArgument($event->output);

        $redirect = $event->shouldAppendOutput ? ' >> ' : ' > ';

        $finished = Application::formatCommandString('schedule:finish').' "'.$event->mutexName().'"';

        return $this->ensureCorrectUser($event,
            '('.$event->command.$redirect.$output.' 2>&1 '.(windows_os() ? '&' : ';').' '.$finished.') > '
            .ProcessUtils::escapeArgument($event->getDefaultOutput()).' 2>&1 &'
        );
    }
557496
def OnPasteAs(self, event):
        """"""

        data = self.main_window.clipboard.get_clipboard()
        key = self.main_window.grid.actions.cursor

        with undo.group(_("Paste As...")):
            self.main_window.actions.paste_as(key, data)

        self.main_window.grid.ForceRefresh()

        event.Skip()
213131
protected function getPayloadFromEvent($event)
    {
        if (method_exists($event, 'broadcastWith')) {
            return $event->broadcastWith();
        }

        $payload = array();

        //
        $reflection = new ReflectionClass($event);

        foreach ($reflection->getProperties(ReflectionProperty::IS_PUBLIC) as $property) {
            $key = $property->getName();

            $value = $property->getValue($event);

            $payload[$key] = $this->formatProperty($value);
        }

        return $payload;
    }
1310457
public function getTableAttributeHtml(SetElementTableAttributeHtmlEvent $event)
	{
		if ($event->attribute == 'elementMap_incomingReferenceCount') {
			$event->handled = true;
			$entry = $event->sender;
			$elements = $this->renderer->getIncomingElements($entry->id, $entry->site->id);
			$event->html = Craft::$app->view->renderTemplate('element-map/_table', ['elements' => count($elements)]);
		} else if ($event->attribute == 'elementMap_outgoingReferenceCount') {
			$event->handled = true;
			$entry = $event->sender;
			$elements = $this->renderer->getOutgoingElements($entry->id, $entry->site->id);
			$event->html = Craft::$app->view->renderTemplate('element-map/_table', ['elements' => count($elements)]);
		} else if ($event->attribute == 'elementMap_incomingReferences') {
			$event->handled = true;
			$entry = $event->sender;
			$elements = $this->renderer->getIncomingElements($entry->id, $entry->site->id);
			$event->html = Craft::$app->view->renderTemplate('element-map/_table', ['elements' => $elements]);
		} else if ($event->attribute == 'elementMap_outgoingReferences') {
			$event->handled = true;
			$entry = $event->sender;
			$elements = $this->renderer->getOutgoingElements($entry->id, $entry->site->id);
			$event->html = Craft::$app->view->renderTemplate('element-map/_table', ['elements' => $elements]);
		}
	}
467153
public function renderButton()
    {
        if (($button = $this->button) !== false) {
            $tag = ArrayHelper::remove($button, 'tag', 'a');
            $label = ArrayHelper::remove($button, 'label',
                Inflector::camel2words(Inflector::id2camel($this->scenario)));
            if ($tag === 'button' && !isset($button['type'])) {
                $toggleButton['type'] = 'button';
            }

            if ($button['disabled']) {
                $button = ArrayHelper::merge([
                    'onClick' => new JsExpression('return false'),
                ], $button);
            } else {
                $button = ArrayHelper::merge([
                    'data-toggle' => 'modal',
                    'data-target' => "#{$this->getModalId()}",
                ], $button);
            }

            if ($tag === 'a' && empty($button['href'])) {
                $button['href'] = '#';
            }

            echo Html::tag($tag, $label, $button);
        }
    }
1143207
function( editor ) {
			var commandName = 'pastefromword',
				// Flag indicate this command is actually been asked instead of a generic pasting.
				forceFromWord = 0,
				path = this.path;

			editor.addCommand( commandName, {
				// Snapshots are done manually by editable.insertXXX methods.
				canUndo: false,
				async: true,

				exec: function( editor ) {
					var cmd = this;

					forceFromWord = 1;
					// Force html mode for incomming paste events sequence.
					editor.once( 'beforePaste', forceHtmlMode );

					editor.getClipboardData( { title: editor.lang.pastefromword.title }, function( data ) {
						// Do not use editor#paste, because it would start from beforePaste event.
						data && editor.fire( 'paste', { type: 'html', dataValue: data.dataValue } );

						editor.fire( 'afterCommandExec', {
							name: commandName,
							command: cmd,
							returnValue: !!data
						} );
					} );
				}
			} );

			// Register the toolbar button.
			editor.ui.addButton && editor.ui.addButton( 'PasteFromWord', {
				label: editor.lang.pastefromword.toolbar,
				command: commandName,
				toolbar: 'clipboard,50'
			} );

			editor.on( 'pasteState', function( evt ) {
				editor.getCommand( commandName ).setState( evt.data );
			} );

			// Features bring by this command beside the normal process:
			// 1. No more bothering of user about the clean-up.
			// 2. Perform the clean-up even if content is not from MS-Word.
			// (e.g. from a MS-Word similar application.)
			// 3. Listen with high priority (3), so clean up is done before content
			// type sniffing (priority = 6).
			editor.on( 'paste', function( evt ) {
				var data = evt.data,
					mswordHtml = data.dataValue;

				// MS-WORD format sniffing.
				if ( mswordHtml && ( forceFromWord || ( /(class=\"?Mso|style=\"[^\"]*\bmso\-|w:WordDocument)/ ).test( mswordHtml ) ) ) {
					// If filter rules aren't loaded then cancel 'paste' event,
					// load them and when they'll get loaded fire new paste event
					// for which data will be filtered in second execution of
					// this listener.
					var isLazyLoad = loadFilterRules( editor, path, function() {
						// Event continuation with the original data.
						if ( isLazyLoad )
							editor.fire( 'paste', data );
						else if ( !editor.config.pasteFromWordPromptCleanup || ( forceFromWord || confirm( editor.lang.pastefromword.confirmCleanup ) ) )
							data.dataValue = CKEDITOR.cleanWord( mswordHtml, editor );

					} );

					// The cleanup rules are to be loaded, we should just cancel
					// this event.
					isLazyLoad && evt.cancel();
				}
			}, null, null, 3 );

			function resetFromWord( evt ) {
				evt && evt.removeListener();
				editor.removeListener( 'beforePaste', forceHtmlMode );
				forceFromWord && setTimeout( function() {
					forceFromWord = 0;
				}, 0 );
			}
		}
32050
public function getEvent($event = [])
    {
        if (!$this->event) {
            $this->event = $event;
            if (isset($event['config'])
                && (empty($event['integration'])
                    || (
                        !empty($event['integration'])
                        && $event['integration'] == $this->getName()
                    )
                )
            ) {
                $this->event['config'] = array_merge($this->settings->getFeatureSettings(), $event['config']);
            }

            if (isset($this->event['campaignEvent']) && !empty($this->event['campaignEvent'])) {
                $campaignEvent             = $this->event['campaignEvent'];
                $this->event['id']         = $campaignEvent['id'];
                $this->event['campaignId'] = $campaignEvent['campaign']['id'];
            }

            // If the campaign event ID is missing, backfill it.
            if (!isset($this->event['id']) || !is_numeric($this->event['id'])) {
                try {
                    $identityMap = $this->em->getUnitOfWork()->getIdentityMap();
                    if (isset($identityMap['Mautic\CampaignBundle\Entity\Event'])) {
                        if (isset($identityMap['Mautic\CampaignBundle\Entity\Campaign']) && !empty($identityMap['Mautic\CampaignBundle\Entity\Campaign'])) {
                            $memoryCampaign = end($identityMap['Mautic\CampaignBundle\Entity\Campaign']);
                            $campaignId     = $memoryCampaign->getId();

                            /** @var \Mautic\CampaignBundle\Entity\Event $leadEvent */
                            foreach ($identityMap['Mautic\CampaignBundle\Entity\Event'] as $leadEvent) {
                                $properties = $leadEvent->getProperties();
                                $campaign   = $leadEvent->getCampaign();
                                if (
                                    $properties['_token'] === $this->event['_token']
                                    && $campaignId == $campaign->getId()
                                ) {
                                    $this->event['id']         = $leadEvent->getId();
                                    $this->event['name']       = $leadEvent->getName();
                                    $this->event['campaignId'] = $campaign->getId();
                                    break;
                                }
                            }
                        }
                    }
                } catch (\Exception $e) {
                }
            }
        }

        return $this->event;
    }
954402
public function copyShadowProperties(AbstractMappingEvent $event)
    {
        $document = $event->getDocument();

        if (!$this->supports($document)) {
            return;
        }

        if (!$event->getDocument()->isShadowLocaleEnabled()) {
            $this->copyToShadows($event->getDocument(), $event->getNode());
        } else {
            $this->copyFromShadow($event->getDocument(), $event->getNode());
        }
    }
319992
public function renderButtons() {
		
		$output = '';
		foreach ($this->getButtons() as $button) {
			$output .= $this->renderElement($button);
		}

		if ($output !== '' && $this->activeFormWidget->type !== TbActiveForm::TYPE_INLINE) {
			$output = "<div class=\"form-actions\">\n" . $output . "</div>\n";
		}

		return $output;
	}
9143
public function beforeRender(Event $event)
    {
        $this->_beforeRender($event);
        $this->loadModel('Content.ContentTypes');
        $this->Breadcrumb->push('/admin/content/types');
        $contentType = $this->ContentTypes
            ->find()
            ->where(['slug' => $this->request->query['type']])
            ->first();

        switch ($this->request->action) {
            case 'index':
                $this->Breadcrumb
                    ->push('/admin/content/manage')
                    ->push(__d('content', 'Content Types'), '/admin/content/types')
                    ->push(__d('content', 'Type "{0}"', $contentType->name), '/admin/content/types/edit/' . $contentType->slug)
                    ->push(__d('content', 'Fields'), ['plugin' => 'Content', 'controller' => 'fields', 'action' => 'index', 'prefix' => 'admin']);
                break;

            case 'configure':
                $this->Breadcrumb
                    ->push('/admin/content/manage')
                    ->push(__d('content', 'Content Types'), '/admin/content/types')
                    ->push(__d('content', 'Type "{0}"', $contentType->name), '/admin/content/types/edit/' . $contentType->slug)
                    ->push(__d('content', 'Fields'), ['plugin' => 'Content', 'controller' => 'fields', 'action' => 'index', 'prefix' => 'admin'])
                    ->push(__d('content', 'Configure Field "{0}"', $this->viewVars['instance']->label), '#');
                break;

            case 'attach':
                $this->Breadcrumb
                    ->push('/admin/content/manage')
                    ->push(__d('content', 'Content Types'), '/admin/content/types')
                    ->push(__d('content', 'Type "{0}"', $contentType->name), '/admin/content/types/edit/' . $contentType->slug)
                    ->push(__d('content', 'Attach New Field'), '');
                break;

            case 'viewModeList':
                $this->Breadcrumb
                    ->push('/admin/content/manage')
                    ->push(__d('content', 'Content Types'), '/admin/content/types')
                    ->push(__d('content', 'Type "{0}"', $contentType->name), '/admin/content/types/edit/' . $contentType->slug)
                    ->push(__d('content', 'View Mode "{0}"', $this->viewVars['viewModeInfo']['name']), '');
                break;

            case 'viewModeEdit':
                $this->Breadcrumb
                    ->push('/admin/content/manage')
                    ->push(__d('content', 'Content Types'), '/admin/content/types')
                    ->push(__d('content', 'Type "{0}"', $contentType->name), '/admin/content/types/edit/' . $contentType->slug)
                    ->push(__d('content', 'View Mode "{0}"', $this->viewVars['viewModeInfo']['name']), ['plugin' => 'Content', 'controller' => 'fields', 'action' => 'view_mode_list', 'prefix' => 'admin', $this->viewVars['viewMode']])
                    ->push(__d('content', 'Field: {0}', $this->viewVars['instance']->label), '');
                break;
        }
    }
894897
def _paste_clipboard(self, *event):
        
        if react_to_event(self.view, self.view.editor, event):
            logger.debug("Paste")
            gui_helper_state_machine.paste_into_selected_state(self.model)
            return True
1333607
protected function render_tweet_button(): string
    {
        return '<a href="https://twitter.com/share" class="twitter-share-button" data-url="'.
            \wp_get_shortlink($this->post->get()->ID).'" data-text="'.
            \esc_attr(\sanitize_text_field(\get_the_title($this->post->get()))).
            '" data-via="" data-count="horizontal">Tweet</a>'.

            '<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?"http":"https";if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+"://platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document, "script", "twitter-wjs");</script>';
    }
832258
public static function onFlushContent(Event $event)
    {
        $content = $event->getTarget();
        if (!($content instanceof AbstractClassContent)) {
            return;
        }

        $page = $content->getMainNode();
        if (null === $page) {
            return;
        }

        $newEvent = new Event($page, $content);
        $newEvent->setDispatcher($event->getDispatcher());
        self::onFlushPage($newEvent);
    }