PHP Class Horde_Core_Ui_TagCloud, horde

Based on a striped down version of Pear's HTML_TagCloud Copyright 2009-2016 Horde LLC (http://www.horde.org/) See the enclosed file COPYING for license information (LGPL). If you did not receive this file, see http://www.horde.org/licenses/lgpl21.
Datei anzeigen Open project: horde/horde Class Usage Examples

Public Properties

Property Type Description
$basefontsize integer
$css_class string
$epoc_level array
$factor integer
$fontsizerange integer
$size_suffix string mm,cm,in,pt,pc,px,em

Protected Properties

Property Type Description
$_elements array
$_map array
$_max integer
$_max_epoc integer
$_min integer
$_min_epoc integer

Public Methods

Method Description
__construct ( integer $basefontsize = 24, integer $fontsizerange = 12 ) Constructor
addElement ( string $name, string $url = '', integer $count, integer $timestamp = null, string $onclick = null ) Add a Tag Element to build Tag Cloud.
addElements ( array $tags ) Add a Tag Element to build Tag Cloud.
buildHTML ( array $param = [] ) : string Build HTML part.
clearElements ( ) Clear Tag Elements.
cmpElementsName ( $a, $b ) : integer Using for usort().

Protected Methods

Method Description
_buidHTMLTags ( array $param ) : string Calc Tag level and create whole HTML of each Tags.
_calcMumCount ( ) Calc max and min tag count of use.
_calcMumEpoc ( ) Calc max and min timestamp.
_createHTMLTag ( array $tag, string $type, integer $fontsize ) : string Create a Element of HTML part.
_getCountLevel ( integer $count ) : integer Calc Tag Level of size.
_getEpocLevel ( integer $timestamp ) : integer Calc timeline level of Tag.
_sortTags ( integer $limit ) Sort tags by name.
_wrapDiv ( string $html ) : string Wrap div tag.

Method Details

__construct() public method

Constructor
public __construct ( integer $basefontsize = 24, integer $fontsizerange = 12 )
$basefontsize integer Base font size of output tag (option).
$fontsizerange integer Font size range.

_buidHTMLTags() protected method

Calc Tag level and create whole HTML of each Tags.
protected _buidHTMLTags ( array $param ) : string
$param array Limit of Tag Number.
return string HTML

_calcMumCount() protected method

Calc max and min tag count of use.
protected _calcMumCount ( )

_calcMumEpoc() protected method

Calc max and min timestamp.
protected _calcMumEpoc ( )

_createHTMLTag() protected method

Create a Element of HTML part.
protected _createHTMLTag ( array $tag, string $type, integer $fontsize ) : string
$tag array TODO
$type string CSS class of time line param.
$fontsize integer TODO
return string a Element of Tag HTML

_getCountLevel() protected method

Calc Tag Level of size.
protected _getCountLevel ( integer $count ) : integer
$count integer TODO
return integer Level.

_getEpocLevel() protected method

Calc timeline level of Tag.
protected _getEpocLevel ( integer $timestamp ) : integer
$timestamp integer TODO
return integer Level of timeline.

_sortTags() protected method

Sort tags by name.
protected _sortTags ( integer $limit )
$limit integer Limit element number of create TagCloud.

_wrapDiv() protected method

Wrap div tag.
protected _wrapDiv ( string $html ) : string
$html string TODO
return string TODO

addElement() public method

Add a Tag Element to build Tag Cloud.
public addElement ( string $name, string $url = '', integer $count, integer $timestamp = null, string $onclick = null )
$name string TODO
$url string TODO
$count integer TODO
$timestamp integer UNIX timestamp.
$onclick string Javascript onclick event handler.

addElements() public method

Add a Tag Element to build Tag Cloud.
public addElements ( array $tags )
$tags array Associative array to $this->_elements.

buildHTML() public method

Build HTML part.
public buildHTML ( array $param = [] ) : string
$param array 'limit' => int limit of generation tag num.
return string HTML

clearElements() public method

Clear Tag Elements.
public clearElements ( )

cmpElementsName() public method

Using for usort().
public cmpElementsName ( $a, $b ) : integer
return integer TODO

Property Details

$_elements protected_oe property

protected array $_elements
return array

$_map protected_oe property

protected array $_map
return array

$_max protected_oe property

protected int $_max
return integer

$_max_epoc protected_oe property

protected int $_max_epoc
return integer

$_min protected_oe property

protected int $_min
return integer

$_min_epoc protected_oe property

protected int $_min_epoc
return integer

$basefontsize public_oe property

public int $basefontsize
return integer

$css_class public_oe property

public string $css_class
return string

$epoc_level public_oe property

public array $epoc_level
return array

$factor public_oe property

public int $factor
return integer

$fontsizerange public_oe property

public int $fontsizerange
return integer

$size_suffix public_oe property

mm,cm,in,pt,pc,px,em
public string $size_suffix
return string