Get HTML code for a element.

@return string HTML code for the element.

@SuppressWarnings(PHPMD.UnusedLocalVariable)
5641
public function getHTML()
    {
        $details = $this->getHTMLDetails();
        extract($details);

        $ret = null;
        foreach ($this['values'] as $val) {
            $id .= $val;
            $item = $onlyValue  = htmlentities($val, ENT_QUOTES, $this->characterEncoding);
            $value = " value='{$onlyValue}'";
            $checked = isset($this['checked']) && $val === $this['checked']
                ? " checked='checked'"
                : null;

            $ret .= <<<EOD
<{$wrapperElement}{$wrapperClass}>
    <input id='$id'{$type}{$class}{$name}{$value}{$autofocus}{$readonly}{$checked}{$title} />
    <label for='$id'>$item</label>
    {$messages}
</{$wrapperElement}>
EOD;
        }

        return <<<EOD
<{$wrapperElement}{$wrapperClass}>
<p class='cf-label'>{$label}</p>
{$ret}
<p class='cf-desc'>{$description}</p>
</{$wrapperElement}>
EOD;
    }
846074
public function getInputHtml()
    {
        $this->rule->setElementName($this->element->getName());

        if ($this->element->getValue()) {
            /* Hack : reload in a new instance to have element name set.
             *        can not be done in afterLoad of the backend model
             *        since we do not know yet the form structure
             */
            $conditions = $this->element->getValue();
            if (!is_array($conditions)) {
                $conditions = $conditions->getConditions()->asArray();
            }
            $this->rule->getConditions()->loadArray($conditions);
            $this->element->setRule($this->rule);
        }

        $this->input = $this->elementFactory->create('text');
        $this->input->setRule($this->rule)->setRenderer($this->conditions);

        $this->setConditionFormName($this->rule->getConditions(), $this->getElement()->getContainer()->getHtmlId());

        if (is_array($this->getData('url_params'))) {
            $this->setConditionUrlParams($this->rule->getConditions(), $this->getData('url_params'));
        }

        return $this->input->toHtml();
    }
546567
public function getElementId()
    {
        if (null === $this->elementId && null !== $this->element) {
            $this->elementId = $this->element->id;
        }

        return $this->elementId;
    }
43347
public function innerHtml()
    {
        if ( ! $this->hasChildren()) {
            // no children
            return '';
        }

        if ( ! is_null($this->innerHtml)) {
            // we already know the result.
            return $this->innerHtml;
        }

        $child  = $this->firstChild();
        $string = '';

        // continue to loop until we are out of children
        while ( ! is_null($child)) {
            if ($child instanceof TextNode) {
                $string .= $child->text();
            } elseif ($child instanceof HtmlNode) {
                $string .= $child->outerHtml();
            } else {
                throw new UnknownChildTypeException('Unknown child type "'.get_class($child).'" found in node');
            }

            try {
                $child = $this->nextChild($child->id());
            } catch (ChildNotFoundException $e) {
                // no more children
                $child = null;
            }
        }

        // remember the results
        $this->innerHtml = $string;

        return $string;
    }
386045
public function getElementId()
    {
        $id = $this->getAttribute('elementId');
        if (null === $id && null !== $this->element) {
            $id = $this->elementId = $this->element->id;
        }

        return $id;
    }
630432
public function getHTML()
    {
        $this->cb->set(function () {

            // if virtual page callback is triggered
            if ($type = $this->cb->triggered()) {

                // process callback
                if ($this->fx) {
                    call_user_func($this->fx, $this);
                }

                // special treatment for popup
                if ($type == 'popup') {
                    $this->app->html->template->set('title', $this->app->title);
                    $this->app->html->template->setHTML('Content', parent::getHTML());
                    $this->app->html->template->appendHTML('HEAD', $this->getJS());

                    $this->app->terminate($this->app->html->template->render());
                }

                // render and terminate
                if (isset($_GET['json'])) {
                    $this->app->terminate($this->renderJSON());
                }

                // do not terminate if callback supplied (no cutting)
                if ($type != 'callback') {
                    $this->app->terminate($this->render());
                }
            }

            // Remove all elements from inside the Content
            foreach ($this->app->layout->elements as $key => $view) {
                if ($view instanceof View && $view->region == 'Content') {
                    unset($this->app->layout->elements[$key]);
                }
            }

            $this->app->layout->template->setHTML('Content', parent::getHTML());
            $this->app->layout->_js_actions = array_merge($this->app->layout->_js_actions, $this->_js_actions);

            $this->app->html->template->setHTML('Content', $this->app->layout->getHTML());
            $this->app->html->template->appendHTML('HEAD', $this->app->layout->getJS());

            $this->app->terminate($this->app->html->template->render());
        });
    }
