Builds List Item of Pagination Link.
@access		protected
@param		string		$text			Text or HTML of Paging Button Span
@param		string		$class			Additive Style Class of Paging Button Span
@return		string
976332
protected function buildItem( $text, $class = NULL )
	{
		$list	= array();
		if( $class )
			$list[]	= $class;
		$item	= UI_HTML_Elements::ListItem( $text, 0, array( 'class' => $class ) );
		return $item;
	}
984753
public function addElementsClass($class) {
		foreach ($this->getElements() as $element) {
			if ($element instanceof Tag) {
				$element->addClass($class);
			}
		}
		
		return $this;
	}
927032
public function getByType($class)
    {
        $class = array_map('strtolower', (array)$class);

        $out = array_filter($this->_items, function ($assoc) use ($class) {
            list(, $name) = namespaceSplit(get_class($assoc));

            return in_array(strtolower($name), $class, true);
        });

        return array_values($out);
    }
297466
public function setListItemCssClass($class)
    {
        if (!is_string($class)) {
            throw new \InvalidArgumentException(
                'Breadcrumbs::setListItemCssClass() only accepts strings, but '
                . (is_object($class) ? get_class($class) : gettype($class))
                . ' given: ' . print_r($class, true)
            );
        }

        $this->listItemCssClass = $class;

        return $this;
    }
1146713
public function asHtml($text)
    {
        $stream = StreamFactory::string($text);
        return new Response($stream, self::OK, ['Content-Type' => 'text/html']);
    }
1118916
public static function linkify($text)
    {
        $text = preg_replace('/&apos;/', '&#39;', $text); // IE does not handle &apos; entity!
        $section_html_pattern = '%# Rev:20100913_0900 github.com/jmrware/LinkifyURL
            # Section text into HTML <A> tags  and everything else.
              (                             # $1: Everything not HTML <A> tag.
                [^<]+(?:(?!<a\b)<[^<]*)*     # non A tag stuff starting with non-"<".
              |      (?:(?!<a\b)<[^<]*)+     # non A tag stuff starting with "<".
             )                              # End $1.
            | (                             # $2: HTML <A...>...</A> tag.
                <a\b[^>]*>                   # <A...> opening tag.
                [^<]*(?:(?!</a\b)<[^<]*)*    # A tag contents.
                </a\s*>                      # </A> closing tag.
             )                              # End $2:
            %ix';

        return preg_replace_callback($section_html_pattern, array(__CLASS__, 'linkifyCallback'), $text);
    }
403411
public function getTemplateForClass($class)
    {
        foreach (ClassTools::singleton()->getReverseAncestry($class) as $name) {
            
            if ($type = PageType::findByClass($name)) {
                
                if ($type->hasPageTemplate()) {
                    return $type->getPageTemplate();
                }
                
            }
            
            if ($name == SiteTree::class) {
                break;
            }
            
        }
    }
1133632
public static function pagination( $pagination ) {
		$pagination = str_replace(
			"'",
			'"',
			$pagination
		);
		$pagination = preg_replace(
			'|<span ([^>]*?)class="page-numbers|',
			'<span $1 class="c-pagination__item',
			$pagination
		);
		$pagination = str_replace(
			'<a class="page-numbers',
			'<a class="c-pagination__item-link',
			$pagination
		);
		$pagination = str_replace(
			'c-pagination__item dots"',
			'c-pagination__item-ellipsis" aria-hidden="true"',
			$pagination
		);
		$pagination = str_replace(
			[ 'next page-numbers', 'prev page-numbers' ],
			'c-pagination__item-link',
			$pagination
		);

		return $pagination;
	}
1054267
public function addClass($class)
    {
        $current = preg_split('%\s+%', $this->getAttribute('class'), 0, PREG_SPLIT_NO_EMPTY);
        $added = preg_split('%\s+%', $class, 0, PREG_SPLIT_NO_EMPTY);
        $current = array_merge($current, $added);
        $classes = implode(' ', $current);

        $this->setAttribute('class', $classes);
    }
859034
public static <T> List<T> toBeanList(String text, Class<T> clazz) {
        return JSON.parseArray(text, clazz);
    }
455220
public function createParagraph($text)
    {
        $paragraph = new Paragraph();
        $paragraph->textContent->push($text);

        if ( ! $this->paragraphs instanceof ArrayIterator) {
            $this->paragraphs = new ArrayIterator();
        }

        $this->paragraphs->push($paragraph);

        return $this->paragraphs->last();
    }
561908
public function indexResponse($response, $class)
    {
        $resources = $this->response($response);

        $collection = (new IndexCollection($resources))->map(
            function($resource) use ($class) {
                return new $class($resource);
            }
        );

        $link = $response->getHeader('Link')[0] ?? null;
        $total = $response->getHeader('X-Total-Count')[0] ?? null;

        $collection->setPagination($this->getPageNumber($link), (int) $total);

        return $collection;
    }
203148
function addLabel($access_name, $text, $class = 'success') {
        $access_name = str_replace('/', '.', $access_name);
        if(mb_strpos($access_name, '.')) {
            $path = str_replace('.', '._items_.', $access_name) . '.item.labels';
        } else {
            $path = $access_name . '.labels';
        }
        $labels   = (array) Arr::get($this->items, $path);
        $labels[] = compact('text', 'class');
        Arr::set($this->items, $path, $labels);
        
        return $this;
    }
598273
public function button($text, $url, $class = 'default', $parameters = array())
    {
        $this->message['buttons'][] = array(
            'text' => $this->container->translate($text, $parameters),
            'url' => $url,
            'class' => $class,
        );
        return $this;
    }
575029
public function twitter($what, $text=null, $class=null) {
		if (is_null($text)) {
			$text = $what;
		}

		$attributes = $this->getHtmlAttributes(array('class'=>$class));

		if (substr($what,0,1)=='@') {
			$link = "https://www.twitter.com/" . ltrim($what, '@');
		} elseif (substr($what,0,1)=='#') {
			$parts = explode(' ', $what);
			if (count($parts)>1) {
				$link = "https://twitter.com/search?q=" . urlencode($what);
			} else {
				$link = "https://www.twitter.com/hashtag/" . ltrim($what, '#');
			}
		}

		return "<a href='$link'$attributes>$text</a>";
	}
946776
protected function _getClassIndices($class)
    {
        $indices = array ();
        if ($class == self::CLASS_LETTER) {
            $indices = array_merge(
                $this->_getClassIndices(self::CLASS_LOWER),
                $this->_getClassIndices(self::CLASS_UPPER)
            );
            sort($indices);
        } else {
            if (isset ($this->_tokenIndices[$class])) {
                $indices = $this->_tokenIndices[$class];
            }
        }

        return $indices;
    }
11949
public static function HelpHover( $html, $text, $class = 'helptext' )
	{
		$id	= uniqid( "hhItem" );
		$code	= "<span class=\"hover\" id=\"".$id."\">".$html."</span><div class=\"".$class."\" id=\"".$id."Help\">".$text."</div>";
		return $code;
	}