Render and event_message instance

@param event_message $eventmessage The event_message instance to render
@return string HTML representing the event_message instance
347593
protected function render_event_message(event_message $eventmessage) {
        global $CFG;

        if (file_exists($CFG->dirroot . '/mod/chat/gui_ajax/theme/'.$eventmessage->theme.'/config.php')) {
            include($CFG->dirroot . '/mod/chat/gui_ajax/theme/'.$eventmessage->theme.'/config.php');
        }

        $patterns = array();
        $patterns[] = '___senderprofile___';
        $patterns[] = '___sender___';
        $patterns[] = '___time___';
        $patterns[] = '___event___';

        $replacements = array();
        $replacements[] = $eventmessage->senderprofile;
        $replacements[] = $eventmessage->sendername;
        $replacements[] = $eventmessage->time;
        $replacements[] = $eventmessage->event;

        return str_replace($patterns, $replacements, $chattheme_cfg->event_message);
    }
196906
protected function renderAsList(array $flashMessages)
    {
        $flashMessagesClass = $this->arguments['class'] !== null ? $this->arguments['class'] : 'flashmessages';
        $tagContent = '';
        /** @var $singleFlashMessage Message */
        foreach ($flashMessages as $singleFlashMessage) {
            $severityClass = sprintf('%s-%s', $flashMessagesClass, strtolower($singleFlashMessage->getSeverity()));
            $messageContent = htmlspecialchars($singleFlashMessage->render());
            if ($singleFlashMessage->getTitle() !== '') {
                $messageContent = sprintf('<h3>%s</h3>', htmlspecialchars($singleFlashMessage->getTitle())) . $messageContent;
            }
            $tagContent .= sprintf('<li class="%s">%s</li>', htmlspecialchars($severityClass), $messageContent);
        }
        $this->tag->setContent($tagContent);
        $content = $this->tag->render();

        return $content;
    }
1001858
protected function generateMsgHtml()
    {
        $templateIdent = $this->templateIdent();

        if (!$templateIdent) {
            $message = '';
        } else {
            $message = $this->renderTemplate($templateIdent);
        }

        return $message;
    }
124200
public function beforeRender(Event $event) {
		/** @var \Cake\Controller\Controller $controller */
		$controller = $event->getSubject();
		$controller->viewBuilder()->setClassName($this->_config['viewClass']);

		// Set flash messages to the view
		if ($this->_config['flashKey']) {
			$message = $controller->getRequest()->getSession()->consume($this->_config['flashKey']);
			if ($message || !array_key_exists('_message', $controller->viewVars)) {
				$controller->set('_message', $message);
			}
		}

		// If _serialize is true, *all* viewVars will be serialized; no need to add _message.
		if ($this->_isSerializeTrue($controller)) {
			return;
		}

		$serializeKeys = ['_message'];
		if (!empty($controller->viewVars['_serialize'])) {
			$serializeKeys = array_merge((array)$controller->viewVars['_serialize'], $serializeKeys);
		}
		$controller->set('_serialize', $serializeKeys);
	}
984643
private function formatEventMessage(Event $event)
    {
        $message = null;
        $entityName = null;
        
        if ($event instanceof OrmEventInterface) {
            switch (true) {
                case ($event instanceof EntityLifecycleEvent):
                    $entityName = $event->getRepository()->getEntityName();
                    $message = $this->entityToString($event->getEntity());
                    break;
                case ($event instanceof MetadataLoadEvent):
                    $message = $this->metadataToString($event->getMetadata());
                    $entityName = $event->getMetadata()->getEntityClass();
                    break;
                case ($event instanceof FinderExecutionEvent):
                    $entityName = $event->getRepository()->getEntityName();
                    $query = $event->getSelectQuery();
                    $message = sprintf("SQL: (%s)", str_replace("\n", "\x20", $query->toSQL()));
                    break;
            }
        }
        
        $eventName = sprintf('%s::%s', (new \ReflectionObject($event))->getShortName(), $event->getName());
        $separator = str_repeat('-', 32);
        
        return sprintf("%s\n[%s]\nEntityClassName: %s\n%s", $separator, $eventName, $entityName, $message);
    }
363474
protected function renderErrorMessages(Element $element)
    {
        $html = '';

        // if we have error messages, then also render those
        if ($element instanceof AbstractFormField && sizeof($element->getErrorMessages()) > 0) {
            // render the error as title?
            if ($this->errorFormat == self::RENDER_AS_ATTRIBUTE) {
                // if the element is a form field, add the errors in the title tag
                $element->setAttribute($this->errorTagOrAttr, implode("\n", $element->getErrorMessages()));
            } elseif ($this->errorFormat == self::RENDER_AS_TAG) {
                $tag = new Tag($this->errorTagOrAttr);
                $tag->setInnerHtml(implode('<br />' . PHP_EOL, $element->getErrorMessages()));
                $html .= $tag->render();
            }
        }

        return $html;
    }
