TYPO3 API  SVNRelease
Public Member Functions | Public Attributes
user_plaintext Class Reference

List of all members.

Public Member Functions

 main_plaintext ($content, $conf)
 getMenuSitemap ()
 getShortcut ()
 getHTML ($str=array())
 getHeader ()
 getImages ()
 parseBody ($str)
 renderUploads ($str, $upload_path='uploads/media/')
 getList ($CType= 'list')
 renderHeader ($str, $type=0)
 pad ($lines, $preLineChar, $len)
 breakContent ($str)
 breakBulletlist ($str)
 breakTable ($str)
 addDiv ($messure, $content, $divChar, $joinChar, $cols)
 traverseTable ($tableLines)
 renderImages ($str, $links, $caption, $upload_path='uploads/pics/')
 getLink ($ll)
 breakLines ($str, $implChar="\n", $charWidth=0)
 getString ($str)
 userProcess ($mConfKey, $passVar)
 atag_to_http ($content, $conf)
 typolist ($content, $conf)
 typohead ($content, $conf)
 typocode ($content, $conf)
 main_plaintext ($content, $conf)
 getMenuSitemap ()
 getShortcut ()
 getHTML ($str=array())
 getHeader ()
 getImages ()
 parseBody ($str)
 renderUploads ($str, $upload_path='uploads/media/')
 getList ($CType= 'list')
 renderHeader ($str, $type=0)
 pad ($lines, $preLineChar, $len)
 breakContent ($str)
 breakBulletlist ($str)
 breakTable ($str)
 addDiv ($messure, $content, $divChar, $joinChar, $cols)
 traverseTable ($tableLines)
 renderImages ($str, $links, $caption, $upload_path='uploads/pics/')
 getLink ($ll)
 breakLines ($str, $implChar="\n", $charWidth=0)
 getString ($str)
 userProcess ($mConfKey, $passVar)
 atag_to_http ($content, $conf)
 typolist ($content, $conf)
 typohead ($content, $conf)
 typocode ($content, $conf)

Public Attributes

 $cObj
 $conf = array()
 $charWidth = 76

Detailed Description

Definition at line 122 of file plaintextLib.inc.


Member Function Documentation

user_plaintext::addDiv ( messure,
content,
divChar,
joinChar,
cols 
)

Subfunction for breakTable(): Adds a divider line between table rows.

Parameters:
arraySome information about sizes
stringEmpty string.
stringCharacter to use for the divider line, typically "-"
stringJoin character, typically "+"
integerNumber of table columns
Returns:
string Divider line for the table private
See also:
breakTable()

Definition at line 483 of file plaintextLib.inc.

References $content.

Referenced by breakTable().

user_plaintext::addDiv ( messure,
content,
divChar,
joinChar,
cols 
)

Subfunction for breakTable(): Adds a divider line between table rows.

Parameters:
arraySome information about sizes
stringEmpty string.
stringCharacter to use for the divider line, typically "-"
stringJoin character, typically "+"
integerNumber of table columns
Returns:
string Divider line for the table private
See also:
breakTable()

Definition at line 489 of file plaintextLib.inc.

References $content.

user_plaintext::atag_to_http ( content,
conf 
)

Function used by TypoScript "parseFunc" to process links in the bodytext. Extracts the link and shows it in plain text in a parathesis next to the link text. If link was relative the site URL was prepended.

Parameters:
stringEmpty, ignore.
arrayTypoScript parameters
Returns:
string Processed output.
See also:
parseBody()

Definition at line 620 of file plaintextLib.inc.

References $conf.

user_plaintext::atag_to_http ( content,
conf 
)

Function used by TypoScript "parseFunc" to process links in the bodytext. Extracts the link and shows it in plain text in a parathesis next to the link text. If link was relative the site URL was prepended.

Parameters:
stringEmpty, ignore.
arrayTypoScript parameters
Returns:
string Processed output.
See also:
parseBody()

Definition at line 630 of file plaintextLib.inc.

References $conf.

user_plaintext::breakBulletlist ( str)

