Return HTML code depending on current URL

@return string
559185
public function getHtml()
    {
        $sUrl = $this->oxmediaurls__oxurl->value;
        //youtube link
        if (strpos($sUrl, 'youtube.com') || strpos($sUrl, 'youtu.be')) {
            return $this->_getYoutubeHtml();
        }

        //simple link
        return $this->getHtmlLink();
    }
1063323
public static function absoluteURLs($html)
    {
        $html = str_replace('$CurrentPageURL', Controller::curr()->getRequest()->getURL(), $html);
        return HTTP::urlRewriter($html, function ($url) {
            //no need to rewrite, if uri has a protocol (determined here by existence of reserved URI character ":")
            if (preg_match('/^\w+:/', $url)) {
                return $url;
            }
            return Director::absoluteURL($url, true);
        });
    }
240998
public static function currentPageURL()
    {
        $pageURL = 'http';
        if ($_SERVER["HTTPS"] == "on") {
            $pageURL .= "s";
        }
        $pageURL .= "://";
        if ($_SERVER["SERVER_PORT"] != "80") {
            $pageURL .= $_SERVER["SERVER_NAME"] . ":" . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"];
        } else {
            $pageURL .= $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];
        }
        $pageURL = str_replace('?live', '?', $pageURL);
        $pageURL = str_replace('&live', '', $pageURL);

        return $pageURL;
    }
501822
public function getHtml(): string
  {
    $html = $this->prefix;
    $html .= Html::generateTag('span', $this->attributes);

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

      foreach ($this->options as $option)
      {
        $inputAttributes = $this->inputAttributes($option);
        $labelAttributes = $this->labelAttributes($option);

        $labelAttributes['for'] = $inputAttributes['id'];

        $key         = $option[$this->keyKey];
        $keyAsString = Cast::toManString($key, '');
        $value       = ($this->optionsObfuscator) ? $this->optionsObfuscator->encode(Cast::toOptInt($key)) : $key;

        $inputAttributes['value']   = $value;
        $inputAttributes['checked'] = ($valueAsString===$keyAsString);

        $html .= Html::generateVoidElement('input', $inputAttributes);

        $html .= $this->labelPrefix;
        $html .= Html::generateElement('label',
                                       $labelAttributes,
                                       Cast::toOptString($option[$this->labelKey]),
                                       $this->labelIsHtml);
        $html .= $this->labelPostfix;
      }
    }

    $html .= '</span>';
    $html .= $this->postfix;

    return $html;
  }
919474
public function feed_or_html()
	{
		$len = strlen($this->file->body);
		$pos = strspn($this->file->body, "\x09\x0A\x0D\x20\xEF\xBB\xBF");

		while ($pos < $len)
		{
			switch ($this->file->body[$pos])
			{
				case "\x09":
				case "\x0A":
				case "\x0D":
				case "\x20":
					$pos += strspn($this->file->body, "\x09\x0A\x0D\x20", $pos);
					continue 2;

				case '<':
					$pos++;
					break;

				default:
					return 'text/html';
			}

			if (substr($this->file->body, $pos, 3) === '!--')
			{
				$pos += 3;
				if ($pos < $len && ($pos = strpos($this->file->body, '-->', $pos)) !== false)
				{
					$pos += 3;
				}
				else
				{
					return 'text/html';
				}
			}
			elseif (substr($this->file->body, $pos, 1) === '!')
			{
				if ($pos < $len && ($pos = strpos($this->file->body, '>', $pos)) !== false)
				{
					$pos++;
				}
				else
				{
					return 'text/html';
				}
			}
			elseif (substr($this->file->body, $pos, 1) === '?')
			{
				if ($pos < $len && ($pos = strpos($this->file->body, '?>', $pos)) !== false)
				{
					$pos += 2;
				}
				else
				{
					return 'text/html';
				}
			}
			elseif (substr($this->file->body, $pos, 3) === 'rss'
				|| substr($this->file->body, $pos, 7) === 'rdf:RDF')
			{
				return 'application/rss+xml';
			}
			elseif (substr($this->file->body, $pos, 4) === 'feed')
			{
				return 'application/atom+xml';
			}
			else
			{
				return 'text/html';
			}
		}

		return 'text/html';
	}
1044287
protected function getHtml()
    {
        array_walk($this->lines, 'trim');
        $html = trim(implode('', $this->lines));
        $this->lines = [];
        return $html;
    }
19635
public function getCode() : ?string 
    {
        if ( ! $this->hasCode()) {
            $this->setCode($this->getDefaultCode());
        }
        return $this->code;
    }
1176463
public function buildCode()
	{
		$select		= UI_HTML_Elements::Select( $this->name, $this->options, $this->class );
		return $select;
	}
1072193
protected function currentUrlMatches()
    {
        if ($this->url() == Request::url()) { // If URLs are equal, always return true
            return true;
        }

        if ($this->activeUrlPattern) { // If pattern was set, see if it matches
            $pattern = ltrim(preg_replace('/\/\*/', '(/.*)?', $this->activeUrlPattern), '/');
            return preg_match("@^{$pattern}\z@", Request::path());
        }

        return false; // No match
    }
1203742
protected function parseLink():self
	{
		return $this->setMultinameAttribute('link',$this->sectionLedBy('@',true),function( string$link ){
			if( isset($this->config['target']) && ':'===$link{0} ){
				return 'javascript'.$link;
			}elseif( '//'===($firstTwoLetters=substr($link,0,2)) ){
				return 'http:'.$link;
			}elseif( '\\\\'===$firstTwoLetters ){
				return 'https://'.substr($link,2);
			}else{
				return $this->checkExpression($link);
			}
		});
	}
1013791
public function detectUrlDetails()
    {
        $escapedPathPrefix = Text::escapeForRegex($this->config->getPathPrefix());
        $languages = implode('|', $this->translate->getLanguages());

        $fullUrl = preg_replace('#' . $escapedPathPrefix . '\/(' . $languages . ')$#i', '', $this->getUrl());
        $fullUrl = preg_replace('#' . $escapedPathPrefix . '\/(' . $languages . ')\/#i', '/', $fullUrl);

        $parsed = parse_url($fullUrl);

        $this->host = $parsed['scheme'] . '://' . $parsed['host'] . (isset($parsed['port']) ? ':'.$parsed['port'] : '');
        $this->path = isset($parsed['path']) ? $parsed['path'] : '/';
        $this->query = isset($parsed['query']) ? $parsed['query'] : null;

        if (preg_match('#^' .$this->config->getPathPrefix(). '#i', $this->path)) {
            $this->path = preg_replace('#^' .$this->config->getPathPrefix(). '#i', '', $this->path);
        }

        if ($this->path === "") {
            $this->path = '/';
        }

        $url = $this->getHost() . $this->getPathPrefix() . $this->getPath();
        if (!is_null($this->getQuery())) {
            $url .= '?'. $this->getQuery();
        }
        return $url;
    }
743489
public function getCode()
    {
        $html = $this->form;

        if ($this->meta->checks['honeypots'])
        {
            $html = $this->createHoneypots($html, $this->honeypots);
        }

        $botoborData =
            '<div style="display: none;">' .
            $this->createInput('hidden', Botobor::META_FIELD_NAME, $this->meta->getEncoded()) .
            '</div>';

        $html = preg_replace('/(<form[^>]*>)/si', '$1'.$botoborData, $html);

        return $html;
    }
1008943
protected function getRegexp()
	{
		$anchor = RegexpBuilder::fromList($this->configurator->urlConfig->getAllowedSchemes()) . '://';
		if ($this->matchWww)
		{
			$anchor = '(?:' . $anchor . '|www\\.)';
		}

		$regexp = '#\\b' . $anchor . '\\S(?>[^\\s()\\[\\]'
		        . '\\x{FF01}-\\x{FF0F}\\x{FF1A}-\\x{FF20}\\x{FF3B}-\\x{FF40}\\x{FF5B}-\\x{FF65}'
		        . ']|\\([^\\s()]*\\)|\\[\\w*\\])++#Siu';

		return $regexp;
	}
1231923
protected function currentUrl()
    {
        if (isset(static::$static[__FUNCTION__])) {
            return static::$static[__FUNCTION__];
        }
        $url = $this->currentUrlScheme().'://';
        $url .= $this->currentUrlHost();
        $url .= $this->currentUrlUri();

        return static::$static[__FUNCTION__] = $url;
    }
737097
public function getHtml(): string
  {
    $ret = $this->prefix;
    foreach ($this->controls as $control)
    {
      $ret .= $control->getHtml();
    }
    $ret .= $this->postfix;

    return $ret;
  }
200098
public static function getCurrentUrl(): string
    {
        $siteUrl = self::getSiteUrl();
        
        $request = self::getServerVariable('REQUEST_URI', self::getServerVariable('PHP_SELF', ''));
        $query = self::getQueryString();
        
        $indexPhpFound = strpos($request, INDEX_FILE);
        if (!USE_INDEX_FILE && ($indexPhpFound === 0 || $indexPhpFound === 1)) {
            // remove index.php
            $request = str_replace(INDEX_FILE, '', $request);
        }
        
        $currentUrl = $siteUrl . $request;
        if (!empty($query) && strpos($request, $query) === false) {
            $currentUrl .= '?' . $query;
        }
        
        return preg_replace("#([^:])//+#", "$1/", $currentUrl);
    }
1190495
public function getHtml(){
		if( !$this->response )
			throw new RuntimeException( 'No conversion started' );
		$cacheKey	= 'premailer_'.$this->response->requestId.'.html';
		if( $this->cache && $this->cache->has( $cacheKey ) )
			return $this->cache->get( $cacheKey );
		$html	= Net_Reader::readUrl( $this->response->documents->html );
		$this->cache && $this->cache->set( $cacheKey, $html );
		return $html;
	}