@param string $url
@param string $type
@param string $media
@param array  $attribs

@return \JDocument
@author Maximilian Ruta <mr@xtain.net>
432863
public function addStyleSheet($url, $type = 'text/css', $media = null, $attribs = [])
    {
        $url = $this->patchUrl($url);

        return parent::addStyleSheet($url, $type, $media, $attribs);
    }
1009426
protected function _renderTag($attribs = array(), $content = null)
    {
        unset($attribs['content']);
        unset($attribs['separator']);

        $attribs = $this->buildAttributes($attribs);

        if($this->getConfig()->escape) {
            $content = $this->getTemplate()->escape($content);
        }

        $html = '<title '.$attribs.'>'.$content.'</title>'."\n";
        return $html;
    }
14574
protected function _renderTag($attribs = array(), $content = null)
    {
        if($this->getTemplate()->decorator() == 'joomla')
        {
            $link      = isset($attribs['src']) ? $attribs['src'] : false;
            $condition = isset($attribs['condition']) ? $attribs['condition'] : false;

            if(!$link)
            {

                $hash  = md5($content.serialize($attribs));

                if (!isset($this->_loaded[$hash]))
                {
                    JFactory::getDocument()->addStyleDeclaration($content);
                    $this->_loaded[$hash] = true;
                }
            }
            else
            {
                if($condition)
                {
                    $style = parent::_renderTag($attribs, $content);
                    JFactory::getDocument()->addCustomTag($style);
                }
                else
                {
                    unset($attribs['src']);
                    unset($attribs['condition']);

                    JFactory::getDocument()->addStyleSheet($link, 'text/css', null, $attribs);
                }
            }
        }
        else return parent::_renderTag($attribs, $content);
    }
253274
protected function _renderTag($attribs = array(), $content = null)
    {
        if($this->getTemplate()->decorator() == 'joomla')
        {
            $link      = isset($attribs['href']) ? $attribs['href'] : false;
            $relType  = 'rel';
            $relValue = $attribs['rel'];
            unset($attribs['rel']);
            unset($attribs['href']);

            JFactory::getDocument()->addHeadLink($link, $relValue, $relType, $attribs);
        }
        else return parent::_renderTag($attribs, $content);
    }
50107
private static function convertDistEntry(array &$value, $type, $url)
    {
        $httpPrefix = 'http://';

        if (0 === strpos($url, $httpPrefix)) {
            $url = 'https://'.substr($url, \strlen($httpPrefix));
        }

        if ('shasum' === $type) {
            $value[$type] = $url;
        } elseif ('tarball' === $type) {
            $value['type'] = 'tar';
            $value['url'] = $url;
        } elseif (\in_array($type, self::getDownloaderTypes(), true)) {
            $value['type'] = $type;
            $value['url'] = $url;
        }
    }
35614
public function getBuffer($type = null, $name = null, $attribs = array())
	{
		// If no type is specified, return the whole buffer
		if ($type === null)
		{
			return parent::$_buffer;
		}

		$result = null;
		if (isset(parent::$_buffer[$type][$name]))
		{
			return parent::$_buffer[$type][$name];
		}

		// If the buffer has been explicitly turned off don't display or attempt to render
		if ($result === false)
		{
			return null;
		}

		$renderer = $this->loadRenderer($type);

		$this->setBuffer($renderer->render($name, $attribs, $result), $type, $name);

		return parent::$_buffer[$type][$name];
	}
963421
public function generateUrl($type, $email, array $attr = [])
    {
        if (!empty($email)) {
            $this->setEmail($email);
        }

        if (isset($attr['size'])) {
            $this->setSize($attr['size']);
        }

        if (isset($attr['imgset'])) {
            $this->setImageSet($attr['imgset']);
        }

        if (isset($attr['rating'])) {
            $this->setRating($attr['rating']);
        }

        $uri = '?';
        $ignore = ['email', 'hash', 'secure'];
        foreach ($this->_options as $k => $v) {
            if (!in_array($k, $ignore)) {
                $uri .= $k.'='.$v.'&';
            }
        }
        $uri = rtrim($uri, '&');

        $base = (($this->_options['secure']) ? self::BASE_HTTPS : self::BASE_HTTP);

        switch (strtolower($type)) {
        case 'avatar':
            $url = $base.'avatar/';
            break;
        case 'profile':
            $url = $base;
            break;
        default:
            throw new \Exception('Invalid URL type given! Must be avatar or profile!');
        }

        return $url.$this->getHash();
    }