Breaks content lines into a bullet list

Parameters:
stringContent string to make into a bullet list
Returns:
string Processed value

Definition at line 399 of file plaintextLib.inc.

References getString(), and t3lib_div\intInRange().

Referenced by getMenuSitemap(), main_plaintext(), and typolist().

user_plaintext::breakBulletlist ( str)

Breaks content lines into a bullet list

Parameters:
stringContent string to make into a bullet list
Returns:
string Processed value

Definition at line 402 of file plaintextLib.inc.

References getString(), and t3lib_div\intInRange().

user_plaintext::breakContent ( str)

Function used to wrap the bodytext field content (or image caption) into lines of a max length of

Parameters:
stringThe content to break
Returns:
string Processed value.
See also:
main_plaintext(), breakLines()

Definition at line 384 of file plaintextLib.inc.

References breakLines().

Referenced by getHTML(), main_plaintext(), and renderImages().

user_plaintext::breakContent ( str)

Function used to wrap the bodytext field content (or image caption) into lines of a max length of

Parameters:
stringThe content to break
Returns:
string Processed value.
See also:
main_plaintext(), breakLines()

Definition at line 386 of file plaintextLib.inc.

References breakLines().

user_plaintext::breakLines ( str,
implChar = "\n",
charWidth = 0 
)

Breaking lines into fixed length lines, using t3lib_div::breakLinesForEmail()

Parameters:
stringThe string to break
stringLine break character
integerLength of lines, default is $this->charWidth
Returns:
string Processed string
See also:
t3lib_div::breakLinesForEmail()

Definition at line 578 of file plaintextLib.inc.

References $charWidth, and t3lib_div\breakLinesForEmail().

Referenced by breakContent(), and breakTable().

user_plaintext::breakLines ( str,
implChar = "\n",
charWidth = 0 
)

Breaking lines into fixed length lines, using t3lib_div::breakLinesForEmail()

Parameters:
stringThe string to break
stringLine break character
integerLength of lines, default is $this->charWidth
Returns:
string Processed string
See also:
t3lib_div::breakLinesForEmail()

Definition at line 588 of file plaintextLib.inc.

References $charWidth, and t3lib_div\breakLinesForEmail().

user_plaintext::breakTable ( str)

Formatting a table in plain text (based on the paradigm of lines being content rows and cells separated by "|")

Parameters:
stringContent string
Returns:
string Processed value

Definition at line 429 of file plaintextLib.inc.

References addDiv(), breakLines(), and traverseTable().

Referenced by main_plaintext().

user_plaintext::breakTable ( str)

Formatting a table in plain text (based on the paradigm of lines being content rows and cells separated by "|")

Parameters:
stringContent string
Returns:
string Processed value

Definition at line 433 of file plaintextLib.inc.

References addDiv(), breakLines(), and traverseTable().

user_plaintext::getHeader ( )

Creates a header (used for most elements)

Returns:
string Content
See also:
renderHeader()

Definition at line 244 of file plaintextLib.inc.

References renderHeader().

Referenced by main_plaintext(), and typohead().

user_plaintext::getHeader ( )

Creates a header (used for most elements)

Returns:
string Content
See also:
renderHeader()

Definition at line 245 of file plaintextLib.inc.

References renderHeader().

user_plaintext::getHTML ( str = array())

Creates an HTML element (stripping tags of course)

Parameters:
stringHTML content to process. If not passed along, the bodytext field is used.
Returns:
string Content

Definition at line 234 of file plaintextLib.inc.

References breakContent(), and parseBody().

Referenced by main_plaintext().

user_plaintext::getHTML ( str = array())

Creates an HTML element (stripping tags of course)

Parameters:
stringHTML content to process. If not passed along, the bodytext field is used.
Returns:
string Content

Definition at line 235 of file plaintextLib.inc.

References breakContent(), and parseBody().

user_plaintext::getImages ( )

Get images found in the "image" field of "tt_content"

Returns:
string Content

Definition at line 254 of file plaintextLib.inc.

References renderImages().

