Renders the HTML head
@param $custom_head_markup string A string of data to include in the HTML head, right before </head>
2152
public function htmlHead($custom_head_markup = '')
    {

        if (!empty($custom_head_markup)) {
            $this->custom_head_markup = $custom_head_markup;
        }

        $html = $this->doc_type . "\n";
        $html .= $this->opening_html_tag . "\n";
        $html .= '<head>' . "\n";
        $html .= '<meta http-equiv="Content-Type" content="text/html; charset=' . $this->charset . '" />' . "\n";
        $html .= '<meta http-equiv="X-UA-Compatible" content="IE=edge" />'."\n";
        $html .= '<title>' . $this->title . '</title>' . "\n";

        if ($this->meta instanceof HeadMeta) {

            foreach (get_object_vars($this->meta) as $key => $val) {
                $html .= '<meta name="' . $key . '" content="' . $val . '" />' . "\n";
            }
        }

        $html .= '<style type="text/css">';

        foreach ($this->styles as $style) {
            if (!preg_match("~^(http|/)~", $style)) {
                $style = '/css/' . $style;
            }
            $html .= "@import '" . $style . "';\n";
        }
        $html .= "</style>\n";

        if (!empty($this->custom_head_markup)) {
            $html.= $this->custom_head_markup;
        }

        $html.= "</head>\n";
        return $html;
    }
515841
public function render($custom = null)
    {
        $messages = $this->toArray();

        if ( ! empty ($messages)) {
            $this->clearMessages();
            return $this->theme->render(
                $custom,
                ['messages' => $this->withDefaults($messages)],
                'alert'
            );
        }

        return '';
    }
1161573
public function _head($node) {
		unset($node['@attrib']);
		$content = array();
		// bypass inner content nodes
		foreach ($node as $el)
			$content[] = $this->template->build($el);
		return '<head>'.implode("\n", $content).
			$this->render('head')."\n".'</head>';
	}
456297
public function renderHeader() {
		
		if ($this->title !== false) {
			echo CHtml::openTag('div', $this->headerHtmlOptions);
			if ($this->title) {
				$this->title = '<h3 class="panel-title" style="display: inline;">' . $this->title . '</h3>';

				if ($this->headerIcon) {
					if (strpos($this->headerIcon, 'icon') === false && strpos($this->headerIcon, 'fa') === false)
						$this->title = '<span class="glyphicon glyphicon-' . $this->headerIcon . '"></span> ' . $this->title;
					else
						$this->title = '<i class="' . $this->headerIcon . '"></i> ' . $this->title;
				}
				
				$this->renderButtons();
				echo $this->title;
			}
			echo '<div class="clearfix"></div>';
			echo CHtml::closeTag('div');
		}
	}
829386
private function render() {
		$strings = implode($this->strings);
		
		// Render includes
		foreach ($this->incTemplates as $path => $include) {
			$incOutput = $include->render();
			$path = preg_replace("/\//", "\/", $path);
			$strings = preg_replace("/\{include\s$path\}/", $incOutput, $strings);
		}
		
		// Render if-statements
		foreach ($this->ifTemplates as $key => $sub) {
			foreach ($sub as $iKey => $instance) {
				$str = '';
				
				if ($this->expressions[$key]->evaluate($this->vars)) {
					$str = $instance->render();
				}
				
				$pregKey = preg_quote($key, '/');
				$strings = preg_replace("/\{if:$pregKey:$iKey\}/", $str, $strings);
			}
		}
		
		// Render foreach-loops
		foreach ($this->forTemplates as $key => $sub) {
			foreach ($sub as $iKey => $instance) {
				$tmplGen = '';
				
				if (isset($this->vars[$key]) && is_array($this->vars[$key])) {
					foreach ($this->vars[$key] as $assocArray) {
						foreach ($assocArray as $k => $v)
							$instance->set($k, $v);
						$tmplGen .= $instance->render();
					}
				}
				
				$pregKey = preg_quote($key, '/');
				$strings = preg_replace("/\{for:$pregKey:$iKey\}/", $tmplGen, $strings);
			}
		}
		
		// Render plain old variables
		foreach ($this->vars as $key => $val) {
			if (!is_array($val))
				$strings = preg_replace("/\{$key\}/", $val, $strings);
		}
		
		// Render expressions
		foreach ($this->expressions as $key => $expr) {
			$eval = $expr->evaluate($this->vars);

			// If we're an array, lets insert the number of items in the array.
			if ( is_array( $eval ) ) {
				$eval = count( $eval );
			}

			$pregKey = preg_quote($key, '/');
			
			$strings = preg_replace('/\{'.$pregKey.'\}/', $eval, $strings);
		}
		
		$strings = preg_replace("/\\\{/", '{', $strings);
		$strings = preg_replace("/\\\}/", '}', $strings);

		return $strings;
	}
1089273
public function renderHelp()
    {
        $this->renderHeader();

        echo Line::begin('Usage:', Line::YELLOW)->nl();
        echo Line::begin()
            ->indent(2)
            ->text($this->getUsage())
            ->nl(2);

        // Options
        echo Line::begin('Options:', Line::YELLOW)->nl();
        echo Line::begin()
            ->indent(2)
            ->text('--help', Line::MAGENTA)
            ->to(21)
            ->text('-h', Line::MAGENTA)
            ->text('Display this help message.')
            ->nl(1);

        $attributes = $this->attributeNames();
        $help = $this->attributeHelp();

        sort($attributes);

        foreach ($attributes as $name) {
            echo Line::begin()
                ->indent(2)
                ->text("--$name", Line::MAGENTA)
                ->to(24)
                ->text(isset($help[$name]) ? $help[$name] : '')
                ->nl();
        }

        exit(0);
    }
448205
public function head($include = null)
    {
        if (null === $include) {
            $include = $this->defaults;
        }

        $include = (array) $include;

        $this->process($include);

        return "\n"
            . ( in_array(self::METAS, $include)   ? $this->metas() : '')
            . ( in_array(self::TITLE, $include)   ? $this->title() : '')
            . ( in_array(self::LINKS, $include)   ? $this->links() : '')
            . ( in_array(self::STYLES, $include)  ? $this->styles() : '')
            . ( in_array(self::SCRIPTS, $include) ? $this->scripts() : '')
            ;
    }
555509
protected function render ()
  {
    $prop = $this->props;
    if (exists ($prop->src))
      $this->context->getAssetsService ()->addStylesheet ($prop->src, $this->props->prepend);
    else if ($this->hasChildren ())
      $this->context->getAssetsService ()->addInlineCss (self::getRenderingOfSet ($this->getChildren ()), $prop->name,
        $this->props->prepend);
  }
315668
protected function renderJavascript()
    {
        $html = "";

        foreach( $this->javascript as $item )
        {
            $html .= sprintf( MPageController::JAVASCRIPT_TEMPLATE, $item["src"] ) . "\n";
        }

        $domQuery = $this->qp->find( "head" );
        if( $domQuery->count() <= 0 )
        {
            trigger_error( 'head tag not found in page', E_USER_WARNING );
        }
        else
        {
            $domQuery->append( $html );
        }
    }
790129
function renderHeader(&$header)
    {
        $name = $header->getName();
        if (!empty($name) && isset($this->_templates[$name])) {
            $this->_html .= str_replace('{header}', $header->toHtml(), $this->_templates[$name]);
        } else {
            $this->_html .= str_replace('{header}', $header->toHtml(), $this->_headerTemplate);
        }
    }
1077279
protected function renderHeadHtml()
    {
        $lines = [];
        $lines[] = $this->head;
        $lines[] = '<head>';
        $lines[] = Html::tag('title', $this->title);
        if (!empty($this->metaTags)) {
            $lines[] = implode("\n", $this->metaTags);
        }
        if (!empty($this->linkTags)) {
            $lines[] = implode("\n", $this->linkTags);
        }
        if (!empty($this->cssFiles[self::POS_HEAD])) {
            $lines[] = implode("\n", $this->cssFiles[self::POS_HEAD]);
        }
        if (!empty($this->css)) {
            $lines[] = implode("\n", $this->css);
        }
        if (!empty($this->jsFiles[self::POS_HEAD])) {
            $lines[] = implode("\n", $this->jsFiles[self::POS_HEAD]);
        }
        if (!empty($this->js[self::POS_HEAD])) {
            $lines[] = Html::script(implode("\n", $this->js[self::POS_HEAD]), ['type' => 'text/javascript']);
        }
        $lines[] = '</head>';

        return empty($lines) ? '' : implode("\n", $lines);
    }
