/**
  * @param string $text
  *
  * @return ListItem
  */
 protected function renderNextButton($text = null)
 {
     $content = Std::coalesce($text, Html::safe('»'));
     if (!$this->paginator->hasMorePages()) {
         return $this->getDisabledPageWrapper($content);
     }
     return $this->getPageWrapper($content, $this->paginator->url($this->paginator->currentPage() + 1));
 }
 /**
  * @return Div
  */
 public function getProse()
 {
     return new Div([], Std::map(function ($contents, $title) {
         return new Card([], [new CardHeader([], $title), new CardBlock([], [Html::safe((new CommonMarkConverter())->convertToHtml($contents))])]);
     }, $this->manifest->getProse()));
 }
Exemplo n.º 3
0
 /**
  * Get a safe HTML version of the contents of this object.
  *
  * @return SafeHtmlWrapper
  */
 public function getSafeHtml()
 {
     return Html::safe($this->render());
 }
Exemplo n.º 4
0
 /**
  * Render the content of the tag.
  *
  * @throws CoreException
  * @return string
  */
 protected function renderContent()
 {
     if (is_string($this->content) || $this->content instanceof SafeHtmlWrapper || $this->content instanceof SafeHtmlProducerInterface) {
         return Html::escape($this->content);
     } elseif ($this->content instanceof RenderableInterface) {
         return Html::escape($this->content->render());
     } elseif (is_array($this->content) || $this->content instanceof ArrayableInterface) {
         return ArrayList::of($this->content)->map(function ($child) {
             if (is_string($child) || $child instanceof SafeHtmlWrapper || $child instanceof SafeHtmlProducerInterface) {
                 return Html::escape($child);
             } elseif ($child instanceof RenderableInterface) {
                 return Html::escape($child->render());
             }
             throw new NodeChildRenderingException($child);
         })->join();
     }
     throw new NodeRenderingException($this->content);
 }
Exemplo n.º 5
0
 /**
  * Get a safe HTML version of the contents of this object.
  *
  * @return SafeHtmlWrapper
  */
 public function getSafeHtml()
 {
     $result = $this->render();
     return Html::safe(Html::escape($result));
 }
Exemplo n.º 6
0
 /**
  * Render the sidebar for this module.
  *
  * If null is returned, we won't display one.
  *
  * @param ConferenceContext $context
  *
  * @return SafeHtmlWrapper
  */
 public function renderSidebar(ConferenceContext $context)
 {
     return Html::safe((new UnorderedList(['class' => 'nav nav-pills nav-stacked'], Std::map(function (Method $method, $methodName) use($context) {
         return new ListItem(['class' => 'nav-item'], [new Anchor(['href' => $context->method($this->getName(), $methodName), 'class' => 'nav-link'], Std::coalesce($method->getLabel(), $methodName))]);
     }, Std::filter(function (Method $method) {
         return !$method->isHidden();
     }, $this->getMethods()))))->render());
 }