Renders an coloured block

@param array  $aLines The lines to render
@param string $sType  The type of block to render
552735
protected function outputBlock(array $aLines, string $sType): void
    {
        $aLengths   = array_map('strlen', $aLines);
        $iMaxLength = max($aLengths);

        $this->oOutput->writeln('<' . $sType . '> ' . str_pad('', $iMaxLength, ' ') . ' </' . $sType . '>');
        foreach ($aLines as $sLine) {
            $this->oOutput->writeln('<' . $sType . '> ' . str_pad($sLine, $iMaxLength, ' ') . ' </' . $sType . '>');
        }
        $this->oOutput->writeln('<' . $sType . '> ' . str_pad('', $iMaxLength, ' ') . ' </' . $sType . '>');
    }
440862
public function renderLine($type = 'cursor')
    {
        $choice = $this->choices[$this->line];
        $this->stream->write(Terminal::cursorToLineStart());
        if (is_string($choice)) {
            $this->stream->write($this->getTemplate($type, $this->getGroupTemplate($choice)));
            $this->stream->write(Terminal::cursorToLineStart());
        } else {
            $choice = ['selected' => isset($this->selections[$choice['key']])] + $choice;
            $this->stream->write($this->getTemplate($type, $this->getChoiceTemplate($choice)));
            $this->stream->write(Terminal::cursorToLineStart());
        }
    }
1094603
public function render(AbstractBlock $block, CliRenderer $renderer)
    {
        if (!($block instanceof Heading)) {
            throw new \InvalidArgumentException(sprintf('Incompatible block type: "%s"', get_class($block)));
        }

        $level  = $block->getLevel();
        $text   = $renderer->renderInlines($block->children());

        return sprintf(
            "\n%s %s\n",
            $renderer->style(str_repeat('#', $level), 'dark_gray'),
            $renderer->style($text, ['bold', 'cyan'])
        );
    }
582743
protected function renderBlock($name, $vars)
    {
        if (!$this->template->hasBlock($name)) {
            throw new \RuntimeException('Block "' . $name . '" not found.');
        }
        return $this->template->renderBlock($name, $vars);
    }
1242311
public function render($alert, $isBlock = false, $class = '')
    {
        if ($isBlock) {
            $class .= ' alert-block';
        }
        $class = trim($class);

        return sprintf($this->format, $class, $alert);
    }
725703
function renderEmptyBlocksFix() {
        var emptyBlocksCSS;

        // IE10+
        if (getDocumentMode() >= 10) {
          emptyBlocksCSS = '';
          each('p div h1 h2 h3 h4 h5 h6'.split(' '), function (name, i) {
            emptyBlocksCSS += (i > 0 ? ',' : '') + name + ':empty';
          });

          editor.contentStyles.push(emptyBlocksCSS + '{padding-right: 1px !important}');
        }
      }
527451
function render(content) {
  var deferred = q.defer();

  var blockType = "normal";
  var lines = content.split("\n");
  var blocks = {};
  for (var i=0; i<lines.length; i++) {
    var line = lines[i];

    if (line.substr(0,1) == "@") {
      blockType = line.substr(1).trim();
      if (blockType === "end") blockType = "normal";
      continue;
    }
    if (blocks[blockType])
      blocks[blockType] += line + "\n";
    else
      blocks[blockType] = line + "\n";
  }

  for (var key in blocks) {
    if (blocks.hasOwnProperty(key)) {
      try {
        blocks[key] = metaMarked(blocks[key]);
      } catch(err) {
        return deferred.reject(new Error(err));
      }
    }
    deferred.resolve(blocks);
  }

  return deferred.promise;
}
334350
function render($diff)
    {
        $xi = $yi = 1;
        $block = false;
        $context = array();

        $nlead = $this->_leading_context_lines;
        $ntrail = $this->_trailing_context_lines;

        $output = $this->_startDiff();

        $diffs = $diff->getDiff();
        foreach ($diffs as $i => $edit) {
            /* If these are unchanged (copied) lines, and we want to keep
             * leading or trailing context lines, extract them from the copy
             * block. */
            if (is_a($edit, 'Text_Diff_Op_copy')) {
                /* Do we have any diff blocks yet? */
                if (is_array($block)) {
                    /* How many lines to keep as context from the copy
                     * block. */
                    $keep = $i == count($diffs) - 1 ? $ntrail : $nlead + $ntrail;
                    if (count($edit->orig) <= $keep) {
                        /* We have less lines in the block than we want for
                         * context => keep the whole block. */
                        $block[] = $edit;
                    } else {
                        if ($ntrail) {
                            /* Create a new block with as many lines as we need
                             * for the trailing context. */
                            $context = array_slice($edit->orig, 0, $ntrail);
                            $block[] = new Text_Diff_Op_copy($context);
                        }
                        /* @todo */
                        $output .= $this->_block($x0, $ntrail + $xi - $x0,
                                                 $y0, $ntrail + $yi - $y0,
                                                 $block);
                        $block = false;
                    }
                }
                /* Keep the copy block as the context for the next block. */
                $context = $edit->orig;
            } else {
                /* Don't we have any diff blocks yet? */
                if (!is_array($block)) {
                    /* Extract context lines from the preceding copy block. */
                    $context = array_slice($context, count($context) - $nlead);
                    $x0 = $xi - count($context);
                    $y0 = $yi - count($context);
                    $block = array();
                    if ($context) {
                        $block[] = new Text_Diff_Op_copy($context);
                    }
                }
                $block[] = $edit;
            }

            if ($edit->orig) {
                $xi += count($edit->orig);
            }
            if ($edit->final) {
                $yi += count($edit->final);
            }
        }

        if (is_array($block)) {
            $output .= $this->_block($x0, $xi - $x0,
                                     $y0, $yi - $y0,
                                     $block);
        }

        return $output . $this->_endDiff();
    }
1367006
public function render($template = '', $data = []) {
		if (!isset($this->blocks[$template])) {
			$this->blocks[$template] = $this->blockFactory->create($template);
		}
		$block = $this->blocks[$template];
		$block->setData($data);
		return $block->render();
	}
190904
public function render(AbstractInline $inline, CliRenderer $renderer)
    {
        if (!($inline instanceof Code)) {
            throw new \InvalidArgumentException(sprintf('Incompatible inline type: "%s"', get_class($inline)));
        }

        return $renderer->style($inline->getContent(), 'yellow');
    }
257392
function render(Frame $frame) {
    $style = $frame->get_style(); 
    
    $this->_set_opacity( $frame->get_opacity( $style->opacity ) );

    $this->_render_border($frame);
    $this->_render_outline($frame);
    
    if (DEBUG_LAYOUT && DEBUG_LAYOUT_BLOCKS) {
      $this->_debug_layout($frame->get_border_box(), "red");
      if (DEBUG_LAYOUT_PADDINGBOX) {
        $this->_debug_layout($frame->get_padding_box(), "red", array(0.5, 0.5));
      }
    }
    
    if (DEBUG_LAYOUT && DEBUG_LAYOUT_LINES && $frame->get_decorator()) {
      foreach ($frame->get_decorator()->get_line_boxes() as $line) {
        $frame->_debug_layout(array($line->x, $line->y, $line->w, $line->h), "orange");
      }
    }
  }