Referenced by main_plaintext().

user_plaintext::getImages ( )

Get images found in the "image" field of "tt_content"

Returns:
string Content

Definition at line 255 of file plaintextLib.inc.

References renderImages().

user_plaintext::getLink ( ll)

Returns a typolink URL based on input.

Parameters:
stringParameter to typolink
Returns:
string The URL returned from $this->cObj->getTypoLink_URL(); - possibly it prefixed with the URL of the site if not present already

Definition at line 561 of file plaintextLib.inc.

Referenced by renderImages().

user_plaintext::getLink ( ll)

Returns a typolink URL based on input.

Parameters:
stringParameter to typolink
Returns:
string The URL returned from $this->cObj->getTypoLink_URL(); - possibly it prefixed with the URL of the site if not present already

Definition at line 571 of file plaintextLib.inc.

user_plaintext::getList ( CType = 'list')

Creates a list

Parameters:
stringtype of content
Returns:
string Content

Definition at line 303 of file plaintextLib.inc.

References parseBody().

Referenced by main_plaintext().

user_plaintext::getList ( CType = 'list')

Creates a list

Parameters:
stringtype of content
Returns:
string Content

Definition at line 305 of file plaintextLib.inc.

References parseBody().

user_plaintext::getMenuSitemap ( )

Creates a menu/sitemap

Returns:
string Content

Definition at line 212 of file plaintextLib.inc.

References breakBulletlist(), and parseBody().

Referenced by main_plaintext().

user_plaintext::getMenuSitemap ( )

Creates a menu/sitemap

Returns:
string Content

Definition at line 213 of file plaintextLib.inc.

References breakBulletlist(), and parseBody().

user_plaintext::getShortcut ( )

Creates a shortcut ("Insert Records")

Returns:
string Content

Definition at line 223 of file plaintextLib.inc.

Referenced by main_plaintext().

user_plaintext::getShortcut ( )

Creates a shortcut ("Insert Records")

Returns:
string Content

Definition at line 224 of file plaintextLib.inc.

user_plaintext::getString ( str)

Explodes a string with "|" and if the second part is found it will return this, otherwise the first part. Used for many TypoScript properties used in this class since they need preceeding whitespace to be preserved.

Parameters:
stringInput string
Returns:
string Output string private

Definition at line 590 of file plaintextLib.inc.

Referenced by breakBulletlist(), main_plaintext(), renderHeader(), renderImages(), and renderUploads().

user_plaintext::getString ( str)

Explodes a string with "|" and if the second part is found it will return this, otherwise the first part. Used for many TypoScript properties used in this class since they need preceeding whitespace to be preserved.

Parameters:
stringInput string
Returns:
string Output string private

Definition at line 600 of file plaintextLib.inc.

user_plaintext::main_plaintext ( content,
conf 
)

Main function, called from TypoScript A content object that renders "tt_content" records. See the comment to this class for TypoScript example of how to trigger it. This detects the CType of the current content element and renders it accordingly. Only wellknown types are rendered.

Parameters:
stringEmpty, ignore.
arrayTypoScript properties for this content object/function call
Returns:
string Plain text content

Definition at line 136 of file plaintextLib.inc.

References $conf, $content, breakBulletlist(), breakContent(), breakTable(), getHeader(), getHTML(), getImages(), getList(), getMenuSitemap(), getShortcut(), getString(), parseBody(), renderUploads(), and userProcess().

user_plaintext::main_plaintext ( content,
conf 
)

Main function, called from TypoScript A content object that renders "tt_content" records. See the comment to this class for TypoScript example of how to trigger it. This detects the CType of the current content element and renders it accordingly. Only wellknown types are rendered.

Parameters:
stringEmpty, ignore.
arrayTypoScript properties for this content object/function call
Returns:
string Plain text content

Definition at line 137 of file plaintextLib.inc.

References $conf, $content, breakBulletlist(), breakContent(), breakTable(), getHeader(), getHTML(), getImages(), getList(), getMenuSitemap(), getShortcut(), getString(), parseBody(), renderUploads(), and userProcess().