983083
private function render()
    {
        add_action('admin_notices', function () {
            if (is_array($this->message) && !empty($this->message)) {
                echo '<div class="error notice">';
                echo '<ul>';
                foreach ($this->message as $message) {
                    echo '<li>' . $message . '</li>';
                }
                echo '</ul>';
                echo '</div>';

                $this->message = array();
            }
        });
    }
1168555
public function publishSystemTemplate($templateMessage) {
    	try{
			if (empty($templateMessage))
				throw new Exception('Paramer "templateMessage" is required');


    		$params = json_decode($templateMessage,TRUE);

    		$ret = $this->SendRequest->curl('/message/system/publish_template.json',$params,'json','im','POST');
    		if(empty($ret))
    			throw new Exception('bad request');
    		return $ret;

    	}catch (Exception $e) {
    		print_r($e->getMessage());
    	}
   }
218992
def render_message(type = :info, msg = nil, &blk)
      icon_class = message_icon_class(type)
      if block_given?
        content_tag :div, render_icon(icon_class) + capture(&blk), class: "#{type} message"
      else
        content_tag :div, render_icon(icon_class) + msg, class: "#{type} message"
      end
    end
569677
public function addEvent(EventMessage $event)
    {
        $this->events[] = $event;
        if (stristr($event->getEventList(), 'complete') !== false
            || stristr($event->getName(), 'complete') !== false
            || stristr($event->getName(), 'DBGetResponse') !== false
        ) {
            $this->completed = true;
        }
    }
1317583
public function RenderError ($exceptionMessage = '') {
		if ($this->application->IsErrorDispatched()) return;
		throw new \ErrorException(
			$exceptionMessage ? $exceptionMessage :
			"Server error: `" . htmlspecialchars($this->request->GetFullUrl()) . "`.",
			500
		);
	}
1191940
public function render($messages = null)
	{
		if ($messages)
		{
			$this->setMessages($messages);
		}

		$messages = $this->getMessages();

		$output = array();
		$output[] = '<script type="text/javascript">';
		$output[] = 'if (!window.console) console = {};';
		$output[] = 'console.log   = console.log   || function(){};';
		$output[] = 'console.warn  = console.warn  || function(){};';
		$output[] = 'console.error = console.error || function(){};';
		$output[] = 'console.info  = console.info  || function(){};';
		$output[] = 'console.debug = console.debug || function(){};';
		foreach ($messages as $item)
		{
			$output[] = 'console.' . $item['label'] . '("' . addslashes($this->_deflate($item['message'])) . '");';
		}
		$output[] = '</script>';
		return implode("\n", $output);
	}
976173
protected function render(): string
    {
        $html = '<div class="' . $this->classes() . '" role="alert">';
        if ($this->heading !== null) {
            $html .= '<h' . $this->heading_level . ' class="alert-heading">' .
                $this->heading . '</h' . $this->heading_level . '>';
        }
        $html .= $this->message . '</div>';

        return $html;
    }
189930
public static function getXPathTransformer(
    string $errorMessage = 'No CSS selector support installed'
  ): \FluentDOM\Xpath\Transformer {
    foreach (self::$_xpathTransformers as $index => $transformer) {
      if (is_string($transformer) && class_exists($transformer)) {
        self::$_xpathTransformers[$index] = new $transformer();
      } elseif (is_callable($transformer)) {
        self::$_xpathTransformers[$index] = $transformer();
      }
      if (self::$_xpathTransformers[$index] instanceof \FluentDOM\Xpath\Transformer) {
        return self::$_xpathTransformers[$index];
      }
      unset(self::$_xpathTransformers[$index]);
    }
    throw new \LogicException($errorMessage);
  }
239272
protected function getEventMessage(Event $event)
    {
        $sanitizedText = $this->getSanitizedText($event);

        $message = sprintf(
            "_e{%d,%d}:%s|%s|d:%d|h:%s|t:%s",
            strlen($event->getTitle()),
            strlen($sanitizedText),
            $event->getTitle(),
            $sanitizedText,
            $event->getTimeStamp(),
            $event->getHost(),
            $event->getType()
        );

        return $message . $this->getFormattedTags($event);
    }
505385
public function ajaxNoAccess($errorMessage)
    {
        return sprintf(
            '<div class="alert alert-danger">
                <p><strong>%s:</strong> %s</p>
                <p><a href="%s">%s</a></p>
            </div>',
            Piwik::translate('General_Error'),
            htmlentities($errorMessage, Common::HTML_ENCODING_QUOTE_STYLE, 'UTF-8', $doubleEncode = false),
            'index.php?module=' . Piwik::getLoginPluginName(),
            Piwik::translate('Login_LogIn')
        );
    }
1321077
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()
        );
    }