1314008
public function getHtmlContent()
    {
        if ($this->htmlContent === null) {
            try {
                if (($content = $this->getContent()) === '') {
                    return $this->htmlContent = false;
                }

                $errors = libxml_use_internal_errors(true);
                $this->htmlContent = new \DOMDocument();

                if ((mb_detect_encoding($content) === 'UTF-8') && mb_check_encoding($content, 'UTF-8')) {
                    $content = mb_convert_encoding($content, 'HTML-ENTITIES', 'UTF-8');
                    $content = preg_replace('/<head[^>]*>/', '<head><META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">', $content);
                }

                //Remove all script elements, CDATA sections and comments (thanks https://github.com/jasny)
                //$content = preg_replace(['%<!--(?:[^-]++|-)*?-->|<!\[CDATA\[(?:[^\]]++|\])*?\]\]>%si', '%<script\b(?:"(?:[^"\\\\]++|\\\\.)*+"|\'(?:[^\'\\\\]++|\\\\.)*+\'|[^>"\']++)*>(?:[^<]++|<)*?</\s*script\s*>%si'], '', $content);

                $this->htmlContent->loadHTML($content);
                libxml_use_internal_errors($errors);
            } catch (\Exception $E) {
                return $this->htmlContent = false;
            }
        }

        return $this->htmlContent;
    }
58335
protected function getLabel()
	{
		// Initialise variables.
		$label = '';

		if ($this->hidden)
		{
			return $label;
		}

		// Get the label text from the XML element, defaulting to the element name.
		$text = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name'];
		$text = $this->translateLabel ? Lang::txt($text) : $text;

		// Build the class for the label.
		$class = !empty($this->description) ? 'hasTip' : '';
		$class = $this->required == true ? $class . ' required-field' : $class;
		$class = !empty($this->labelClass) ? $class . ' ' . $this->labelClass : $class;

		// Add the opening label tag and main attributes attributes.
		$label .= '<label id="' . $this->id . '-lbl" for="' . $this->id . '" class="' . $class . '"';

		// If a description is specified, use it to build a tooltip.
		if (!empty($this->description))
		{
			$label .= ' title="'
				. htmlspecialchars(
				trim($text, ':') . '::' . ($this->translateDescription ? Lang::txt($this->description) : $this->description),
				ENT_COMPAT, 'UTF-8'
			) . '"';
		}

		// Add the label text and closing tag.
		if ($this->required)
		{
			$label .= '>' . $text . ' <span class="required star">' . Lang::txt('JOPTION_REQUIRED'). '</span></label>';
		}
		else
		{
			$label .= '>' . $text . '</label>';
		}

		return $label;
	}
723886
public function getHtml()
    {
        if (!$this->exists()) {
            return '';
        }
        switch ($this->type) {
            case 'datetime':
                $html = '<abbr title="'.$this->content->format('c').'">'
                    .(class_exists('WebSyndication\Helper') ?
                        \WebSyndication\Helper::getLocalizedDateString($this->content) : $this->content->format('D j m Y H:i:s')
                    ).'</abbr>';
                break;
            case 'time':
                $html = $this->content->format('H:i:s');
                break;
            case 'email':
                $html = '<a href="mailto:'.$this->content.'" title="Contact this email">'.$this->content.'</a>';
                break;
            case 'url':
                $html = '<a href="'.$this->content.'" title="See online">'.$this->content.'</a>';
                break;
            case 'text':
                $html = $this->xml_value;
                break;
            case 'lang':
                $html = '<abbr title="ISO : '.$this->xml_value.'">'.$this->content.'</abbr>';
                break;
            case 'list':
                $html = '';
                foreach ($this->content as $_ctt) {
                    $html .= (strlen($html) ? ', ' : '').$_ctt->content;
                }
                break;
            default:
                $html = $this->content;
                break;
        }
        return $html;
    }
602902
public function getHTML()
    {
        $isadmin = $this->sess['isadmin'] == 1 ? true : false;

        $del = $this->setUrlCreator("comm/delete");
        $commpage = $this->setUrlCreator("comm");
        
        $htmlcomment = $this->getLoginurl();
        $edit = $this->getEdit($isadmin, $this->comment->userid, $this->comment->id, $htmlcomment);
        $delete = $this->getDelete($isadmin, $this->comment->userid, $del, $this->comment->id);

        $text = '<h3>Kommentarer</h3>';

        if ($this->comments) {
            foreach ($this->comments as $value) {
                $can = $this->getCanEdit($value, $isadmin, $del);
                $text .= $this->getValHtml($value, $can);
            }
        }

        $html = '<div class="col-sm-12 col-xs-12"><div class="col-lg-4 col-sm-7 col-xs-7 abookimg">';
        $html .= $this->getDecode($this->comment, true);
        $html .= '<br />' . $edit;
        $html .=  $delete;
        $html .=  '<p><a href="' . $commpage . '">Till Alla Inläggen</a></p>';
        $html .=  '</div><div class="col-sm-5 col-xs-5">';
        $html .= $text;
        $html .= '</div></div>';
        return $html;
    }
412638
public function getHtml(): string
  {
    $this->attributes['name'] = $this->submitName;

    $html = $this->prefix;
    $html .= $this->getHtmlPrefixLabel();
    $html .= Html::generateElement('textarea', $this->attributes, Cast::toOptString($this->value));
    $html .= $this->getHtmlPostfixLabel();
    $html .= $this->postfix;

    return $html;
  }
781762
public function getHtml(): string
  {
    $this->attributes['type'] = $this->buttonType;
    $this->attributes['name'] = $this->submitName;

    if ($this->formatter) $this->attributes['value'] = $this->formatter->format($this->value);
    else                  $this->attributes['value'] = $this->value;

    $ret = $this->prefix;
    $ret .= $this->getHtmlPrefixLabel();
    $ret .= Html::generateVoidElement('input', $this->attributes);
    $ret .= $this->getHtmlPostfixLabel();
    $ret .= $this->postfix;

    return $ret;
  }
122425
protected function getLabel()
	{
		$html = array();
		$class = $this->element['class'] ? (string) $this->element['class'] : '';

		$html[] = '<span class="spacer">';
		$html[] = '<span class="before"></span>';
		$html[] = '<span class="' . $class . '">';

		if ((string) $this->element['hr'] == 'true')
		{
			$html[] = '<hr class="' . $class . '" />';
		}
		else
		{
			$label = '';

			// Get the label text from the XML element, defaulting to the element name.
			$text = $this->element['label'] ? (string) $this->element['label'] : (string) $this->element['name'];
			$text = $this->translateLabel ? $this->getText()->translate($text) : $text;

			// Build the class for the label.
			$class = !empty($this->description) ? 'hasTip' : '';
			$class = $this->required == true ? $class . ' required' : $class;

			// Add the opening label tag and main attributes attributes.
			$label .= '<label id="' . $this->id . '-lbl" class="' . $class . '"';

			// If a description is specified, use it to build a tooltip.
			if (!empty($this->description))
			{
				$label .= ' title="'
					. htmlspecialchars(
					trim($text, ':') . '::' . ($this->translateDescription ? $this->getText()->translate($this->description) : $this->description),
					ENT_COMPAT, 'UTF-8'
				) . '"';
			}

			// Add the label text and closing tag.
			$label .= '>' . $text . '</label>';
			$html[] = $label;
		}

		$html[] = '</span>';
		$html[] = '<span class="after"></span>';
		$html[] = '</span>';

		return implode('', $html);
	}
756715
public function getHtml(): string
  {
    $this->attributes['name'] = $this->submitName;

    $html = $this->prefix;
    $html .= $this->getHtmlPrefixLabel();
    $html .= Html::generateTag('select', $this->attributes);

    // Normalize current value as a string.
    $valueAsString = Cast::toManString($this->value, '');

    // Add an empty option, if necessary.
    if ($this->emptyOption!==null)
    {
      $optionAttributes = ['value'    => $this->emptyOption,
                           'selected' => ($valueAsString===Cast::toManString($this->emptyOption, ''))];

      $html .= Html::generateElement('option', $optionAttributes, ' ');
    }

    if (is_array($this->options))
    {
      foreach ($this->options as $option)
      {
        $optionAttributes = $this->optionAttributes($option);

        // Get the (database) key of the option.
        $key         = $option[$this->keyKey];
        $keyAsString = Cast::toManString($key, '');

        // If an obfuscator is installed compute the obfuscated code of the (database) ID.
        $code = ($this->optionsObfuscator) ? $this->optionsObfuscator->encode(Cast::toOptInt($key)) : $keyAsString;

        $optionAttributes['value']    = $code;
        $optionAttributes['selected'] = ($valueAsString===$keyAsString);

        $html .= Html::generateElement('option', $optionAttributes, Cast::toOptString($option[$this->labelKey]));
      }
    }

    $html .= '</select>';
    $html .= $this->getHtmlPostfixLabel();
    $html .= $this->postfix;

    return $html;
  }
595839
public function getHtml()
    {
        $html = new Core\Tag(
            'html',
            array((isset($this->args[1]) ? $this->args[1] : null)),
            array('generate', 'start')
        );
        $html->setAttrs($this->htmlattrs);

        return $html;
    }
569106
public function getHtml(): string
    {
        return $this->environment->render($this->template, ValueUtils::val($this->context));
    }
52672
public static function getHTML() {
        $classes = PageHead::getInstance()->getBodyCssClasses();
		return self::getHead() . '<body' . ($classes ? ' class="' . implode(' ', $classes) . '"' : '') . '>' . self::getBody() . self::getTail() . '</body></html>';
	}