user_plaintext::pad ( lines,
preLineChar,
len 
)

Function used to repeat a char pattern in head lines (like if you want "********" above/below a header)

Parameters:
arrayArray of existing lines to which the new char-pattern should be added
stringThe character pattern to repeat. Default is "-"
integerThe length of the line. $preLineChar will be repeated to fill in this length.
Returns:
array The input array with a new line added.
See also:
renderHeader()

Definition at line 368 of file plaintextLib.inc.

References t3lib_div\intInRange().

Referenced by renderHeader().

user_plaintext::pad ( lines,
preLineChar,
len 
)

Function used to repeat a char pattern in head lines (like if you want "********" above/below a header)

Parameters:
arrayArray of existing lines to which the new char-pattern should be added
stringThe character pattern to repeat. Default is "-"
integerThe length of the line. $preLineChar will be repeated to fill in this length.
Returns:
array The input array with a new line added.
See also:
renderHeader()

Definition at line 370 of file plaintextLib.inc.

References t3lib_div\intInRange().

user_plaintext::parseBody ( str)

Parsing the bodytext field content, removing typical entities and
tags.

Parameters:
stringField content from "bodytext"
Returns:
string Processed content

Definition at line 265 of file plaintextLib.inc.

References t3lib_div\htmlspecialchars_decode().

Referenced by getHTML(), getList(), getMenuSitemap(), and main_plaintext().

user_plaintext::parseBody ( str)

Parsing the bodytext field content, removing typical entities and
tags.

Parameters:
stringField content from "bodytext"
Returns:
string Processed content

Definition at line 266 of file plaintextLib.inc.

References t3lib_div\htmlspecialchars_decode().

user_plaintext::renderHeader ( str,
type = 0 
)

Renders a content element header, observing the layout type giving different header formattings

Parameters:
stringThe header string
integerThe layout type of the header (in the content element)
Returns:
string Content

Definition at line 315 of file plaintextLib.inc.

References $GLOBALS, getString(), t3lib_div\intInRange(), and pad().

Referenced by getHeader().

user_plaintext::renderHeader ( str,
type = 0 
)

Renders a content element header, observing the layout type giving different header formattings

Parameters:
stringThe header string
integerThe layout type of the header (in the content element)
Returns:
string Content

Definition at line 317 of file plaintextLib.inc.

References $GLOBALS, getString(), t3lib_div\intInRange(), and pad().

user_plaintext::renderImages ( str,
links,
caption,
upload_path = 'uploads/pics/' 
)

Render block of images - which means creating lines with links to the images.

Parameters:
stringList of image filenames (from "image" field in tt_content records)
stringLink value from the "image_link" field in tt_content records
stringCaption text
stringAlternative relative path for the files listed in $str
Returns:
string Content
See also:
getImages()

Definition at line 523 of file plaintextLib.inc.

References breakContent(), getLink(), and getString().

Referenced by getImages().

user_plaintext::renderImages ( str,
links,
caption,
upload_path = 'uploads/pics/' 
)

Render block of images - which means creating lines with links to the images.

Parameters:
stringList of image filenames (from "image" field in tt_content records)
stringLink value from the "image_link" field in tt_content records
stringCaption text
stringAlternative relative path for the files listed in $str
Returns:
string Content
See also:
getImages()

Definition at line 532 of file plaintextLib.inc.

References breakContent(), getLink(), and getString().

user_plaintext::renderUploads ( str,
upload_path = 'uploads/media/' 
)

Creates a list of links to uploaded files.

Parameters:
stringList of uploaded filenames from "uploads/media/" (or $upload_path)
stringAlternative path value
Returns:
string Content

Definition at line 287 of file plaintextLib.inc.

References getString().

Referenced by main_plaintext().

user_plaintext::renderUploads ( str,
upload_path = 'uploads/media/' 
)

Creates a list of links to uploaded files.

Parameters:
stringList of uploaded filenames from "uploads/media/" (or $upload_path)
stringAlternative path value
Returns:
string Content

