Stud.IP  3.4 Revision
visual.inc.php File Reference

Functions

 get_ampel_state ($cur_ampel_state, $new_level, $new_text)
 
 get_ampel_write ($mein_status, $admission_status, $write_level, $print="TRUE", $start=-1, $ende=-1, $temporaly=0)
 
 get_ampel_read ($mein_status, $admission_status, $read_level, $print="TRUE", $start=-1, $ende=-1, $temporaly=0)
 
 htmlReady ($what, $trim=TRUE, $br=FALSE, $double_encode=true)
 
 jsReady ($what, $target)
 
 quotes_encode ($description, $author)
 
 formatReady ($text, $trim=TRUE, $extern=FALSE, $wiki=FALSE, $show_comments='icon')
 
 formatLinks ($text, $nl2br=TRUE)
 
 wikiReady ($text, $trim=TRUE)
 
 transformBeforeSave ($text)
 
 decodeHTML ($string)
 
 preg_call_format_signature ($username, $timestamp)
 
 kill_format ($text)
 
 isURL ($url)
 
 isLinkIntern ($url)
 
 idna_link ($link, $mail=false)
 
 smile ($text='')
 
 symbol ($text="")
 
 mila ($titel, $size=60)
 
 printhead ($breite, $left, $link, $open, $new, $icon, $titel, $zusatz, $timestmp=0, $printout=TRUE, $index="", $indikator="age", $css_class=NULL)
 
 printcontent ($breite, $write=FALSE, $inhalt, $edit, $printout=TRUE, $addon="")
 
 print_infobox ($content, $picture='', $dont_display_immediatly=false)
 
 tooltip ($text, $with_alt=TRUE, $with_popup=FALSE)
 
 tooltip2 ($text, $with_alt=TRUE, $with_popup=FALSE)
 
 tooltipIcon ($text, $important=false, $html=false)
 
 tooltipHtmlIcon ($text, $important=false)
 
 TransformInternalLinks ($str)
 
 createQuestion ($question, $approveParams, $disapproveParams=array(), $baseUrl='?')
 
 createQuestion2 ($question, $approveParams, $disapproveParams=array(), $baseUrl='?')
 
 display_exception (Exception $exception, $as_html=false, $deep=false)
 
 get_icon_for_mimetype ($mime_type)
 

Variables

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

Function Documentation

◆ createQuestion()

createQuestion (   $question,
  $approveParams,
  $disapproveParams = array(),
  $baseUrl = '?' 
)

creates a modal dialog ensuring that the user is really aware about the action to perform

Parameters
string$questionquestion of the modal dialog
array$approveParamsan array of params for a link to be used on approval
array$disapproveParamsan array of params for a link to be used on disapproval
string$baseUrlif set, this url is used, PHP_SELF otherwise
Returns
string $dialog text which contains the dialog
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ createQuestion2()

createQuestion2 (   $question,
  $approveParams,
  $disapproveParams = array(),
  $baseUrl = '?' 
)

creates a modal dialog ensuring that the user is really aware about the action to perform with formulars

Parameters
string$questionquestion of the modal dialog
array$approveParamsan array of params for a link to be used on approval
array$disapproveParamsan array of params for a link to be used on disapproval
string$baseUrlif set, this url is used, PHP_SELF otherwise
Returns
string $dialog text which contains the dialog
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the caller graph for this function:

◆ decodeHTML()

decodeHTML (   $string)

decodes html entities to normal characters

@access public

Parameters
string
Returns
string
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the caller graph for this function:

◆ display_exception()

display_exception ( Exception  $exception,
  $as_html = false,
  $deep = false 
)

Displays the provided exception in a more readable fashion.

Parameters
Exception$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
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ 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.
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the caller graph for this function:

◆ formatReady()

formatReady (   $text,
  $trim = TRUE,
  $extern = FALSE,
  $wiki = FALSE,
  $show_comments = 'icon' 
)

Common function to get all special Stud.IP formattings.

@access public

Parameters
string$textMarked-up text.
boolean$trimTrim leading and trailing whitespace, if TRUE.
boolean$extern(deprecated, has no effect)
boolean$wiki(deprecated, has no effect)
string$show_comments(deprecated, has no effect)
Returns
string HTML code computed by applying markup-rules.
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the caller graph for this function:

◆ get_ampel_read()

get_ampel_read (   $mein_status,
  $admission_status,
  $read_level,
  $print = "TRUE",
  $start = -1,
  $ende = -1,
  $temporaly = 0 
)

get_ampel_read, waehlt die geeignete Grafik in der Ampel Ansicht (fuer Berechtigungen) aus. Benoetigt den Status in der Veranstaltung und auf der Anmeldeliste und den read_level der Veranstaltung

Parameters
unknown_type$mein_status
unknown_type$admission_status
unknown_type$read_level
unknown_type$print
unknown_type$start
unknown_type$ende
unknown_type$temporaly
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the call graph for this function:

◆ get_ampel_state()

get_ampel_state (   $cur_ampel_state,
  $new_level,
  $new_text 
)

