Stud.IP  6.1
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, $range_id=null, $page_id=null)
 
 blubberReady ($text, $trim=TRUE)
 
 decodeHTML ($string)
 
 preg_call_format_signature ($username, $timestamp)
 
 kill_format ($text)
 
 isURL ($url)
 
 isLinkIntern ($url)
 
 idna_link (string $link)
 
 symbol ($text='')
 
 mila ($titel, $size=60)
 
 tooltip ($text, $with_alt=TRUE, $with_popup=FALSE)
 
 tooltip2 ($text, $with_alt=TRUE, $with_popup=FALSE)
 
 tooltipIcon (?string $text, bool $important=false, bool $html=false, bool $alt_info=false)
 
 tooltipHtmlIcon (?string $text, bool $important=false)
 
 TransformInternalLinks ($str)
 
 display_exception (Throwable $exception, bool $as_html=false, bool $deep=false)
 
 arrayToHtmlAttributes (array $attributes)
 

Variables

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

Function Documentation

◆ arrayToHtmlAttributes()

arrayToHtmlAttributes ( array  $attributes)

Converts an array of attributes to an html attribute string.

Parameters
array$attributesAssociative array of attributes
Returns
string
Since
Stud.IP 4.1

◆ blubberReady()

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()

decodeHTML (   $string)

decodes html entities to normal characters

public

Parameters
string
Returns
string

◆ display_exception()

display_exception ( Throwable  $exception,
bool  $as_html = false,
bool  $deep = false 
)

Displays the provided exception in a more readable fashion.

Parameters
Throwable$exceptionThe exception to be displayed
bool$as_htmlIndicates whether the exception shall be displayed as plain text or html (optional, defaults to plain text)
bool$deepIndicates whether any previous exception should be included in the output (optional, defaults to false)
Returns
String The exception display either as plain text or html

◆ formatLinks()

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()

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()

htmlReady (   $what,
  $trim = TRUE,
  $br = FALSE,
  $double_encode = true 
)

◆ idna_link()

idna_link ( string  $link)

convert links with 'umlauten' to punycode

Parameters
string$linklink to convert
Returns
string link in punycode
Exceptions

◆ isLinkIntern()

isLinkIntern (   $url)

◆ isURL()

isURL (   $url)

◆ jsReady()

jsReady (   $what,
  $target = 'script-single' 
)

◆ kill_format()

kill_format (   $text)

removes all characters used by quick-format-syntax

public

Parameters
string
Returns
string

◆ mila()

mila (   $titel,
  $size = 60 
)

◆ preg_call_format_signature()

preg_call_format_signature (   $username,
  $timestamp 
)

formats a ~~~~ wiki signature with username and timestamp

Parameters
string
unixtimestamp

◆ quotes_encode()

quotes_encode (   $text,
  $author = '' 
)

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

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

◆ symbol()

symbol (   $text = '')

create symbols from the shorts

This functions converts the short, locatet in the config.inc into the assigned pictures. A tooltip which shows the symbol code is given, too.

public

Parameters
stringthe text to convert
Returns
string convertet text

◆ tooltip()

tooltip (   $text,
  $with_alt = TRUE,
  $with_popup = FALSE 
)

Returns a given text as html tooltip

title and alt attribute is default, with_popup means a JS alert box activated on click

Parameters
string$text
boolean$with_altreturn text with alt attribute
boolean$with_popupreturn text with JS alert box on click
Returns
string

◆ tooltip2()

tooltip2 (   $text,
  $with_alt = TRUE,
  $with_popup = FALSE 
)

Returns a given text as an array of html attributes used as tooltip

title and alt attribute is default, with_popup means a JS alert box activated on click

Parameters
string$text
boolean$with_altreturn text with alt attribute
boolean$with_popupreturn text with JS alert box on click
Returns
string

◆ tooltipHtmlIcon()

tooltipHtmlIcon ( ?string  $text,
bool  $important = false 
)

returns a html-snippet with an icon and a tooltip on it

Parameters
string | null$texttooltip text, html is rendered as is
bool$importantrender icon in "important" style
Returns
string

◆ tooltipIcon()

tooltipIcon ( ?string  $text,
bool  $important = false,
bool  $html = false,
bool  $alt_info = false 
)

returns a html-snippet with an icon and a tooltip on it

Parameters
string | null$texttooltip text, html gets encoded
bool$importantrender icon in "important" style
bool$htmltooltip text is HTML content
bool$alt_info
Returns
string

◆ TransformInternalLinks()

TransformInternalLinks (   $str)

detects internal links in a given string and convert used domain to the domain actually used (only necessary if more than one domain exists), relative URLs are converted to absolute URLs

Parameters
string$strURL/Link to convert
Returns
string converted URL/Link

◆ wikiReady()

wikiReady (   $text,
  $trim = TRUE,
  $range_id = null,
  $page_id = null 
)

Special version of formatReady for wiki-webs.

public

Parameters
string$whatMarked-up text.
string$trimTrim leading and trailing whitespace, if TRUE.
string$range_idthe id of the course or institute
string$page_idthe id of the page
Returns
string HTML code computed by applying markup-rules.

◆ wysiwygReady()

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

◆ FORMATTED_CONTENT_WRAPPER

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