Definition at line 288 of file plaintextLib.inc.

References getString().

user_plaintext::traverseTable ( tableLines)

Traverses the table lines/cells and creates arrays with statistics for line numbers and lengths

Parameters:
arrayArray with [table rows] [table cells] [lines in cell]
Returns:
array Statistics (max lines/lengths) private
See also:
breakTable()

Definition at line 499 of file plaintextLib.inc.

Referenced by breakTable().

user_plaintext::traverseTable ( tableLines)

Traverses the table lines/cells and creates arrays with statistics for line numbers and lengths

Parameters:
arrayArray with [table rows] [table cells] [lines in cell]
Returns:
array Statistics (max lines/lengths) private
See also:
breakTable()

Definition at line 505 of file plaintextLib.inc.

user_plaintext::typocode ( content,
conf 
)

User function (called from TypoScript) for generating a code listing (used in parsefunc)

Parameters:
stringEmpty, ignore.
arrayTypoScript parameters
Returns:
string Processed output.

Definition at line 673 of file plaintextLib.inc.

References $conf.

user_plaintext::typocode ( content,
conf 
)

User function (called from TypoScript) for generating a code listing (used in parsefunc)

Parameters:
stringEmpty, ignore.
arrayTypoScript parameters
Returns:
string Processed output.

Definition at line 683 of file plaintextLib.inc.

References $conf.

user_plaintext::typohead ( content,
conf 
)

User function (called from TypoScript) for generating a typo header tag (used in parsefunc)

Parameters:
stringEmpty, ignore.
arrayTypoScript parameters
Returns:
string Processed output.

Definition at line 654 of file plaintextLib.inc.

References $conf, and getHeader().

user_plaintext::typohead ( content,
conf 
)

User function (called from TypoScript) for generating a typo header tag (used in parsefunc)

Parameters:
stringEmpty, ignore.
arrayTypoScript parameters
Returns:
string Processed output.

Definition at line 664 of file plaintextLib.inc.

References $conf, and getHeader().

user_plaintext::typolist ( content,
conf 
)

User function (called from TypoScript) for generating a bullet list (used in parsefunc)

Parameters:
stringEmpty, ignore.
arrayTypoScript parameters
Returns:
string Processed output.

Definition at line 639 of file plaintextLib.inc.

References $conf, and breakBulletlist().

user_plaintext::typolist ( content,
conf 
)

User function (called from TypoScript) for generating a bullet list (used in parsefunc)

Parameters:
stringEmpty, ignore.
arrayTypoScript parameters
Returns:
string Processed output.

Definition at line 649 of file plaintextLib.inc.

References $conf, and breakBulletlist().

user_plaintext::userProcess ( mConfKey,
passVar 
)

Calls a user function for processing of data

Parameters:
stringTypoScript property name, pointing to the definition of the user function to call (from the TypoScript array internally in this class). This array is passed to the user function. Notice that "parentObj" property is a reference to this class ($this)
mixedVariable to process
Returns:
mixed The processed $passVar as returned by the function call

Definition at line 602 of file plaintextLib.inc.

References $GLOBALS.

Referenced by main_plaintext().

user_plaintext::userProcess ( mConfKey,
passVar 
)

Calls a user function for processing of data

Parameters:
stringTypoScript property name, pointing to the definition of the user function to call (from the TypoScript array internally in this class). This array is passed to the user function. Notice that "parentObj" property is a reference to this class ($this)
mixedVariable to process
Returns:
mixed The processed $passVar as returned by the function call

Definition at line 612 of file plaintextLib.inc.

References $GLOBALS.


Member Data Documentation

user_plaintext::$charWidth = 76

Definition at line 125 of file plaintextLib.inc.

Referenced by breakLines().

user_plaintext::$cObj

Definition at line 123 of file plaintextLib.inc.

user_plaintext::$conf = array()

Definition at line 124 of file plaintextLib.inc.

Referenced by atag_to_http(), main_plaintext(), typocode(), typohead(), and typolist().


The documentation for this class was generated from the following files: