HTML_TagCloud
[ class tree: HTML_TagCloud ] [ index: HTML_TagCloud ] [ all elements ]

Class: HTML_TagCloud

Source Location: /HTML_TagCloud-1.0.0/TagCloud.php

Class Overview


HTML Tag Cloud


Author(s):

Version:

  • Release: 1.0.0

Copyright:

  • 2010 Bastian Onken

Variables

Methods


Child classes:

MyTagsCustomCss
MyTagsCustomCss extends HTML_TagCloud
MyTags
MyTags extends HTML_TagCloud

Inherited Variables

Inherited Methods


Class Details

[line 44]
HTML Tag Cloud

HTML_TagCloud enables you to generate a "tag cloud" in HTML.



[ Top ]


Class Variables

$baseFontSize =  24

[line 53]

Defines the base font size
  • Access: protected

Type:   int


[ Top ]

$cssClass =  'tagcloud'

[line 68]

Name of CSS class the TagCloud will get (assigned to the div the cloud will get wrapped into)
  • Access: protected

Type:   string


[ Top ]

$epocLevel = array(
        array(
            'earliest' => array(
                'link'    => 'cccccc',
                'visited' => 'cccccc',
                'hover'   => 'cccccc',
                'active'  => 'cccccc',
            ),),array('earlier'=>array('link'=>'9999cc','visited'=>'9999cc','hover'=>'9999cc','active'=>'9999cc',),),array('later'=>array('link'=>'9999ff','visited'=>'9999ff','hover'=>'9999ff','active'=>'9999ff',),),array('latest'=>array('link'=>'0000ff','visited'=>'0000ff','hover'=>'0000ff','active'=>'0000ff',),),)

[line 97]

Defines colors of the different levels to that tags will be assigned to (based on tag's age)
  • Access: protected

Type:   array


[ Top ]

$fontSizeRange =  12

[line 60]

Limits the range of generated font-sizes
  • Access: protected

Type:   int


[ Top ]

$sizeSuffix =  'px'

[line 75]

Stores the font-size unit, potentional values are: mm,cm,in,pt,pc,px,em
  • Access: protected

Type:   string


[ Top ]

$tagSeparator =  "  \n"

[line 82]

Stores the separator string which will be put between the tags
  • Access: protected

Type:   string


[ Top ]

$thresholds =  4

[line 89]

Stores the number of color thresholds
  • Access: protected

Type:   int


[ Top ]



Method Detail

__construct (Constructor)   [line 204]

HTML_TagCloud __construct( [int $baseFontSize = null], [int $fontSizeRange = null], [string $latestColor = null], [string $earliestColor = null], [int $thresholds = null], [string $sizeSuffix = null], [string $tagSeparator = null])

Class constructor
  • Since: Method available since Release 0.1.0
  • Access: public

Parameters:

int   $baseFontSize   —  base font size of output tag (optional)
int   $fontSizeRange   —  font size range (optional)
string   $latestColor   —  color of latest tag, usually dark (optional)
string   $earliestColor   —  color of earliest tag, usually light (optional)
int   $thresholds   —  number of timelines to set up (optional)
string   $sizeSuffix   —  CSS font size unit (optional)
string   $tagSeparator   —  separator printed between tags (optional)

[ Top ]

addElement   [line 303]

void addElement( string $name, [string $url = ''], [int $count = 0], [int $timestamp = null])

add a Tag Element to build Tag Cloud
  • Since: Method available since Release 0.1.0
  • Access: public

Parameters:

string   $name   —  tagname
string   $url   —  URL to which the tag leads to
int   $count   —  number of occurrences of this tag
int   $timestamp   —  unixtimestamp

[ Top ]

addElements   [line 324]

void addElements( array $tags)

add a Tag Element to build Tag Cloud
  • Since: Method available since Release 0.1.0
  • Access: public

Parameters:

array   $tags   —  Associative array to $this->_elements

[ Top ]

buildAll   [line 356]

string buildAll( [array $param = array()])

build HTML and CSS at once.
  • Return: HTML and CSS
  • Since: Method available since Release 0.1.0
  • Access: public

Parameters:

array   $param   —  parameters that influence the HTML output

[ Top ]

buildCSS   [line 412]

string buildCSS( )

build CSS part
  • Return: base CSS
  • Since: Method available since Release 0.1.0
  • Access: public

[ Top ]

buildHTML   [line 396]

string buildHTML( [array $param = array()])

build HTML part
  • Return: HTML
  • Since: Method available since Release 0.1.0
  • Access: public

Parameters:

array   $param   —  'limit' => int limit of generation tag num.

[ Top ]

clearElements   [line 339]

void clearElements( )

clear Tag Elements
  • Since: Method available since Release 0.1.0
  • Access: public

[ Top ]

createHTMLTag   [line 536]

string createHTMLTag( array $tag, string $type, float $fontSize)

create a Element of HTML part
  • Return: a Element of Tag HTML
  • Since: Method available since Release 0.1.3
  • Access: protected

Parameters:

array   $tag   —  tagname
string   $type   —  css class of time line param
float   $fontSize   —  size of the font for this tag

[ Top ]

getElementCount   [line 283]

integer getElementCount( )

returns the number of elements in the tag cloud
  • Return: number of elements in the tag cloud
  • Since: Method available since Release 0.2.2
  • Access: public

[ Top ]

getUid   [line 268]

string getUid( )

returns the unique id of the tag cloud
  • Return: unique id
  • Since: Method available since Release 0.2.0
  • Access: public

[ Top ]

html_and_css   [line 379]

string html_and_css( [array $param = array()])

Alias to buildAll. Compatibilities for Perl Module.
  • Return: HTML and CSS
  • See: HTML_TagCloud::buildAll
  • Deprecated: Method deprecated in Release 0.1.3
  • Since: Method available since Release 0.1.0
  • Access: public

Parameters:

array   $param   —  'limit' => int limit of generation tag num.

[ Top ]

_createHTMLTag   [line 517]

string _createHTMLTag( array $tag, string $type, float $fontSize)

create a Element of HTML part

deprecated due to wrong function naming: one leading underscore must only be used in private context.

  • Return: a Element of Tag HTML
  • See: HTML_TagCloud::createHTMLTag()
  • Deprecated: Method deprecated in Release 0.1.3
  • Since: Method available since Release 0.1.0
  • Access: protected

Parameters:

array   $tag   —  tagname
string   $type   —  css class of time line param
float   $fontSize   —  size of the font for this tag

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:43:03 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.