200599
public function header()
    {
        foreach ($this->headerElements as $element) {
            if ($element instanceof ReportBaseElement) {
                $element->render($this);
            } elseif ($element === 'footnotetexts') {
                $this->footnotes();
            } elseif ($element === 'addpage') {
                $this->newPage();
            }
        }

        foreach ($this->pageHeaderElements as $element) {
            if ($element instanceof ReportBaseElement) {
                $element->render($this);
            } elseif ($element === 'footnotetexts') {
                $this->footnotes();
            } elseif ($element === 'addpage') {
                $this->newPage();
            }
        }
    }
1275949
public function addCustomHeader($custom_header, $value = null) {
        if ($value === null and preg_match('/message-id:(.*)/i', $custom_header, $matches)) {
            $this->MessageID = trim($matches[1]);
            return true;
        } else if ($value !== null and strcasecmp($custom_header, 'message-id') === 0) {
            $this->MessageID = trim($value);
            return true;
        } else {
            return parent::addCustomHeader($custom_header, $value);
        }
    }
527709
@Override
    public void renderHead(final IHeaderResponse response) {
        // select bootstrap tab for current theme selected
        int selectedTab = this.getSelectedTab();
        response.render(OnDomReadyHeaderItem.forScript("$('#themes li:eq("
                + selectedTab + ") a').tab('show');"));
    }
650138
public function render($customAttributes = null)
    {
        if ($customAttributes != null && count($customAttributes) > 0) {
            $attributes = array_merge($this->attributes, $customAttributes);
        } else {
            $attributes = $this->attributes;

            if (count(MenuHelper::getConfig()->getAnchorElementClasses()) > 0) {
                if (!array_key_exists('class', $attributes)) {
                    $attributes['class'] = '';
                }

                foreach (MenuHelper::getConfig()->getAnchorElementClasses() as $listElementClass) {
                    $attributes['class'] .= ' ' . $listElementClass;
                }
            }
        }

        return Html::link($this->url, $this->title, $attributes);
    }
137066
public function renderHeaderCell()
	{
		if ($this->grid->json) {
			$header = array('id' => $this->id);
			$content = array();
			if ($this->grid->enableSorting && $this->sortable && $this->name !== null) {
				$sort = $this->grid->dataProvider->getSort();
				$label = isset($this->header) ? $this->header : $sort->resolveLabel($this->name);

				if ($sort->resolveAttribute($this->name) !== false) {
					$label .= '<span class="caret"></span>';
				}
				$content['content'] = $sort->link($this->name, $label, array('class' => 'sort-link'));
			} else {
				if ($this->name !== null && $this->header === null) {
					if ($this->grid->dataProvider instanceof CActiveDataProvider) {
						$content['content'] = CHtml::encode(
							$this->grid->dataProvider->model->getAttributeLabel($this->name)
						);
					} else {
						$content['content'] = CHtml::encode($this->name);
					}
				} else {
					$content['content'] = trim($this->header) !== '' ? $this->header
						: $this->grid->blankDisplay;
				}
			}
			return CMap::mergeArray($header, $content);
		}
		parent::renderHeaderCell();
	}
861079
public function render()
    {
        if ($this->report->fireEvent("OnBeforeWidgetRender", $this)) {
            $type=str_replace('\\', '/', get_class($this));
            echo "<krwidget widget-name='$this->name' widget-type='$type'"
                .($this->themeCssClass?" class='$this->themeCssClass'":"").">";
            $this->onRender();
            echo "</krwidget>";
        }
        $this->report->fireEvent("OnWidgetRender", $this);
    }