TYPO3
7.6
|
Public Member Functions | |
init ($elRef= '', $recPid=0) | |
setRelPath ($path) | |
RTE_transform ($value, $specConf, $direction= 'rte', $thisConfig=array()) | |
TS_images_rte ($value) | |
TS_reglinks ($value, $direction) | |
TS_links_db ($value) | |
TS_links_rte ($value) | |
TS_preserve_db ($value) | |
TS_preserve_rte ($value) | |
TS_transform_db ($value, $css=false) | |
transformStyledATags ($value) | |
TS_transform_rte ($value, $css=0) | |
TS_strip_db ($value) | |
getUrl ($url) | |
HTMLcleaner_db ($content, $tagList= '') | |
getKeepTags ($direction= 'rte', $tagList= '') | |
divideIntoLines ($value, $count=5, $returnArray=false) | |
setDivTags ($value, $dT= 'p') | |
siteUrl () | |
removeTables ($value, $breakChar= '< br/>') | |
defaultTStagMapping ($code, $direction= 'rte') | |
getWHFromAttribs ($attribArray) | |
urlInfoForLinkTags ($url) | |
TS_AtagToAbs ($value, $dontSetRTEKEEP=false) | |
Public Member Functions inherited from HtmlParser | |
splitIntoBlock ($tag, $content, $eliminateExtraEndTags=false) | |
splitIntoBlockRecursiveProc ($tag, $content, &$procObj, $callBackContent, $callBackTags, $level=0) | |
splitTags ($tag, $content) | |
getAllParts ($parts, $tag_parts=true, $include_tag=true) | |
removeFirstAndLastTag ($str) | |
getFirstTag ($str) | |
getFirstTagName ($str, $preserveCase=false) | |
get_tag_attributes ($tag, $deHSC=0) | |
split_tag_attributes ($tag) | |
checkTagTypeCounts ($content, $blockTags= 'a, b, blockquote, body, div, em, font, form, h1, h2, h3, h4, h5, h6, i, li, map, ol, option, p, pre, select, span, strong, table, td, textarea, tr, u, ul', $soloTags= 'br, hr, img, input, area') | |
bidir_htmlspecialchars ($value, $dir) | |
prefixResourcePath ($main_prefix, $content, $alternatives=array(), $suffix= '') | |
prefixRelPath ($prefix, $srcVal, $suffix= '') | |
cleanFontTags ($value, $keepFace=0, $keepSize=0, $keepColor=0) | |
mapTags ($value, $tags=array(), $ltChar= '<', $ltChar2= '<') | |
unprotectTags ($content, $tagList= '') | |
caseShift ($str, $flag, $cacheKey= '') | |
compileTagAttribs ($tagAttrib, $meta=array(), $xhtmlClean=0) | |
get_tag_attributes_classic ($tag, $deHSC=0) | |
indentLines ($content, $number=1, $indentChar=TAB) | |
HTMLparserConfig ($TSconfig, $keepTags=array()) | |
XHTML_clean ($content) | |
processTag ($value, $conf, $endTag, $protected=0) | |
processContent ($value, $dir, $conf) | |
stripEmptyTags ($content, $tagList=null, $treatNonBreakingSpaceAsEmpty=false) | |
Static Public Member Functions | |
static | evalWriteFile ($pArr, $currentRecord) |
Static Public Member Functions inherited from HtmlParser | |
static | getSubpart ($content, $marker) |
static | substituteSubpart ($content, $marker, $subpartContent, $recursive=true, $keepMarker=false) |
static | substituteSubpartArray ($content, array $subpartsContent) |
static | substituteMarker ($content, $marker, $markContent) |
static | substituteMarkerArray ($content, $markContentArray, $wrap= '', $uppercase=false, $deleteUnused=false) |
static | substituteMarkerAndSubpartArrayRecursive ($content, array $markersAndSubparts, $wrap= '', $uppercase=false, $deleteUnused=false) |
Public Attributes | |
$blockElementList = 'PRE,UL,OL,H1,H2,H3,H4,H5,H6,ADDRESS,DL,DD,HEADER,SECTION,FOOTER,NAV,ARTICLE,ASIDE' | |
$recPid = 0 | |
$elRef = '' | |
$relPath = '' | |
$relBackPath = '' | |
$tsConfig = array() | |
$procOptions = array() | |
$TS_transform_db_safecounter = 100 | |
$rte_p = '' | |
$getKeepTags_cache = array() | |
$allowedClasses = array() | |
$preserveTags = '' | |
Public Attributes inherited from HtmlParser | |
const | VOID_ELEMENTS = 'area|base|br|col|command|embed|hr|img|input|keygen|meta|param|source|track|wbr' |
Protected Member Functions | |
applyPlainImageModeSettings ($imageInfo, $attribArray) | |
Protected Member Functions inherited from HtmlParser | |
stripEmptyTagsIfConfigured ($value, $configuration) | |
Additional Inherited Members | |
Protected Attributes inherited from HtmlParser | |
$caseShift_cache = array() | |
Class for parsing HTML for the Rich Text Editor. (also called transformations)
Definition at line 26 of file RteHtmlParser.php.
|
protected |
Apply plain image settings to the dimensions of the image
array | $imageInfo,: | info array of the image |
array | $attribArray,: | array of attributes of an image tag |
Definition at line 1613 of file RteHtmlParser.php.
defaultTStagMapping | ( | $code, | |
$direction = 'rte' |
|||
) |
Default tag mapping for TS
string | $code | Input code to process |
string | $direction | Direction To databsae (db) or from database to RTE (rte) |
Definition at line 1457 of file RteHtmlParser.php.
References HtmlParser\mapTags().
divideIntoLines | ( | $value, | |
$count = 5 , |
|||
$returnArray = false |
|||
) |
This resolves the $value into parts based on
-sections and
-sections and
-tags. These are returned as lines separated by LF. This point is to resolve the HTML-code returned from RTE into ordinary lines so it's 'human-readable' The function ->setDivTags does the opposite. This function processes content to go into the database.
string | $value | Value to process. |
int | $count | Recursion brake. Decremented on each recursion down to zero. Default is 5 (which equals the allowed nesting levels of p/div tags). |
bool | $returnArray | If TRUE, an array with the lines is returned, otherwise a string of the processed input value. |
Definition at line 1245 of file RteHtmlParser.php.
References HtmlParser\compileTagAttribs(), HtmlParser\get_tag_attributes(), HtmlParser\getFirstTag(), HtmlParser\getFirstTagName(), RteHtmlParser\HTMLcleaner_db(), HtmlParser\removeFirstAndLastTag(), HtmlParser\splitIntoBlock(), and GeneralUtility\trimExplode().
Referenced by RteHtmlParser\TS_transform_db().
|
static |
Evaluate the environment for editing a staticFileEdit file. Called for almost all fields being saved in the database. Is called without an instance of ::evalWriteFile()
array | $pArr | Parameters for the current field as found in types-config |
array | $currentRecord | Current record we are editing. |
Definition at line 157 of file RteHtmlParser.php.
References GeneralUtility\logDeprecatedFunction().
getKeepTags | ( | $direction = 'rte' , |
|
$tagList = '' |
|||
) |
Creates an array of configuration for the HTMLcleaner function based on whether content go TO or FROM the Rich Text Editor ($direction) Unless "tagList" is given, the function will cache the configuration for next time processing goes on. (In this class that is the case only if we are processing a bulletlist)
string | $direction | The direction of the content being processed by the output configuration; "db" (content going into the database FROM the rte) or "rte" (content going into the form) |
string | $tagList | Comma list of tags to keep (overriding default which is to keep all + take notice of internal configuration) |
Definition at line 1127 of file RteHtmlParser.php.
References HtmlParser\HTMLparserConfig(), and GeneralUtility\trimExplode().
Referenced by RteHtmlParser\HTMLcleaner_db(), and RteHtmlParser\setDivTags().
getUrl | ( | $url | ) |
Reads the file or url $url and returns the content
string | $url | Filepath/URL to read |
Definition at line 1084 of file RteHtmlParser.php.
References $url, and GeneralUtility\getUrl().
getWHFromAttribs | ( | $attribArray | ) |
Finds width and height from attrib-array If the width and height is found in the style-attribute, use that!
array | $attribArray | Array of attributes from tag in which to search. More specifically the content of the key "style" is used to extract "width:xxx / height:xxx" information |
Definition at line 1483 of file RteHtmlParser.php.
HTMLcleaner_db | ( | $content, | |
$tagList = '' |
|||
) |
Function for cleaning content going into the database. Content is cleaned eg. by removing unallowed HTML and ds-HSC content It is basically calling HTMLcleaner from the parent class with some preset configuration specifically set up for cleaning content going from the RTE into the db
string | $content | Content to clean up |
string | $tagList | Comma list of tags to specifically allow. Default comes from getKeepTags and is |
Definition at line 1099 of file RteHtmlParser.php.
References RteHtmlParser\getKeepTags().
Referenced by RteHtmlParser\divideIntoLines(), and RteHtmlParser\TS_transform_db().
init | ( | $elRef = '' , |
|
$recPid = 0 |
|||
) |
Initialize, setting element reference and record PID
string | $elRef | Element reference, eg "tt_content:bodytext |
int | $recPid | PID of the record (page id) |
Definition at line 117 of file RteHtmlParser.php.
References RteHtmlParser\$elRef, and RteHtmlParser\$recPid.
removeTables | ( | $value, | |
$breakChar = '<br />' |
|||
) |
Remove all tables from incoming code The function is trying to to this is some more or less respectfull way. The approach is to resolve each table cells content and implode it all by
chars. Thus at least the content is preserved in some way.
string | $value | Input value |
string | $breakChar | Break character to use for linebreaks. |
Definition at line 1427 of file RteHtmlParser.php.
References HtmlParser\getAllParts(), and HtmlParser\splitIntoBlock().
Referenced by RteHtmlParser\TS_transform_db().
RTE_transform | ( | $value, | |
$specConf, | |||
$direction = 'rte' , |
|||
$thisConfig = array() |
|||
) |
Transform value for RTE based on specConf in the direction specified by $direction (rte/db) This is the main function called from tcemain and transfer data classes
string | Input value |
array | Special configuration for a field; This is coming from the types-configuration of the field in the TCA. In the types-configuration you can setup features for the field rendering and in particular the RTE takes al its major configuration options from there! |
string | Direction of the transformation. Two keywords are allowed; "db" or "rte". If "db" it means the transformation will clean up content coming from the Rich Text Editor and goes into the database. The other direction, "rte", is of course when content is coming from database and must be transformed to fit the RTE. |
array | Parsed TypoScript content configuring the RTE, probably coming from Page TSconfig. |
Definition at line 177 of file RteHtmlParser.php.
References $GLOBALS, BackendUtility\getSpecConfParametersFromArray(), GeneralUtility\getUserObj(), HtmlParser\HTMLparserConfig(), GeneralUtility\trimExplode(), RteHtmlParser\TS_images_rte(), RteHtmlParser\TS_links_db(), RteHtmlParser\TS_links_rte(), RteHtmlParser\TS_preserve_db(), RteHtmlParser\TS_preserve_rte(), RteHtmlParser\TS_reglinks(), RteHtmlParser\TS_strip_db(), RteHtmlParser\TS_transform_db(), and RteHtmlParser\TS_transform_rte().
setDivTags | ( | $value, | |
$dT = 'p' |
|||
) |
Converts all lines into
/
-sections (unless the line is a div-section already) For processing of content going FROM database TO RTE.
string | $value | Value to convert |
string | $dT | Tag to wrap with. Either "p" or "div" should it be. Lowercase preferably. |
Definition at line 1369 of file RteHtmlParser.php.
References RteHtmlParser\getKeepTags().
Referenced by RteHtmlParser\TS_transform_rte().
setRelPath | ( | $path | ) |
Setting the ->relPath and ->relBackPath to proper values so absolute references to links and images can be converted to relative dittos. This is used when editing files with the RTE
string | $path | The relative path from PATH_site to the place where the file being edited is. Eg. "fileadmin/static". |
Definition at line 131 of file RteHtmlParser.php.
siteUrl | ( | ) |
Returns SiteURL based on thisScript.
Definition at line 1414 of file RteHtmlParser.php.
References GeneralUtility\getIndpEnv().
Referenced by RteHtmlParser\TS_AtagToAbs(), RteHtmlParser\TS_images_rte(), RteHtmlParser\TS_links_db(), RteHtmlParser\TS_links_rte(), RteHtmlParser\TS_reglinks(), and RteHtmlParser\urlInfoForLinkTags().
transformStyledATags | ( | $value | ) |
Wraps a-tags that contain a style attribute with a span-tag
string | $value | Content input |
Definition at line 969 of file RteHtmlParser.php.
References HtmlParser\get_tag_attributes_classic(), HtmlParser\getFirstTag(), GeneralUtility\implodeAttributes(), HtmlParser\removeFirstAndLastTag(), and HtmlParser\splitIntoBlock().
Referenced by RteHtmlParser\TS_transform_db().
TS_AtagToAbs | ( | $value, | |
$dontSetRTEKEEP = false |
|||
) |
Converting -tags to absolute URLs (+ setting rtekeep attribute)
string | $value | Content input |
bool | $dontSetRTEKEEP | If TRUE, then the "rtekeep" attribute will not be set. |
Definition at line 1575 of file RteHtmlParser.php.
References elseif, HtmlParser\get_tag_attributes_classic(), HtmlParser\getFirstTag(), GeneralUtility\implodeAttributes(), HtmlParser\removeFirstAndLastTag(), RteHtmlParser\siteUrl(), and HtmlParser\splitIntoBlock().
Referenced by RteHtmlParser\TS_links_rte(), and RteHtmlParser\TS_reglinks().
TS_images_rte | ( | $value | ) |
Transformation handler: 'ts_images' / direction: "rte" Processing images from database content going into the RTE. Processing includes converting the src attribute to an absolute URL.
string | $value | Content input |
Definition at line 485 of file RteHtmlParser.php.
References HtmlParser\get_tag_attributes_classic(), GeneralUtility\getIndpEnv(), GeneralUtility\implodeAttributes(), RteHtmlParser\siteUrl(), and HtmlParser\splitTags().
Referenced by RteHtmlParser\RTE_transform().
TS_links_db | ( | $value | ) |
Transformation handler: 'ts_links' / direction: "db" Converting -tags to <link tags>="">
string | $value | Content input |
Definition at line 562 of file RteHtmlParser.php.
References $GLOBALS, HtmlParser\get_tag_attributes_classic(), HtmlParser\getFirstTag(), GeneralUtility\getUserObj(), GeneralUtility\implodeAttributes(), HtmlParser\removeFirstAndLastTag(), RteHtmlParser\siteUrl(), HtmlParser\splitIntoBlock(), and RteHtmlParser\urlInfoForLinkTags().
Referenced by RteHtmlParser\RTE_transform().
TS_links_rte | ( | $value | ) |
Transformation handler: 'ts_links' / direction: "rte" Converting <link tags>=""> to -tags
string | $value | Content input |
Definition at line 665 of file RteHtmlParser.php.
References $GLOBALS, RteHtmlParser\$recPid, StringUtility\beginsWith(), MathUtility\canBeInterpretedAsInteger(), elseif, HtmlParser\getFirstTag(), BackendUtility\getRecord(), BackendUtility\getRecordsByField(), GeneralUtility\getUserObj(), GeneralUtility\inList(), GeneralUtility\makeInstance(), HtmlParser\removeFirstAndLastTag(), RteHtmlParser\siteUrl(), HtmlParser\splitIntoBlock(), GeneralUtility\trimExplode(), and RteHtmlParser\TS_AtagToAbs().
Referenced by RteHtmlParser\RTE_transform().
TS_preserve_db | ( | $value | ) |
Preserve special tags
string | $value | Content input |
Definition at line 805 of file RteHtmlParser.php.
References HtmlParser\get_tag_attributes_classic(), HtmlParser\getFirstTag(), HtmlParser\getFirstTagName(), HtmlParser\removeFirstAndLastTag(), and HtmlParser\splitIntoBlock().
Referenced by RteHtmlParser\RTE_transform().
TS_preserve_rte | ( | $value | ) |
Preserve special tags
string | $value | Content input |
Definition at line 832 of file RteHtmlParser.php.
References HtmlParser\getFirstTag(), HtmlParser\removeFirstAndLastTag(), and HtmlParser\splitIntoBlock().
Referenced by RteHtmlParser\RTE_transform().
TS_reglinks | ( | $value, | |
$direction | |||
) |
Transformation handler: 'ts_reglinks' / direction: "db"+"rte" depending on $direction variable. Converting -tags to/from abs/rel
string | $value | Content input |
string | $direction | Direction of conversion; "rte" (from database to RTE) or "db" (from RTE to database) |
Definition at line 525 of file RteHtmlParser.php.
References HtmlParser\get_tag_attributes_classic(), HtmlParser\getFirstTag(), GeneralUtility\implodeAttributes(), HtmlParser\removeFirstAndLastTag(), RteHtmlParser\siteUrl(), HtmlParser\splitIntoBlock(), and RteHtmlParser\TS_AtagToAbs().
Referenced by RteHtmlParser\RTE_transform().
TS_strip_db | ( | $value | ) |
Transformation handler: 'ts_strip' / direction: "db" Removing all non-allowed tags
string | $value | Content input |
Definition at line 1066 of file RteHtmlParser.php.
Referenced by RteHtmlParser\RTE_transform().
TS_transform_db | ( | $value, | |
$css = false |
|||
) |
Transformation handler: 'ts_transform' + 'css_transform' / direction: "db" Cleaning (->db) for standard content elements (ts)
string | $value | Content input |
bool | $css | If TRUE, the transformation was "css_transform", otherwise "ts_transform |
Definition at line 856 of file RteHtmlParser.php.
References RteHtmlParser\divideIntoLines(), HtmlParser\get_tag_attributes_classic(), HtmlParser\getFirstTag(), HtmlParser\getFirstTagName(), RteHtmlParser\HTMLcleaner_db(), HtmlParser\removeFirstAndLastTag(), RteHtmlParser\removeTables(), HtmlParser\splitIntoBlock(), and RteHtmlParser\transformStyledATags().
Referenced by RteHtmlParser\RTE_transform().
TS_transform_rte | ( | $value, | |
$css = 0 |
|||
) |
Transformation handler: 'ts_transform' + 'css_transform' / direction: "rte" Set (->rte) for standard content elements (ts)
string | Content input |
bool | If TRUE, the transformation was "css_transform", otherwise "ts_transform |
Definition at line 998 of file RteHtmlParser.php.
References RteHtmlParser\$blockElementList, HtmlParser\get_tag_attributes_classic(), HtmlParser\getFirstTag(), HtmlParser\getFirstTagName(), GeneralUtility\inList(), HtmlParser\removeFirstAndLastTag(), RteHtmlParser\setDivTags(), and HtmlParser\splitIntoBlock().
Referenced by RteHtmlParser\RTE_transform().
urlInfoForLinkTags | ( | $url | ) |
Parse -tag href and return status of email,external,file or page
string | $url | URL to analyse. |
Definition at line 1511 of file RteHtmlParser.php.
References $url, elseif, and RteHtmlParser\siteUrl().
Referenced by RteHtmlParser\TS_links_db().
$allowedClasses = array() |
Definition at line 101 of file RteHtmlParser.php.
$blockElementList = 'PRE,UL,OL,H1,H2,H3,H4,H5,H6,ADDRESS,DL,DD,HEADER,SECTION,FOOTER,NAV,ARTICLE,ASIDE' |
Definition at line 31 of file RteHtmlParser.php.
Referenced by RteHtmlParser\TS_transform_rte().
$elRef = '' |
Definition at line 45 of file RteHtmlParser.php.
Referenced by RteHtmlParser\init().
$getKeepTags_cache = array() |
Definition at line 94 of file RteHtmlParser.php.
$preserveTags = '' |
Definition at line 108 of file RteHtmlParser.php.
$procOptions = array() |
Definition at line 73 of file RteHtmlParser.php.
$recPid = 0 |
Definition at line 38 of file RteHtmlParser.php.
Referenced by RteHtmlParser\init(), and RteHtmlParser\TS_links_rte().
$relBackPath = '' |
Definition at line 59 of file RteHtmlParser.php.
$relPath = '' |
Definition at line 52 of file RteHtmlParser.php.
$rte_p = '' |
Definition at line 87 of file RteHtmlParser.php.
$TS_transform_db_safecounter = 100 |
Definition at line 80 of file RteHtmlParser.php.
$tsConfig = array() |
Definition at line 66 of file RteHtmlParser.php.