Event detail renderer.

@param array $observerlist A list of observers that consume this event.
@param array $eventinformation A list of information about the event.
@return string HTML to be displayed.
557132
public function render_event_detail($observerlist, $eventinformation) {
        global $PAGE;

        $titlehtml = $this->output->header();
        $titlehtml .= $this->output->heading($eventinformation['title']);

        $html = html_writer::start_tag('dl', array('class' => 'list'));

        $explanation = nl2br($eventinformation['explanation']);
        $html .= html_writer::tag('dt', get_string('eventexplanation', 'report_eventlist'));
        $html .= html_writer::tag('dd', $explanation);

        if (isset($eventinformation['crud'])) {
            $html .= html_writer::tag('dt', get_string('crud', 'report_eventlist'));
            $html .= html_writer::tag('dd', $eventinformation['crud']);
        }

        if (isset($eventinformation['edulevel'])) {
            $html .= html_writer::tag('dt', get_string('edulevel', 'report_eventlist'));
            $html .= html_writer::tag('dd', $eventinformation['edulevel']);
        }

        if (isset($eventinformation['objecttable'])) {
            $html .= html_writer::tag('dt', get_string('affectedtable', 'report_eventlist'));
            $html .= html_writer::tag('dd', $eventinformation['objecttable']);
        }

        if (isset($eventinformation['legacyevent'])) {
            $html .= html_writer::tag('dt', get_string('legacyevent', 'report_eventlist'));
            $html .= html_writer::tag('dd', $eventinformation['legacyevent']);
        }

        if (isset($eventinformation['parentclass'])) {
            $url = new moodle_url('eventdetail.php', array('eventname' => $eventinformation['parentclass']));
            $html .= html_writer::tag('dt', get_string('parentevent', 'report_eventlist'));
            $html .= html_writer::tag('dd', html_writer::link($url, $eventinformation['parentclass']));
        }

        if (isset($eventinformation['abstract'])) {
            $html .= html_writer::tag('dt', get_string('abstractclass', 'report_eventlist'));
            $html .= html_writer::tag('dd', get_string('yes', 'report_eventlist'));
        }

        if (isset($eventinformation['typeparameter'])) {
            $html .= html_writer::tag('dt', get_string('typedeclaration', 'report_eventlist'));
            foreach ($eventinformation['typeparameter'] as $typeparameter) {
                $html .= html_writer::tag('dd', $typeparameter);
            }
        }

        if (isset($eventinformation['otherparameter'])) {
            $html .= html_writer::tag('dt', get_string('othereventparameters', 'report_eventlist'));
            foreach ($eventinformation['otherparameter'] as $otherparameter) {
                $html .= html_writer::tag('dd', $otherparameter);
            }
        }

        // List observers consuming this event if there are any.
        if (!empty($observerlist)) {
            $html .= html_writer::tag('dt', get_string('relatedobservers', 'report_eventlist'));
            foreach ($observerlist as $observer) {
                if ($observer->plugin == 'core') {
                    $html .= html_writer::tag('dd', $observer->plugin);
                } else {
                    $manager = get_string_manager();
                    $pluginstring = $observer->plugintype . '_' . $observer->plugin;
                    if ($manager->string_exists('pluginname', $pluginstring)) {
                        if (!empty($observer->parentplugin)) {
                            $string = get_string('pluginname', $pluginstring) . ' (' . $observer->parentplugin
                                    . ' ' . $pluginstring . ')';
                        } else {
                            $string = get_string('pluginname', $pluginstring) . ' (' . $pluginstring . ')';
                        }
                    } else {
                        $string = $observer->plugintype . ' ' . $observer->plugin;
                    }
                    $html .= html_writer::tag('dd', $string);
                }
            }
        }
        $html .= html_writer::end_div();
        $html .= html_writer::end_tag('dl');

        $pagecontent = new html_table();
        $pagecontent->data = array(array($html));
        $pagehtml = $titlehtml . html_writer::table($pagecontent);
        $pagehtml .= $this->output->footer();

        return $pagehtml;
    }
155027
public function onSubscriptionCancel(StripeSubscriptionCancelEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $localSubscription = $event->getLocalSubscription();

        $localSubscription->setCancelAtPeriodEnd(true);

        $result = $this->getStripeManager()->cancelSubscription($localSubscription, true);

        // Check if something went wrong
        if (false === $result) {
            // Stop progation
            $event->setStopReason($this->getStripeManager()->getError())->stopPropagation();

            // Dispatch a failed event
            $dispatcher->dispatch(StripeSubscriptionCancelEvent::FAILED, $event);

            // exit
            return;
        }

        $dispatcher->dispatch(StripeSubscriptionCancelEvent::CANCELED, $event);
    }