570110
public function addScript($url, $type = "text/javascript", $defer = false, $async = false)
    {
        $url = $this->patchUrl($url);

        return parent::addScript($url, $type, $defer, $async);
    }
285828
public function addMediaFromUrl(string $url, ...$allowedMimeTypes)
    {
        if (! $stream = @fopen($url, 'r')) {
            throw UnreachableUrl::create($url);
        }

        $temporaryFile = tempnam(sys_get_temp_dir(), 'media-library');
        file_put_contents($temporaryFile, $stream);

        $this->guardAgainstInvalidMimeType($temporaryFile, $allowedMimeTypes);

        $filename = basename(parse_url($url, PHP_URL_PATH));
        $filename = str_replace('%20', ' ', $filename);

        if ($filename === '') {
            $filename = 'file';
        }

        $mediaExtension = explode('/', mime_content_type($temporaryFile));

        if (! str_contains($filename, '.')) {
            $filename = "{$filename}.{$mediaExtension[1]}";
        }

        return app(FileAdderFactory::class)
            ->create($this, $temporaryFile)
            ->usingName(pathinfo($filename, PATHINFO_FILENAME))
            ->usingFileName($filename);
    }
1039495
public function appendAlternate($href, $type, $title, $media = null, $conditional = '')
    {
        return $this->_setAlternate($href, $type, $title, $media, true, $conditional);
    }
1042585
public static function link($url, $body = null, $attribs = array())
    {
        $body = (is_null($body)) ? $url : $body;
        $attribs['href'] = $url;
        return self::tag('a', $body, $attribs);
    }
1101016
public static function make(string $type, string $message, string $url = null) : ResponseHelper {
        return new static($type, $message, $url);
    }
827828
public function request_form($attrib, $content = '')
    {
        $hidden = new html_hiddenfield();
        if ($attrib['task']) {
            $hidden->add(array('name' => '_task', 'value' => $attrib['task']));
        }
        if ($attrib['action']) {
            $hidden->add(array('name' => '_action', 'value' => $attrib['action']));
        }

        // we already have a <form> tag
        if ($attrib['form']) {
            if ($this->framed || $this->env['framed']) {
                $hidden->add(array('name' => '_framed', 'value' => '1'));
            }

            return $hidden->show() . $content;
        }

        unset($attrib['task'], $attrib['request']);
        $attrib['action'] = './';

        return $this->form_tag($attrib, $hidden->show() . $content);
    }
1195103
public function addEnclosure($url, $type = '', $length = '')
    {
        if (!$this->offsetExists('enclosure')) {
            $enclosure = array();
        } else {
            $enclosure = $this->offsetGet('enclosure');
        }
        $enclosure[] = array('url' => $url,
                             'type' => $type,
                             'length' => $length);
        $this->offsetSet('enclosure', $enclosure);
        return $this;
    }
1254629
protected function message_container($attrib)
    {
        if (isset($attrib['id']) === false) {
            $attrib['id'] = 'rcmMessageContainer';
        }

        $this->add_gui_object('message', $attrib['id']);

        return html::div($attrib, '');
    }
969110
public function mediaList($type, $offset = 0, $count = 20) {
        return $this->getMediaList()->parameters([
            'type' => $type,
            'offset' => $offset,
            'count' => $count
        ])->json();
    }
416649
public function addCss($relativeUrl, string $media = null, string $moduleNamespace = null, bool $prepend = false,
			array $attrs = null, $target = self::TARGET_HEAD) {
		if ($moduleNamespace === null) {
			$moduleNamespace = $this->view->getModuleNamespace();
		}
		
		$this->addCssUrl($this->view->getHttpContext()->getAssetsUrl($moduleNamespace)->ext($relativeUrl),
				$media, $prepend, $attrs, $target);
		
		return $this;
	}