Class BBCodeParser

Description

BBCodeParser class

Ideally this class would be an extension of the PEAR HTML_BBCodeParser class but the way the PEAR class is implented, the constructor looks for filter modules.

This class essentially implements a wrapper around the PEAR class to provide control over the options. This class does not implement all of the methods exposed by the PEAR class.

Located in /widgets/BBCode.inc (line 217)


	
			
Variable Summary
mixed $_headerSize
mixed $_options
mixed $_parser
Method Summary
BBCodeParser BBCodeParser ([array $options = array()], [boolean $mapCode2Pre = true], [ $extendedBasic = true])
string getParsed ([ $nl2br = false])
none parse ()
none setHeaderSize (int $size)
none setText (string $str)
Variables
mixed $_extendedTags = array( 'p' => array( 'htmlopen' => 'p',
'htmlclose' => 'p',
'allowed' => 'all',
'attributes'=> array()),'br'=>array('htmlopen'=>'br','htmlclose'=>'','allowed'=>'none','attributes'=>array()),'hr'=>array('htmlopen'=>'hr','htmlclose'=>'','allowed'=>'none','attributes'=>array()),'h'=>array('htmlopen'=>'h','htmlclose'=>'h','allowed'=>'all','attributes'=>array()))
(line 242)

Define additional tags not supplied by the PEAR class.

The [h] tags maps to <h2> but can be changed by the applications. For some odd reason the PEAR class doesn't recognize tags with numeric values. :-(

mixed $_headerSize = 3 (line 270)

Default header size

mixed $_options = array(
'quotestyle' => 'single',
'quotewhat' => 'all',
'open' => '[',
'close' => ']',
'xmlclose' => true,
'filters' => 'Basic,Extended,Links,Images,Lists,Email'
)
(line 226)

Default parser configutation options, include all filters

mixed $_parser (line 264)

Store the handle to the PEAR Parser

Methods
Constructor BBCodeParser (line 280)

The constructor

BBCodeParser BBCodeParser ([array $options = array()], [boolean $mapCode2Pre = true], [ $extendedBasic = true])
  • array $options: - BBCode parser options
  • boolean $mapCode2Pre: - flag to map "code" tags to "pre" tags
  • $extendedBasic
getParsed (line 379)

Gets the parsed text from the object

string getParsed ([ $nl2br = false])
  • $nl2br
parse (line 367)

Parses the text set in the object

none parse ()
setHeaderSize (line 334)

Sets the size of header text used by the [h] tag

none setHeaderSize (int $size)
  • int $size: - size of header (1-6)
setText (line 355)

Sets text in the object to be parsed

none setText (string $str)
  • string $str: - the text to set in the object

Documentation generated on Fri, 28 Jan 2011 08:52:49 -0500 by phpDocumentor 1.4.3