885091
public function selectRenderer(ViewEvent $e)
    {
        $model = $e->getModel();

        if ($model instanceof NewsletterViewModel) {
            return $this->renderer;
        }

        return false;
    }
578575
public function renderTabGroup(string $groupIdentifier, array $parameters = [], ?string $template = null): string
    {
        $template = $template ?? $this->defaultTemplate;

        $tabGroup = new TabGroup($groupIdentifier);

        $tabGroupEvent = new TabGroupEvent();
        $tabGroupEvent->setData($tabGroup);
        $tabGroupEvent->setParameters($parameters);

        $this->eventDispatcher->dispatch(TabEvents::TAB_GROUP_INITIALIZE, $tabGroupEvent);

        $this->eventDispatcher->dispatch(TabEvents::TAB_GROUP_PRE_RENDER, $tabGroupEvent);

        $tabs = [];
        foreach ($tabGroupEvent->getData()->getTabs() as $tab) {
            $tabEvent = $this->dispatchTabPreRenderEvent($tab, $parameters);
            $parameters = array_merge($parameters, $tabGroupEvent->getParameters(), $tabEvent->getParameters());
            $tabs[] = $this->composeTabParameters($tabEvent->getData(), $parameters);
        }

        return $this->twig->render(
            $template,
            array_merge(['tabs' => $tabs, 'group' => $groupIdentifier], $parameters)
        );
    }
1033717
private function createInstantiationListener(EventManagerInterface $eventManager)
    {
        return function ($proxy, $instance, $method, $params, $returnValue) use ($eventManager) {
            $eventName = ('create' === $method)
                ? ServiceManagerEvent::EVENT_SERVICEMANAGER_CREATE
                : ServiceManagerEvent::EVENT_SERVICEMANAGER_GET;

            $serviceName = $params['name'];

            if (is_array($serviceName)) {
                list($canonicalName, $serviceName) = $serviceName;
            } else {
                $canonicalName = strtolower(
                    strtr($serviceName, array('-' => '', '_' => '', ' ' => '', '\\' => '', '/' => ''))
                );
            }

            $eventManager->trigger(new ServiceManagerEvent(
                $eventName,
                $proxy,
                $returnValue,
                $serviceName,
                $canonicalName
            ));
        };
    }
1342524
public function render(): string
   {
       try {
           $output = "";
           foreach ($this->observer as $value) {
               $output .= $value->render();
           }
           return $output;
       } catch (Throwable $e) {
           throw new ViewException(
               "Can't render " . static::class . " " . $e->getMessage()
           );
       }
   }
