Stud.IP  6.0
ForumHelpers Class Reference

Static Public Member Functions

static do_highlight ($text, $highlight)
 
static highlight ($text, $highlight)
 
static translate_perm ($perm)
 
static getPage ()
 
static setPage ($page_num)
 
static getVisitText ($num_entries, $topic_id)
 
static getOnlineStatus ($user_id)
 
static createPdf ($seminar_id, $parent_id=null)
 
static getSeminarId ()
 
static replace ($text)
 

Static Public Attributes

static $page = 1
 

Member Function Documentation

◆ createPdf()

static createPdf (   $seminar_id,
  $parent_id = null 
)
static

Create a pdf of all postings belonging to the passed seminar located under the passed topic_id. The PDF is dispatched automatically.

BEWARE: This function never returns, it dies after the PDF has been (succesfully or not) dispatched.

Parameters
string$seminar_id
string$parent_id

◆ do_highlight()

static do_highlight (   $text,
  $highlight 
)
static

helper_function for highlight($text, $highlight)

Parameters
string$text
array$highlight
Returns
string

◆ getOnlineStatus()

static getOnlineStatus (   $user_id)
static

return the online status of the passed user, one of three possible states is returned:

  • available
  • away
  • offline

type $online_status

Parameters
string$user_id
Returns
string

◆ getPage()

static getPage ( )
static

return the currently chosen page

Returns
int

◆ getSeminarId()

static getSeminarId ( )
static

Returns the id of the currently selected seminar or false, if no seminar is selected

Returns
mixed seminar_id or false

◆ getVisitText()

static getVisitText (   $num_entries,
  $topic_id 
)
static

Return an info-text explaining the visit-status of the passed topic_di which has the passed number of new entries.

Parameters
string$num_entriesthe number of new entries
string$topic_idthe id of the topic
Returns
string a human readable, localized text

◆ highlight()

static highlight (   $text,
  $highlight 
)
static

This function highlights Text HTML-safe (tags or words in tags are not highlighted, words between tags ARE highlighted)

Parameters
string$textthe text where to words shall be highlighted, may contain tags
array$highlightan array of words to be highlighted
Returns
string the highlighted text

◆ replace()

static replace (   $text)
static

replace in the passed text every %%% with <% and every ### with %> This is used to work around a limitation of the Button-API in combination with the underscore.js way of inserting template vars.

The Button-API correctly replaces < > with tags, but underscore.js is unable to find them in their tag-represenation

Parameters
string$textthe text to apply the replacements on
Returns
string the modified text

◆ setPage()

static setPage (   $page_num)
static

set the current page

Parameters
int$page_numthe page

◆ translate_perm()

static translate_perm (   $perm)
static

Returns a human-readable version of the passed global Stud.IP permission.

Parameters
string$perm
Returns
string

Field Documentation

◆ $page

$page = 1
static

The documentation for this class was generated from the following file: