com-tecnick-tcexam-shared

# Procedural File: tce_functions_tcecode.php Source Location: /shared/code/tce_functions_tcecode.php ## Page Details: Functions to translate TCExam proprietary code into XHTML. The TCExam code is compatible to the common BBCode. #### Tags:
author: | Nicola Asuni
copyright: | Copyright © 2004-2010, Nicola Asuni - Tecnick.com S.r.l. - ITALY - www.tecnick.com - info@tecnick.com
link: | www.tecnick.com
since: | 2002-01-09
license: | GNU Affero General Public License
### F_decode_tcecode [line 60]
`string F_decode_tcecode( string $text_to_decode)`
Returns XHTML code from text marked-up with TCExam Code Tags #### Tags:
return: | XHTML code
usedby: | tce_preview_tcecode.php
#### Parameters
string | $text_to_decode | text to convert
[ Top ] ### F_latex_callback [line 209]
`string F_latex_callback( string $matches)`
Callback function for preg_replace_callback (LaTeX replacement). Returns replacement image for LaTeX code. #### Tags:
return: | replacement HTML code string to include the equivalent LaTeX image.
#### Parameters
string | $matches | array containing matches: $matches[0] is the complete match, $matches[1] the match for the first subpattern enclosed in '(...)' (the LaTeX code)
[ Top ] ### F_objects_callback [line 234]
`string F_objects_callback( string $matches)`
Callback function for preg_replace_callback. Returns replacement code by MIME type. #### Tags:
return: | replacement string by file extension
#### Parameters
string | $matches | array containing matches: $matches[0] is the complete match, $matches[1] the match for the first subpattern enclosed in '(...)' and so on
[ Top ] ### F_objects_replacement [line 261]
`string F_objects_replacement( string $name, string $extension, [int $width = 0], [int $height = 0], [string $alt = ''], [ &$maxwidth = 0], [ &$maxheight = 0], int $maxwidth, int $maxheight)`
Returns the xhtml code needed to display the object by MIME type. #### Tags:
return: | replacement string
#### Parameters
string | $name | object path excluded extension
string | $extension | object extension (e.g.: gif, jpg, swf, ...)
int | $width | object width
int | $height | object height
int | $maxwidth | object max or default width
int | $maxheight | object max or default height
string | $alt | alternative content
| &$maxwidth |
| &$maxheight |
[ Top ] ### F_remove_tcecode [line 368]
`string F_remove_tcecode( string $str)`
Returns specified string without tcecode mark-up tags #### Tags:
return: | without tcecode markup tags
#### Parameters
string | $str | text to process
[ Top ] ### F_substrHTML [line 438]
`void F_substrHTML( string $htmltext, [int $min_length = 100], [int $offset_length = 20])`
Return a substring of XHTML code while making sure no html tags are chopped. It also prevents chopping while a tag is still open. this function is based on a public-domain script posted on www.php.net by fox@conskript.server and mr@bbp.biz #### Parameters
string | $htmltext |
int | $min_length | (default=100) the approximate length you want the concatenated text to be
int | $offset_length | (default=20) the max variation in how long the text can be
[ Top ] ### F_tcecodeToLine [line 397]
`void F_tcecodeToLine( string $str)`
Converts tcecode text to a single XHTML string removing some objects. #### Parameters
string | $str | text to process return string
[ Top ] ### F_tcecodeToTitle [line 421]
`void F_tcecodeToTitle( string $str)`
Converts tcecode text to simple string for XHTML title attribute. #### Parameters
string | $str | text to process return string
[ Top ] Documentation generated on Mon, 06 Dec 2010 12:03:05 +0100 by phpDocumentor 1.4.3