tce__functions__tcecode_8php

It appears that you are using AdBlocking software. The cost of running this website is covered by advertisements. If you like it please feel free to a small amount of money to secure the future of this website.
tce_functions_tcecode.php File Reference

Namespaces

 com\tecnick\tcexam\shared
 TCExam Shared Area.
 

Functions

 F_decode_tcecode ($text_to_decode)
 
 F_latex_callback ($matches)
 
 F_mathml_callback ($matches)
 
 F_objects_callback ($matches)
 
 F_objects_replacement ($name, $extension, $width=0, $height=0, $alt=“, &$maxwidth=0, &$maxheight=0)
 
 F_remove_tcecode ($str)
 
 F_tcecodeToLine ($str)
 
 F_tcecodeToTitle ($str)
 
 F_substrHTML ($htmltext, $min_length=100, $offset_length=20)
 

Detailed Description

Functions to translate TCExam proprietary code into XHTML. The TCExam code is compatible to the common BBCode.

Function Documentation

F_decode_tcecode (   $text_to_decode)

Returns XHTML code from text marked-up with TCExam Code Tags

Parameters
$text_to_decode(string) text to convert
Returns
string XHTML code

F_latex_callback (   $matches)

Callback function for preg_replace_callback (LaTeX replacement). Returns replacement image for LaTeX code.

Parameters
$matches(string) array containing matches: $matches[0] is the complete match, $matches[1] the match for the first subpattern enclosed in ‘(…)’ (the LaTeX code)
Returns
string replacement HTML code string to include the equivalent LaTeX image.

F_mathml_callback (   $matches)

Callback function for preg_replace_callback (MathML replacement). Returns replacement code for MathML code.

Parameters
$matches(string) array containing matches: $matches[0] is the complete match, $matches[1] the match for the first subpattern enclosed in ‘(…)’ (the MathML code)
Returns
string MathML code.

F_objects_callback (   $matches)

Callback function for preg_replace_callback. Returns replacement code by MIME type.

Parameters
$matches(string) array containing matches: $matches[0] is the complete match, $matches[1] the match for the first subpattern enclosed in ‘(…)’ and so on
Returns
string replacement string by file extension

F_objects_replacement (   $name,
  $extension,
  $width = 0,
  $height = 0,
  $alt = ,
$maxwidth = 0,
$maxheight = 0 
)

Returns the xhtml code needed to display the object by MIME type.

Parameters
$name(string) object path excluded extension
$extension(string) object extension (e.g.: gif, jpg, swf, …)
$width(int) object width
$height(int) object height
$maxwidth(int) object max or default width
$maxheight(int) object max or default height
$alt(string) alternative content
Returns
string replacement string

F_remove_tcecode (   $str)

Returns specified string without tcecode mark-up tags

Parameters
$str(string) text to process
Returns
string without tcecode markup tags

F_substrHTML (   $htmltext,
  $min_length = 100,
  $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@c.nosp@m.onsk.nosp@m.ript..nosp@m.serv.nosp@m.er and mr@bb.nosp@m.p.bi.nosp@m.z

Parameters
$htmltext(string)
$min_length(int) (default=100) the approximate length you want the concatenated text to be
$offset_length(int) (default=20) the max variation in how long the text can be

F_tcecodeToLine (   $str)

Converts tcecode text to a single XHTML string removing some objects.

Parameters
$str(string) text to process return string

F_tcecodeToTitle (   $str)

Converts tcecode text to simple string for XHTML title attribute.

Parameters
$str(string) text to process return string

 

© 2004-2017 – Nicola Asuni - Tecnick.com - All rights reserved.
about - disclaimer - privacy