RICHTEXTFORMAT
extends TINYMCETEXTEXPORT
in package
RTF encoding
NB - this produces just the bare minimum of RTF code to work in Word and OO.org
Table of Contents
- $footnoteOffsetIds : mixed
- array
- $keepQuoteMarks : mixed
- boolean
- $listId : mixed
- int
- $listIndent : mixed
- int
- $listIndentExtra : mixed
- int
- $listIndex : mixed
- int
- $listOverrideTable : mixed
- string
- $listType : mixed
- string
- $qme : mixed
- string
- $qms : mixed
- string
- $quoteFontSize : mixed
- string
- $quoteNumWords : mixed
- int
- $vars : mixed
- array
- callback_footnoteIndent() : string
- Callback for adding a footnote to an indented quotation.
- convertColour() : string
- Convert hexadecimal colours to RTF colours
- createEmail() : string
- Create email hyperlinks
- createListTablesArabic() : mixed
- Create list tables for Arabic numerals
- createTables() : string
- Find any tables
- fbin2fhex() : string
- Convert a binary file to a hexadecimal file encoded with bin2hex
- footnotes() : string
- Callback for parsing [footnote]...[/footnote]
- indentQ() : string
- Callback for indent long quotations
- indentQuotations() : string
- Indent long quotations
- init() : mixed
- Initialize RTF values either as defaults or from user-requested settings
- listStyleCallback() : string
- For the cases where a list element has style information
- parseFootnotes() : string
- Parse [footnote]...[/footnote]
- setEmail() : string
- Callback for createEmail() above
- setFancyUrl() : string
- Callback for createFancyUrl() above
- style() : string
- Deal with style elements for DIV and SPAN
- tableFormat() : string
- Format Tables
- URL_exists() : bool
- Check image URL is valid
Properties
$footnoteOffsetIds
array
private
mixed
$footnoteOffsetIds
= []
$keepQuoteMarks
boolean
private
mixed
$keepQuoteMarks
$listId
int
private
mixed
$listId
$listIndent
int
private
mixed
$listIndent
= 720
$listIndentExtra
int
private
mixed
$listIndentExtra
= 360
$listIndex
int
private
mixed
$listIndex
= 2
$listOverrideTable
string
private
mixed
$listOverrideTable
$listType
string
private
mixed
$listType
$qme
string
private
mixed
$qme
$qms
string
private
mixed
$qms
$quoteFontSize
string
private
mixed
$quoteFontSize
$quoteNumWords
int
private
mixed
$quoteNumWords
$vars
array
private
mixed
$vars
Methods
callback_footnoteIndent()
Callback for adding a footnote to an indented quotation.
private
callback_footnoteIndent(array<string|int, mixed> $matches) : string
Parameters
- $matches : array<string|int, mixed>
Return values
string —convertColour()
Convert hexadecimal colours to RTF colours
private
convertColour(string $colour) : string
Parameters
- $colour : string
Return values
string —createEmail()
Create email hyperlinks
private
createEmail(string $text) : string
Parameters
- $text : string
Return values
string —createListTablesArabic()
Create list tables for Arabic numerals
private
createListTablesArabic(int $levelnfc) : mixed
Parameters
- $levelnfc : int
-
Default is 0.
Return values
mixed —createTables()
Find any tables
private
createTables(string $text) : string
Parameters
- $text : string
Return values
string —fbin2fhex()
Convert a binary file to a hexadecimal file encoded with bin2hex
private
fbin2fhex(array<string|int, mixed> $binfile, array<string|int, mixed> $hexfile) : string
Useful for images inlined in RTF.
Parameters
- $binfile : array<string|int, mixed>
- $hexfile : array<string|int, mixed>
Return values
string —footnotes()
Callback for parsing [footnote]...[/footnote]
private
footnotes(array<string|int, mixed> $matchArray) : string
Parameters
- $matchArray : array<string|int, mixed>
Return values
string —indentQ()
Callback for indent long quotations
private
indentQ(array<string|int, mixed> $matchArray) : string
Parameters
- $matchArray : array<string|int, mixed>
Return values
string —indentQuotations()
Indent long quotations
private
indentQuotations(string $text, int $numWords, mixed $keepQuoteMarks) : string
Parameters
- $text : string
- $numWords : int
- $keepQuoteMarks : mixed
Return values
string —init()
Initialize RTF values either as defaults or from user-requested settings
private
init() : mixed
Return values
mixed —listStyleCallback()
For the cases where a list element has style information
private
listStyleCallback(array<string|int, mixed> $match) : string
Parameters
- $match : array<string|int, mixed>
Return values
string —parseFootnotes()
Parse [footnote]...[/footnote]
private
parseFootnotes(string $text, array<string|int, mixed> $footnoteOffsetIds, int $fontSize) : string
Parameters
- $text : string
- $footnoteOffsetIds : array<string|int, mixed>
- $fontSize : int
Return values
string —setEmail()
Callback for createEmail() above
private
setEmail(array<string|int, mixed> $matchArray) : string
Parameters
- $matchArray : array<string|int, mixed>
Return values
string —setFancyUrl()
Callback for createFancyUrl() above
private
setFancyUrl(array<string|int, mixed> $matchArray) : string
Parameters
- $matchArray : array<string|int, mixed>
Return values
string —style()
Deal with style elements for DIV and SPAN
private
style(string $styleString, string $text) : string
Parameters
- $styleString : string
- $text : string
Return values
string —tableFormat()
Format Tables
private
tableFormat(array<string|int, mixed> $matchArray) : string
We've no way of knowing the browser window size from PHP so we assume a width of 1000 -- if the resultant tableWidth is higher than $this->tableWidth, we limit it to $this->tableWidth. Must count the number of cells in each row and divide them into $tableWidth to get cell width.
Parameters
- $matchArray : array<string|int, mixed>
Return values
string —URL_exists()
Check image URL is valid
private
URL_exists(mixed $url) : bool
Parameters
- $url : mixed