719985
public function DiscussionModel_AfterSaveDiscussion_Handler($Sender) {
      $FormPostValues = GetValue('FormPostValues', $Sender->EventArguments, array());
      $DiscussionID = GetValue('DiscussionID', $Sender->EventArguments, 0);
      $CategoryID = GetValueR('Fields.CategoryID', $Sender->EventArguments, 0);
      $IsInsert = GetValue('Insert', $Sender->EventArguments);
      $RawFormTags = GetValue('Tags', $FormPostValues, '');
      $FormTags = trim(strtolower($RawFormTags));
      $FormTags = TagModel::SplitTags($FormTags);
      
      // Get discussion
      
      // If we're associating with categories
      $CategorySearch = C('Plugins.Tagging.CategorySearch', FALSE);
      if ($CategorySearch)
         $CategoryID = GetValue('CategoryID', $FormPostValues, FALSE);
      
      // Resave the Discussion's Tags field as serialized
      $SerializedTags = Gdn_Format::Serialize(explode(',',$RawFormTags));
      $Sender->SQL->Update('Discussion')->Set('Tags', $SerializedTags)->Where('DiscussionID', $DiscussionID)->Put();
      
      // Find out which of these tags is not yet in the tag table
      $ExistingTagQuery = $Sender->SQL->Select('TagID, Name')
         ->From('Tag')
         ->WhereIn('Name', $FormTags);
      
      if ($CategorySearch)
         $ExistingTagQuery->Where('CategoryID', $CategoryID);
      
      $ExistingTagData = $ExistingTagQuery->Get();
      $NewTags = $FormTags;
      $Tags = array(); // <-- Build a complete associative array of $Tags[TagID] => TagName values for this discussion.
      foreach ($ExistingTagData as $ExistingTag) {
         if (in_array(strtolower($ExistingTag->Name), $NewTags))
            unset($NewTags[array_search($ExistingTag->Name, $NewTags)]);

         $Tags[$ExistingTag->TagID] = $ExistingTag->Name;
      }

      // Insert the missing ones (if we have permission)
      if (Gdn::Session()->CheckPermission('Plugins.Tagging.Add')) {
         foreach ($NewTags as $NewTag) {

            $NewTag = array(
               'Name' => strtolower($NewTag),
               'InsertUserID' => Gdn::Session()->UserID,
               'DateInserted' => Gdn_Format::ToDateTime(),
               'CountDiscussions' => 0
            );

            if ($CategorySearch)
               $NewTag['CategoryID'] = $CategoryID;
            $TagID = $Sender->SQL->Options('Ignore', TRUE)->Insert('Tag', $NewTag);
            $Tags[$TagID] = $NewTag;
         }
      }

      // Find out which tags are not yet associated with this discussion, and which tags are no longer on this discussion
      $TagIDs = array_keys($Tags);
      $NonAssociatedTagIDs = $TagIDs;
      $AssociatedTagIDs = array();
      $RemovedTagIDs = array();
      $ExistingTagData = $Sender->SQL
         ->Select('t.*')
         ->From('TagDiscussion td')
         ->Join('Tag t', 'td.TagID = t.TagID')
         ->Where('DiscussionID', $DiscussionID)
         ->Get();
      
      foreach ($ExistingTagData as $ExistingTag) {
         if (in_array($ExistingTag->TagID, $TagIDs))
            unset($NonAssociatedTagIDs[array_search($ExistingTag->TagID, $NonAssociatedTagIDs)]);
         else if (!GetValue('Type', $ExistingTag) && !in_array($ExistingTag->TagID, $TagIDs))
            $RemovedTagIDs[] = $ExistingTag->TagID;
         else
            $AssociatedTagIDs[] = $ExistingTag->TagID;
      }

      // Associate the ones that weren't already associated
      foreach ($NonAssociatedTagIDs as $TagID) {
         $Sender->SQL->Options('Ignore', TRUE)->Insert('TagDiscussion', array(
            'TagID' => $TagID,
            'DiscussionID' => $DiscussionID, 
            'CategoryID' => $CategoryID
         ));
      }

      // Remove tags that were removed, and reduce their counts
      if (count($RemovedTagIDs) > 0) {
         // Reduce count
         $Sender->SQL->Update('Tag')->Set('CountDiscussions', 'CountDiscussions - 1', FALSE)->WhereIn('TagID', $RemovedTagIDs)->Put();
         // Remove association
         $Sender->SQL->WhereIn('TagID', $RemovedTagIDs)->Delete('TagDiscussion', array('DiscussionID' => $DiscussionID));
      }

      // Update the count on all previously unassociated tags
      $Sender->SQL->Update('Tag')->Set('CountDiscussions', 'CountDiscussions + 1', FALSE)->WhereIn('TagID', $NonAssociatedTagIDs)->Put();
   }
210805
public function onSubscriptionCreate(StripeSubscriptionCreateEvent $event, $eventName, EventDispatcherInterface $dispatcher)
    {
        $localSubscription = $event->getLocalSubscription();

        $result = $this->getStripeManager()->createSubscription($localSubscription);

        // Check if something went wrong
        if (false === $result) {
            // Stop progation
            $event->setStopReason($this->getStripeManager()->getError())->stopPropagation();

            // Dispatch a failed event
            $dispatcher->dispatch(StripeSubscriptionCreateEvent::FAILED, $event);

            // exit
            return;
        }

        $dispatcher->dispatch(StripeSubscriptionCreateEvent::CREATED, $event);
    }
502641
public function renderRest($showFormEnd = true, $showFields = true)
    {
        $fields = $this->getUnrenderedFields();

        return $this->render([], $fields, false, $showFields, $showFormEnd);
    }
492836
public function resolveContentForArticlePageOnPostSerialize(ObjectEvent $event)
    {
        $article = $event->getObject();
        $visitor = $event->getVisitor();
        $context = $event->getContext();

        if (!$article instanceof ArticlePageDocument || !$context->attributes->containsKey('website')) {
            return;
        }

        $content = $this->resolve($article);
        foreach ($content as $name => $value) {
            $visitor->addData($name, $value);
        }
    }
