Stud.IP  5.4
 All Data Structures Namespaces Files Functions Variables Groups
visual.inc.php File Reference

Functions

 htmlReady ($what, $trim=TRUE, $br=FALSE, $double_encode=true)
 
 wysiwygReady ($what, $trim=TRUE, $br=FALSE, $double_encode=true)
 
 jsReady ($what, $target= 'script-single')
 
 quotes_encode ($text, $author= '')
 
 formatReady ($text, $trim=true)
 
 formatLinks ($text, $nl2br=true)
 
 wikiReady ($text, $trim=TRUE)
 
 blubberReady ($text, $trim=TRUE)
 
 transformBeforeSave ($text)
 
 decodeHTML ($string)
 

Variables

const FORMATTED_CONTENT_WRAPPER '<div class="formatted-content">%s</div>'
 

Function Documentation

blubberReady (   $text,
  $trim = TRUE 
)

Special version of formatReady for blubber, which includes hashtags

public

Parameters
string$whatMarked-up text.
string$trimTrim leading and trailing whitespace, if TRUE.
Returns
string HTML code computed by applying markup-rules.
decodeHTML (   $string)

decodes html entities to normal characters

public

Parameters
string
Returns
string
formatLinks (   $text,
  $nl2br = true 
)

Simplified version of formatReady that handles link formatting only.

Parameters
string$textMarked-up text.
bool$nl2brConvert newlines to
.
Returns
string Marked-up text with markup-links converted to HTML-links.
formatReady (   $text,
  $trim = true 
)

Common function to get all special Stud.IP formattings.

public

Parameters
string$textMarked-up text.
boolean$trimTrim leading and trailing whitespace, if TRUE.
Returns
string HTML code computed by applying markup-rules.
htmlReady (   $what,
  $trim = TRUE,
  $br = FALSE,
  $double_encode = true 
)
jsReady (   $what,
  $target = 'script-single' 
)
quotes_encode (   $text,
  $author = '' 
)

Quote a piece of text, optionally include the author's name.

Applies Stud.IP-Markup if WYSIWYG/HTML is disabled and HTML if it is enabled.

Parameters
string$textText that is to be quoted.
string$authorName of the text's author (optional).
Returns
string The quoted text.
transformBeforeSave (   $text)

Obsolete function for compatibility, returns text unchanged.

Parameters
string$textMarked-up text.
Returns
string Marked-up text.
wikiReady (   $text,
  $trim = TRUE 
)

Special version of formatReady for wiki-webs.

public

Parameters
string$whatMarked-up text.
string$trimTrim leading and trailing whitespace, if TRUE.
Returns
string HTML code computed by applying markup-rules.
wysiwygReady (   $what,
  $trim = TRUE,
  $br = FALSE,
  $double_encode = true 
)

Prepare text for wysiwyg (if enabled), otherwise convert special characters using htmlReady.

Parameters
string$textThe text.
boolean$trimTrim text before applying markup rules, if TRUE.
boolean$brReplace newlines by
, if TRUE and wysiwyg editor disabled.
boolean$double_encodeEncode existing HTML entities, if TRUE and wysiwyg editor disabled.
Returns
string The converted string.

Variable Documentation

const FORMATTED_CONTENT_WRAPPER '<div class="formatted-content">%s</div>'