713652
public function generateHTMLHeader($pIncludeStyles = false)
    {
        // PHPExcel object known?
        if (is_null($this->phpExcel)) {
            throw new PHPExcel_Writer_Exception('Internal PHPExcel object not set to an instance of an object.');
        }

        // Construct HTML
        $properties = $this->phpExcel->getProperties();
        $html = '<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">' . PHP_EOL;
        $html .= '<!-- Generated by PHPExcel - http://www.phpexcel.net -->' . PHP_EOL;
        $html .= '<html>' . PHP_EOL;
        $html .= '  <head>' . PHP_EOL;
        $html .= '      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">' . PHP_EOL;
        if ($properties->getTitle() > '') {
            $html .= '      <title>' . htmlspecialchars($properties->getTitle()) . '</title>' . PHP_EOL;
        }
        if ($properties->getCreator() > '') {
            $html .= '      <meta name="author" content="' . htmlspecialchars($properties->getCreator()) . '" />' . PHP_EOL;
        }
        if ($properties->getTitle() > '') {
            $html .= '      <meta name="title" content="' . htmlspecialchars($properties->getTitle()) . '" />' . PHP_EOL;
        }
        if ($properties->getDescription() > '') {
            $html .= '      <meta name="description" content="' . htmlspecialchars($properties->getDescription()) . '" />' . PHP_EOL;
        }
        if ($properties->getSubject() > '') {
            $html .= '      <meta name="subject" content="' . htmlspecialchars($properties->getSubject()) . '" />' . PHP_EOL;
        }
        if ($properties->getKeywords() > '') {
            $html .= '      <meta name="keywords" content="' . htmlspecialchars($properties->getKeywords()) . '" />' . PHP_EOL;
        }
        if ($properties->getCategory() > '') {
            $html .= '      <meta name="category" content="' . htmlspecialchars($properties->getCategory()) . '" />' . PHP_EOL;
        }
        if ($properties->getCompany() > '') {
            $html .= '      <meta name="company" content="' . htmlspecialchars($properties->getCompany()) . '" />' . PHP_EOL;
        }
        if ($properties->getManager() > '') {
            $html .= '      <meta name="manager" content="' . htmlspecialchars($properties->getManager()) . '" />' . PHP_EOL;
        }

        if ($pIncludeStyles) {
            $html .= $this->generateStyles(true);
        }

        $html .= '  </head>' . PHP_EOL;
        $html .= '' . PHP_EOL;
        $html .= '  <body>' . PHP_EOL;

        return $html;
    }
1306213
public function render_footer_script() {
		$output = null;
		if ( ! empty( $this->templates ) ) {
			$output .= $this->templates;
		}

		echo $output;
	}
369242
public static function renderTableRow(array $arrCells) : string
    {
        $strRow = "";
        foreach ($arrCells as $td) {
            $strRow .= self::td($td);
        }
        return self::tr($strRow);
    }
503895
public function block($messages, $type = 'error')
    {
        $output = [];
        if (!is_array($messages)) {
            $messages = (array) $messages;
        }
        foreach ($messages as $message) {
            $output[] = trim($message);
        }
        $formatter = new FormatterHelper();
        $this->line($formatter->formatBlock($output, $type, true));
    }
938164
public function renderScripts($withInternal = false, array $internalAttrs = [])
    {
        $html = [];

        $this->triggerEvent('onAssetRenderScripts', [
            'asset' => $this,
            'withInternal' => &$withInternal,
            'html' => &$html,
        ]);

        foreach ($this->scripts as $url => $script) {
            $defaultAttribs = [
                'src' => $script['url'],
            ];

            $attribs = array_merge($defaultAttribs, $script['attribs']);

            if ($script['options']['version'] !== false) {
                $attribs['src'] = $this->appendVersion($attribs['src']);
            }

            if (isset($script['options']['sri'])) {
                $attribs['integrity']   = $script['options']['sri'];
                $attribs['crossorigin'] = 'anonymous';
            }

            if (isset($script['options']['conditional'])) {
                $html[] = '<!--[if ' . $script['options']['conditional'] . ']>';
            }

            if (isset($script['options']['import'])) {
                $attribs['href'] = $attribs['src'];
                $attribs['rel']  = 'import';
                unset($attribs['src']);
                $html[] = (string) h('link', $attribs, null);
            } else {
                $html[] = (string) h('script', $attribs, null);
            }

            if (isset($script['options']['conditional'])) {
                $html[] = '<![endif]-->';
            }
        }

        if ($withInternal && $this->internalScripts) {
            $html[] = (string) h(
                'script',
                $internalAttrs,
                "\n" . $this->renderInternalScripts() . "\n" . $this->indents
            );
        }

        return implode("\n" . $this->indents, $html);
    }
213776
public function render($name = '', $content = '', array $attrs = array(), $type = 'submit')
    {
        $attrs = array_merge(array('text' => null, 'name' => $name), $attrs);

        $attrs = $this->_getBtnClasses($attrs);
        $attrs['type'] = $type;

        if (Arr::key('icon', $attrs)) {
            $content = '<i class="' . $this->_icon . '-' . $attrs['icon'] . '"></i> ' . $this->_translate($content);
            unset($attrs['icon']);
        }

        return '<button ' . $this->buildAttrs($attrs) . '>' . $content . '</button>';
    }