693392
protected static function add_observers(array $observers, $file, $plugintype = null, $plugin = null) {
        global $CFG;

        foreach ($observers as $observer) {
            if (empty($observer['eventname']) or !is_string($observer['eventname'])) {
                debugging("Invalid 'eventname' detected in $file observer definition", DEBUG_DEVELOPER);
                continue;
            }
            if ($observer['eventname'] === '*') {
                $observer['eventname'] = '\core\event\base';
            }
            if (strpos($observer['eventname'], '\\') !== 0) {
                $observer['eventname'] = '\\'.$observer['eventname'];
            }
            if (empty($observer['callback'])) {
                debugging("Invalid 'callback' detected in $file observer definition", DEBUG_DEVELOPER);
                continue;
            }
            $o = new \stdClass();
            $o->callable = $observer['callback'];
            if (!isset($observer['priority'])) {
                $o->priority = 0;
            } else {
                $o->priority = (int)$observer['priority'];
            }
            if (!isset($observer['internal'])) {
                $o->internal = true;
            } else {
                $o->internal = (bool)$observer['internal'];
            }
            if (empty($observer['includefile'])) {
                $o->includefile = null;
            } else {
                if ($CFG->admin !== 'admin' and strpos($observer['includefile'], '/admin/') === 0) {
                    $observer['includefile'] = preg_replace('|^/admin/|', '/'.$CFG->admin.'/', $observer['includefile']);
                }
                $observer['includefile'] = $CFG->dirroot . '/' . ltrim($observer['includefile'], '/');
                if (!file_exists($observer['includefile'])) {
                    debugging("Invalid 'includefile' detected in $file observer definition", DEBUG_DEVELOPER);
                    continue;
                }
                $o->includefile = $observer['includefile'];
            }
            $o->plugintype = $plugintype;
            $o->plugin = $plugin;
            self::$allobservers[$observer['eventname']][] = $o;
        }
    }
860513
public function htmlPagination($identifier,$from=1,$to=1,$active=NULL,$countVisible=NULL){
		return $this->addHtmlComponent(new HtmlPagination($identifier,$from,$to,$active,$countVisible));
	}
203811
private function getEventDetailsHtml(&$details) {
    $html = '<h4>Event Goal</h4><pre>' .
            'Use Event Value = ' . $details->getUseEventValue();

    // Get all the event goal conditions.
    $conditions = $details->getEventConditions();

    // String condition types.
    $stringTypes = array('CATEGORY', 'ACTION', 'LABEL');

    foreach ($conditions as &$condition) {
      $html .= "Event Type = $condition->getEventType()";

      $eventType = $condition->getType();
      if (in_array($eventType, $stringTypes)) {
        // Process CATEGORY, ACTION, LABEL.
        $html .= "Match Type = $condition->getMatchType()" .
                 "Expression = $condition->getExpression()";
      } else {
        // Process VALUE.
        $html .= "Comparison Type  = $condition->getComparisonType()" .
                 "Comparison Value = $condition->getComparisonValue()";
      }
    }

    return $html . '</pre>';
  }
163170
private function renderInfoWindow(Map $map, InfoWindow $infoWindow, $position = true)
    {
        return $this->getFormatter()->renderContainerAssignment(
            $map,
            $this->infoWindowRenderer->render($infoWindow, $position),
            'overlays.info_windows',
            $infoWindow
        );
    }
61335
public function render(AbstractBlock $block, ElementRendererInterface $htmlRenderer, $inTightList = false)
    {
        if (!($block instanceof IndentedCode)) {
            throw new \InvalidArgumentException('Incompatible block type: ' . get_class($block));
        }

        return $this->getHTMLElement($block->getStringContent(), "");
    }
545955
@Override
	public void render(RenderingInfo renderingInfo) {
		if (renderingInfo == null) {
			throw new NullPointerException("RenderingInfo cannot be null.");
		}
		if (!(renderingInfo.getWidget() instanceof HtmlContainer)) {
			throw new IllegalArgumentException("This renderer requires a HtmlContainer to render in.");
		}
		layersModelContainer = (HtmlContainer) renderingInfo.getWidget();

		// Delegate to the layers in layer order:
		for (int i = 0; i < layersModel.getLayerCount(); i++) {
			Layer layer = layersModel.getLayer(i);

			// If we're in the middle of an animation and the layer does not support it, skip this layer:
			if (navigating && !isAnimated(layer)) {
				continue;
			}

			// Adjust the rendering info, to use a layer specific container widget:
			RenderingInfo layerInfo = new RenderingInfo(getOrCreateLayerContainer(layer), renderingInfo.getView(),
					renderingInfo.getTrajectory());
			LayerRenderer layerRenderer = layerRenderers.get(layer);
			layerRenderer.render(layerInfo);
		}
	}
4734
public function render(ListDataEvent $event, bool $ui = true):string
    {
        $data = $this->getData($event, !$ui);
        $params = array_merge(
            $data,
            [
                'columns' => $this->getColumns(),
                'actions' => $this->getActions(),
                'ui' => $ui,
            ]
        );

        return $this->container->get('vardius_list.view.renderer')->renderView($this->getView(), $params);
    }