Stud.IP  2.0 Revision 48548
 All Data Structures Namespaces Files Functions Variables Pages
wiki.inc.php File Reference

Data Structures

class  line_diff
class  DiffLine

Functions

 getWikiPage ($keyword, $version, $db=NULL)
 completeWikiComments ($body)
 completeWikiSignatures ($body)
 submitWikiPage ($keyword, $version, $body, $user_id, $range_id)
 getLatestVersion ($keyword, $range_id)
 getFirstVersion ($keyword, $range_id)
 getWikiPageVersions ($keyword, $limit=10, $getfirst=0)
 keywordExists ($str, $sem_id=NULL)
 isKeyword ($str, $page, $format="wiki", $sem_id=NULL, $alt_str=NULL)
 getLock ($keyword)
 setWikiLock ($db, $user_id, $range_id, $keyword)
 releaseLocks ($keyword)
 releasePageLocks ($keyword)
 wikiMarkup ($pattern, $replace, $needed_perm='autor')
 wikiDirectives ($str)
 wikiLinks ($str, $page, $format="wiki", $sem_id=NULL)
 getWikiLinks ($str)
 getBacklinks ($keyword)
 refreshBacklinks ($keyword, $str)
 getZusatz ($wikiData)
 showDeleteDialog ($keyword, $version)
 showDeleteAllDialog ($keyword)
 deleteWikiPage ($keyword, $version, $range_id)
 deleteAllWikiPage ($keyword, $range_id)
 listPages ($mode, $sortby=NULL)
 searchWiki ($searchfor, $searchcurrentversions, $keyword, $localsearch)
 wikiSeminarHeader ()
 wikiSinglePageHeader ($wikiData, $keyword)
 wikiEdit ($keyword, $wikiData, $user_id, $backpage=NULL)
 printWikiPage ($keyword, $version)
 exportWiki ()
 printAllWikiPages ($range_id, $header)
 getAllWikiPages ($range_id, $header, $fullhtml=TRUE)
 showPageFrameStart ()
 showPageFrameEnd ($infobox)
 getSearchbox ($preselection, $keyword)
 getShowPageInfobox ($keyword, $latest_version)
 getDiffPageInfobox ($keyword)
 get_toc_toggler ()
 get_toc_content ()
 showWikiPage ($keyword, $version, $special="", $show_comments="icon", $hilight=NULL)
 begin_blank_table ()
 end_blank_table ()
 showDiffs ($keyword, $versions_since)
 do_diff ($strlines1, $strlines2)
 toDiffLineArray ($lines, $who)
 showComboDiff ($keyword, $db=NULL)
 create_color ($index)

Variables

global $wiki_keyword_regex = "(^|\s|\A|>)(([A-Z]|&[AOU]uml;)([a-z0-9]|&[aou]uml;|ß)+([A-Z]|&[AOU]uml;)([a-zA-Z0-9]|&[aouAOU]uml;|ß)+)"
global $wiki_link_regex = "\[\[(([\w\.\-\:\(\)_§\/@# ]|&[AOUaou]uml;|ß)+)\]\]"
global $wiki_extended_link_regex = "\[\[(([\w\.\-\:\(\)_§\/@# ]|&[AOUaou]uml;|ß)+)\|([^\]]+)\]\]"
 $GLOBALS ['wiki_directives'] = array()

Function Documentation

begin_blank_table ( )

Helper function that prints header for a "blank" table

Here is the caller graph for this function:

completeWikiComments (   $body)

Fill in username in comments

Parameters
stringbody WikiPage text

Here is the call graph for this function:

Here is the caller graph for this function:

completeWikiSignatures (   $body)

Fill in signature markup in signatures

Parameters
string$bodyWikiPage text
Returns
string text with signature

Here is the caller graph for this function:

create_color (   $index)

Here is the caller graph for this function:

deleteAllWikiPage (   $keyword,
  $range_id 
)

Delete complete WikiPage with all versions and adjust backlinks.

Parameters
stringWikiPage name
stringID of seminar/einrichtung

Here is the call graph for this function:

deleteWikiPage (   $keyword,
  $version,
  $range_id 
)

Delete WikiPage version and adjust backlinks.

Parameters
stringWikiPage name
stringWikiPage version
stringID of seminar/einrichtung
Returns
string WikiPage name to display next

Here is the call graph for this function:

do_diff (   $strlines1,
  $strlines2 
)

Here is the caller graph for this function:

end_blank_table ( )

Helper function that prints footer for a "blank" table

Here is the caller graph for this function:

exportWiki ( )

Show export all dialog

Here is the call graph for this function:

get_toc_content ( )

Here is the call graph for this function:

Here is the caller graph for this function:

get_toc_toggler ( )

Here is the call graph for this function:

Here is the caller graph for this function:

getAllWikiPages (   $range_id,
  $header,
  $fullhtml = TRUE 
)

Return HTML-dump of all wiki pages. Implements an iterative breadth-first traversal of WikiPage-tree.

Parameters
stringID of veranstaltung/einrichtung
stringShort title (header) of veranstaltung/einrichtung
boolinclude html/head/body tags?

Here is the call graph for this function:

Here is the caller graph for this function:

getBacklinks (   $keyword)

Return list of WikiPages containing links to given page

Parameters
stringWiki keyword

Here is the caller graph for this function:

getDiffPageInfobox (   $keyword)

Returns an infobox string holding information and action links for diff view of current page.

Parameters
stringWikiPage name

Here is the call graph for this function:

Here is the caller graph for this function:

getFirstVersion (   $keyword,
  $range_id 
)

Retrieve oldest version for a given keyword

Parameters
stringWikiPage name

Here is the caller graph for this function:

getLatestVersion (   $keyword,
  $range_id 
)

Retrieve latest version for a given keyword

Parameters
stringkeyword WikiPage name

Here is the caller graph for this function:

getLock (   $keyword)

Get lock information about page Returns displayable string containing lock information (Template: Username1 (seit x Minuten), Username2 (seit y Minuten), ...) or NULL if no locks set.

Parameters
stringWikiPage keyword

Here is the call graph for this function:

Here is the caller graph for this function:

getSearchbox (   $preselection,
  $keyword 
)

Returns an infobox category string for a searchbox

Parameters
stringpreselection - put in searchbox
getShowPageInfobox (   $keyword,
  $latest_version 
)

Returns an infobox string holding information and action links for current page. If newest version is displayed, infobox includes backlinks.

Parameters
stringWikiPage name
boolIs version displayed latest version?

Here is the call graph for this function:

Here is the caller graph for this function:

getWikiLinks (   $str)

Return list of WikiWord in given page body ($str)

Parameters
stringstr

Here is the call graph for this function:

Here is the caller graph for this function:

getWikiPage (   $keyword,
  $version,
  $db = NULL 
)

Retrieve a WikiPage version from current seminar's WikiWikiWeb.

Returns raw text data from database if requested version is available. If not, an

Parameters
stringWikiWiki keyword to be retrieved
intVersion number. If empty, latest version is returned.

Here is the caller graph for this function:

getWikiPageVersions (   $keyword,
  $limit = 10,
  $getfirst = 0 
)

Return array containing version numbes and chdates

Parameters
stringkeyword Wiki keyword for currently selected seminar
stringlimit Number of links to be retrieved (default:10)
stringgetfirst Should first (=most recent) version e retrieved, too?

Here is the caller graph for this function:

getZusatz (   $wikiData)

Generate Meta-Information on Wiki-Page to display in top line

Parameters
db-queryresult all information about a wikiPage
Returns
string Displayable HTML

Here is the call graph for this function:

Here is the caller graph for this function:

isKeyword (   $str,
  $page,
  $format = "wiki",
  $sem_id = NULL,
  $alt_str = NULL 
)

Check if keyword already exists or links to new page. Returns HTML-Link-Representation.

Parameters
stringWikiPage keyword
stringcurrent Page (for edit abort backlink)
stringout format: "wiki"=link to wiki.php, "inline"=link on same page

Here is the call graph for this function:

keywordExists (   $str,
  $sem_id = NULL 
)

Check if given keyword exists in current WikiWikiWeb.

Parameters
stringWikiPage keyword

Here is the caller graph for this function:

listPages (   $mode,
  $sortby = NULL 
)

List all topics in this seminar's wiki

Parameters
modestring Either "all" or "new", affects default sorting and page title.
sortbystring Different sortings of entries.

Here is the call graph for this function:

printAllWikiPages (   $range_id,
  $header 
)

Print HTML-dump of all wiki pages.

Parameters
stringID of veranstaltung/einrichtung
stringShort title (header) of veranstaltung/einrichtung

Here is the call graph for this function:

printWikiPage (   $keyword,
  $version 
)

Display wiki page for print.

Parameters
stringkeyword WikiPage name
stringversion WikiPage version

Here is the call graph for this function:

refreshBacklinks (   $keyword,
  $str 
)

Refresh wiki_links table for backlinks from given page to other pages

Parameters
stringkeyword WikiPage-name for $str content
stringstr Page content containing links

Here is the call graph for this function:

Here is the caller graph for this function:

releaseLocks (   $keyword)

Release all locks for wiki page that are older than 30 minutes.

Parameters
stringWikiPage keyword

Here is the caller graph for this function:

releasePageLocks (   $keyword)

Release locks for current wiki page and current user

Parameters
stringkeyword WikiPage name

Here is the caller graph for this function:

searchWiki (   $searchfor,
  $searchcurrentversions,
  $keyword,
  $localsearch 
)

Search Wiki

Parameters
searchforstring String to search for.
searchcurrentversionsbool it true, only consider most recent versions or pages
keywordstring last shown page or keyword for local (one page) search
keywordbool if localsearch is set, only one page (all versions) is searched

Here is the call graph for this function:

setWikiLock (   $db,
  $user_id,
  $range_id,
  $keyword 
)

Set lock for current user and current page

Parameters
DB_Seminardb DB_Seminar instance
stringuser_id Internal user id
stringrange_if Internal seminar id
stringkeyword WikiPage name
showComboDiff (   $keyword,
  $db = NULL 
)

Here is the call graph for this function:

showDeleteAllDialog (   $keyword)

Display yes/no dialog to confirm complete WikiPage deletion.

Parameters
stringWikiPage name

Here is the call graph for this function:

Here is the caller graph for this function:

showDeleteDialog (   $keyword,
  $version 
)

Display yes/no dialog to confirm WikiPage version deletion.

Parameters
stringWikiPage name
stringWikiPage version (if empty: take latest)
Returns
string Version number to delete

Here is the call graph for this function:

Here is the caller graph for this function:

showDiffs (   $keyword,
  $versions_since 
)

Display Page diffs, restrictable to recent versions

Parameters
stringWikiPage name
stringOnly show versions newer than this timestamp

Here is the call graph for this function:

showPageFrameEnd (   $infobox)

Display the right and bottom part of a page "frame".

Renders an infobox and closes the table.

Parameters
arrayready to pass to print_infoxbox()

Here is the call graph for this function:

Here is the caller graph for this function:

showPageFrameStart ( )

Display start of page "frame", i.e. open correct table structure.

Here is the caller graph for this function:

showWikiPage (   $keyword,
  $version,
  $special = "",
  $show_comments = "icon",
  $hilight = NULL 
)

Display wiki page.

Parameters
stringWikiPage name
stringWikiPage version
stringID of special dialog to be printed (delete, delete_all) or message string for parse_msg to display
stringComment show mode (all, none, icon)

Here is the call graph for this function:

Here is the caller graph for this function:

submitWikiPage (   $keyword,
  $version,
  $body,
  $user_id,
  $range_id 
)

Write a new/edited wiki page to database

Parameters
stringkeyword WikiPage name
stringversion WikiPage version
stringbody WikiPage text
stringuser_id Internal user id of editor
stringrange_id Internal id of seminar/einrichtung

Here is the call graph for this function:

toDiffLineArray (   $lines,
  $who 
)

Here is the caller graph for this function:

wikiDirectives (   $str)

Process registered wiki-directives

Parameters
stringtext, all other markup conversions applied

Here is the caller graph for this function:

wikiEdit (   $keyword,
  $wikiData,
  $user_id,
  $backpage = NULL 
)

Display edit form for wiki page.

Parameters
stringkeyword WikiPage name
arraywikiData Array from DB with WikiPage data
stringuser_id Internal user id
stringbackpage Page to display if editing is aborted

Here is the call graph for this function:

wikiLinks (   $str,
  $page,
  $format = "wiki",
  $sem_id = NULL 
)

Replace WikiWords with appropriate links in given string and process registered wiki-directives

Parameters
stringstr
stringpage
string"wiki"=link to wiki, "inline"=link to same page

Here is the call graph for this function:

Here is the caller graph for this function:

wikiMarkup (   $pattern,
  $replace,
  $needed_perm = 'autor' 
)

Register Wiki directive markup

Parameters
stringpattern
stringreplace
wikiSeminarHeader ( )

Print a wiki header (css class: topic) including seminar name.

wikiSinglePageHeader (   $wikiData,
  $keyword 
)

Print a wiki page header including printhead-bar with page name and last change info.

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

$GLOBALS['wiki_directives'] = array()
$wiki_extended_link_regex = "\[\[(([\w\.\-\:\(\)_§\/@# ]|&[AOUaou]uml;|ß)+)\|([^\]]+)\]\]"
$wiki_keyword_regex = "(^|\s|\A|>)(([A-Z]|&[AOU]uml;)([a-z0-9]|&[aou]uml;|ß)+([A-Z]|&[AOU]uml;)([a-zA-Z0-9]|&[aouAOU]uml;|ß)+)"
$wiki_link_regex = "\[\[(([\w\.\-\:\(\)_§\/@# ]|&[AOUaou]uml;|ß)+)\]\]"