Get html option tag.

@param  string $url
@param  int $page
@return string
514543
protected function getOption($url, $page)
    {
        if ($page == $this->paginator->currentPage()) {
            return $this->getActiveOption($page);
        }

        return $this->getAvailableOption($url, $page);
    }
772198
public function getPrefix(Page $page)
    {
        $parent = $page->getParent();

        if ($parent === null) {
            return '';
        }

        return ($parent->getChildPageUrlPrefix()) ?: $page->getParent()->url()->getLocation();
    }
1036074
public function parse($url)
    {
        $this->_fixUrlForParsing($url);

        if (empty($url->path) && !isset($url->query['option'])) {
            $url->path = (get_viewer()->guest()) ? 'pages' : 'dashboard';
        }

        $segments = explode('/', trim($url->path, '/'));
        $segments = array_filter($segments);

        if (!empty($segments)) {
            $component = array_shift($segments);
            $url->query = array_merge(array('option' => 'com_'.$component), $url->query);
            $component = str_replace('com_', '', $url->query['option']);
            $query = $this->getComponentRouter($component)->parse($segments);
            $url->query = array_merge($url->query, array('option' => 'com_'.$component), $query);
        }

        return $url;
    }
1220163
protected function getLinkHtml($text, $page, $css)
    {
        $html = $this->buttonHtmlPattern;

        $html = str_replace('{href}', $this->getLinkHref($page), $html);
        $html = str_replace('{text}', $text, $html);
        $html = str_replace('{page}', $page, $html);
        $html = str_replace('{class}', $css, $html);

        if ($css == '') {
            $html = str_replace(' class=""', '', $html);
        }

        return $html;
    }
232358
public function getText(Page $page = null)
    {
        $texts = array();
        $pages = $this->getPages();

        foreach ($pages as $index => $page) {
            /**
             * In some cases, the $page variable may be null.
             */
            if (is_null($page)) {
                continue;
            }
            if ($text = trim($page->getText())) {
                $texts[] = $text;
            }
        }

        return implode("\n\n", $texts);
    }
374558
protected function _getPaginatedUrl($page)
    {
        $url = $this->_getSortUrl();

        if ($page > 1) {
            if (!isset($url['?'])) {
                $url['?'] = [];
            }
            $url['?']['p'] = $page;
        }

        return $url;
    }
323069
public function getPageUrl($page){
        $qs = '';
        if($_SERVER['QUERY_STRING']){
            $qs = '?' . $_SERVER['QUERY_STRING'];
        }//if
        return str_replace($this->fromFormat($this->currentPage),$this->fromFormat($page),$this->uri) . $qs;
    }
692166
public function tag($name, Array $options = array(), $content = null, $open = false)
    {
        if (!$name) {
            return '';
        }
        $htmlOptions = '';
        foreach ($options as $key => $value) {
            $htmlOptions .= ' ' . $key . '="' . \htmlspecialchars($value, \ENT_COMPAT) . '"';
        }
        if ($content !== null) {
            return '<' . $name . $htmlOptions . '>' . $content . '</' . $name . '>';
        } else {
            return '<' . $name . $htmlOptions . (($open) ? '>' : ' />');
        }
    }
1015758
protected function getHTML( $url )
	{
		$this->reader->setUrl( $url );
		try
		{
			$content	= $this->reader->read( array(
				'CURLOPT_FOLLOWLOCATION'	=> TRUE,
				'CURLOPT_COOKIEJAR'			=> 'cookies.txt', 
				'CURLOPT_COOKIEFILE'		=> 'cookies.txt'
			) );
			$contentType	= $this->reader->getInfo( 'content_type' );
			return $contentType === 'text/html' ? $content : '';
		}
		catch( RuntimeException $e )
		{
			$this->errors[$url]	= $e->getMessage();
			throw $e;
		}
	}
895250
public static function paginationLink($label, $url, $htmlOptions = array())
    {
        $linkOptions = TbArray::popValue('linkOptions', $htmlOptions, array());
        if (TbArray::popValue('active', $htmlOptions, false)) {
            self::addCssClass('active', $htmlOptions);
            $label .= ' ' . self::tag('span', array('class' => 'sr-only'), '(current)');
        }
        if (TbArray::popValue('disabled', $htmlOptions, false)) {
            self::addCssClass('disabled', $htmlOptions);
        }
        $content = self::link($label, $url, $linkOptions);
        return self::tag('li', $htmlOptions, $content);
    }
801929
public static function page($page = null)
    {
        if ($page !== null) {
            self::$_page = $page;
        }
        return self::$_page;
    }
312112
protected function getPaginationHtml($url = '?', $style = 0, $cssClass = null, $replaceClass = false)
    {
        return $this->pagination->getPaginationHtml($url, $style, $cssClass, $replaceClass);
    }
1243784
public function javascriptTag($contentOrOptionWithBlock, $htmlOptions = null)
    {
        if ($contentOrOptionWithBlock instanceof \Closure) {
            ob_start();
            $contentOrOptionWithBlock();
            $contents = ob_get_clean();
            $htmlOptions = [];
        } elseif ($htmlOptions instanceof \Closure) {
            ob_start();
            $htmlOptions();
            $contents = ob_get_clean();
            $htmlOptions = $contentOrOptionWithBlock;
        } elseif (is_string($contentOrOptionWithBlock)) {
            $contents = $contentOrOptionWithBlock;
            if (!is_array($htmlOptions)) {
                $htmlOptions = [];
            }
        }
        
        return $this->contentTag('script', $contents, $htmlOptions);
    }
213619
protected function html(Page $page)
    {
        $html = $this->content->make($content = $page->content());

        if (($name = $page->layout()) !== null) {
            $data = array_merge($this->helpers(), (array) $page->data());

            $layout = new Layout($this->renderer, $this, $data);

            $html = (string) $layout->render($name, (string) $content);
        }

        foreach ($this->filters as $filter) {
            $html = $filter->filter($html);
        }

        return $html;
    }
887485
protected function getPageLinkWrapper($url, $page, $rel = null)
    {
        if ($page == '&laquo;') {
            return $this->getPreviousPageWrapper($url, $page, $rel);
        }

        return $this->getNextPageWrapper($url, $page, $rel);
    }
1344694
public function generateXmlString(Parts\Page $page)
    {
        $dom = new DOMDocument('1.0', 'utf-8');
        $dom->formatOutput = true;
        $dom->loadXML('<page />');

        $pageNode = $dom->documentElement;

        foreach ($page->getState() as $attrName => $attrValue) {
            switch ($attrName) {
                case 'id':
                    $pageNode->setAttribute('id', $attrValue);
                    break;
                case 'zones':
                    foreach ($page->{$attrName} as $zone) {
                        $pageNode->appendChild($this->generateZoneXmlString($zone, $dom));
                    }
                    break;
                case 'layout':
                    $node = $dom->createElement('zone_layout', $attrValue);
                    $pageNode->appendChild($node);
                    break;
                case 'attributes':
                    foreach ($attrValue as $arrayItemKey => $arrayItemValue) {
                        $this->addNewXmlElement($dom, $pageNode, $arrayItemKey, $arrayItemValue);
                    }
                    break;
                case 'zonesById':
                    // Do not store
                    break;
                default:
                    $this->addNewNotEmptyXmlElement($dom, $pageNode, $attrName, $attrValue);
                    break;
            }
        }

        return $dom->saveXML();
    }
674425
public function loadHtml($html, $options = null)
    {
        return $this->load($html, false, Document::TYPE_HTML, $options);
    }