get_ampel_state is a helper function for get_ampel_write and get_ampel_read. It checks if the new parameters lead to a "lower" trafficlight. If so, the new level and the new text are set and returned.

Parameters
unknown_type$cur_ampel_state
unknown_type$new_level
unknown_type$new_text
Returns
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the caller graph for this function:

◆ get_ampel_write()

get_ampel_write (   $mein_status,
  $admission_status,
  $write_level,
  $print = "TRUE",
  $start = -1,
  $ende = -1,
  $temporaly = 0 
)

get_ampel_write, waehlt die geeignete Grafik in der Ampel Ansicht (fuer Berechtigungen) aus. Benoetigt den Status in der Veranstaltung und auf der Anmeldeliste und den read_level der Veranstaltung

Parameters
unknown_type$mein_status
unknown_type$admission_status
unknown_type$write_level
unknown_type$print
unknown_type$start
unknown_type$ende
unknown_type$temporaly
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the call graph for this function:

◆ get_icon_for_mimetype()

get_icon_for_mimetype (   $mime_type)

Returns the appropriate stud.ip icon for a given mime type.

Parameters
String$mime_typeMime type to get the icon for
Returns
String Icon path for the mime type
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ htmlReady()

htmlReady (   $what,
  $trim = TRUE,
  $br = FALSE,
  $double_encode = true 
)
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the call graph for this function:

◆ idna_link()

idna_link (   $link,
  $mail = false 
)

convert links with 'umlauten' to punycode

@access public

Parameters
stringlink to convert
booleanfor mailadr = true and for other link = false
Returns
string link in punycode
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isLinkIntern()

isLinkIntern (   $url)
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ isURL()

◆ jsReady()

jsReady (   $what,
  $target 
)
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ kill_format()

kill_format (   $text)

removes all characters used by quick-format-syntax

@access public

Parameters
string
Returns
string
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the caller graph for this function:

◆ mila()

mila (   $titel,
  $size = 60 
)
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the caller graph for this function:

◆ preg_call_format_signature()

preg_call_format_signature (   $username,
  $timestamp 
)

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

Parameters
string
unixtimestamp
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the call graph for this function:

◆ print_infobox()

print_infobox (   $content,
  $picture = '',
  $dont_display_immediatly = false 
)
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the caller graph for this function:

◆ printcontent()

printcontent (   $breite,
  $write = FALSE,
  $inhalt,
  $edit,
  $printout = TRUE,
  $addon = "" 
)
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ printhead()

printhead (   $breite,
  $left,
  $link,
  $open,
  $new,
  $icon,
  $titel,
  $zusatz,
  $timestmp = 0,
  $printout = TRUE,
  $index = "",
  $indikator = "age",
  $css_class = NULL 
)

Ausgabe der Aufklapp-Kopfzeile

Parameters
$breite
$left
$link
$open
$new
$icon
$titel
$zusatz
$timestmp
$printout
$index
$indikator
$css_class
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ quotes_encode()

quotes_encode (   $description,
  $author 
)

Funktion um Quotings zu encoden

Parameters
string$descriptionder Text der gequotet werden soll, wird zurueckgegeben
string$authorName des urspruenglichen Autors
Returns
string
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.

◆ smile()

smile (   $text = '')

Create smileys

This functions converts the smiley codes notation (:name:) as well as the available short notation.

@access public

Parameters
string$textThe text to convert
Returns
string Converted text
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the caller graph for this function:

◆ symbol()

symbol (   $text = "")

create symbols from the shorts

This functions converts the short, locatet in the config.inc into the assigned pictures. It uses a different directory as the smile-function, becauso symbols should not be shown in the smiley and so, no link is given onto the picture. A tooltip which shows the symbol code is given, too.

@access public

Parameters
stringthe text to convert
Returns
string convertet text
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.

◆ 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
Here is the call graph for this function:

◆ 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
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ tooltipHtmlIcon()

tooltipHtmlIcon (   $text,
  $important = false 
)

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

Parameters
string$texttooltip text, html is rendered as is
bool$importantrender icon in "important" style
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.

◆ tooltipIcon()

tooltipIcon (   $text,
  $important = false,
  $html = false 
)

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

Parameters
string$texttooltip text, html gets encoded
bool$importantrender icon in "important" style
bool$htmltooltip text is HTML content
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the caller graph for this function:

◆ transformBeforeSave()

transformBeforeSave (   $text)

Apply StudipTransformFormat rules to marked-up text.

Parameters
string$textMarked-up text.
Returns
string HTML code computed by applying markup-rules.
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the caller graph for this function:

◆ 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
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the caller graph for this function:

◆ wikiReady()

wikiReady (   $text,
  $trim = TRUE 
)

Special version of formatReady for wiki-webs.

@access public

Parameters
string$whatMarked-up text.
string$trimTrim leading and trailing whitespace, if TRUE.
Returns
string HTML code computed by applying markup-rules.
Examples
/usr/local/src/studip/3.4/lib/visual.inc.php.
Here is the caller graph for this function:

Variable Documentation

◆ FORMATTED_CONTENT_WRAPPER

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