Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
wiki.inc.php File Reference

Data Structures

class  line_diff
 
class  DiffLine
 

Functions

 getWikiPage ($keyword, $version=null)
 
 submitWikiPage ($keyword, $version, $body, $user_id, $range_id, $ancestor)
 
 getLatestVersion ($keyword, $range_id)
 
 getFirstVersion ($keyword, $range_id)
 
 getWikiPageVersions ($keyword, $limit=10, $getfirst=false)
 
 keywordExists ($str, $sem_id=null)
 
 isKeyword ($str, $page, $format= 'wiki', $sem_id=null, $alt_str=null)
 
 getLock ($keyword, $user_id)
 
 setWikiLock ($db, $user_id, $range_id, $keyword)
 
 releaseLocks ($keyword)
 
 releasePageLocks ($keyword, $user_id)
 
 getWikiLinks ($str)
 
 getBacklinks ($keyword)
 
 refreshBacklinks ($keyword, $str)
 
 deleteAncestorRelation ($keyword)
 
 getZusatz ($wikiData)
 
 getWikiIndex ($descendants, $i=0)
 
 showDeleteDialog ($keyword, $version)
 
 showDeleteAllDialog ($keyword)
 
 deleteWikiPage ($keyword, $version, $range_id)
 
 deleteAllWikiPage ($keyword, $range_id)
 
 listPages ($mode, $sortby=NULL)
 
 listPageVersions ($keyword, $sortby=null)
 
 searchWiki ($searchfor, $searchcurrentversions, $keyword, $localsearch)
 
 wikiEdit ($keyword, $wikiData, $user_id, $backpage=NULL, $ancestor=NULL)
 
 printWikiPage ($keyword, $version)
 
 exportWikiPagePDF ($keyword, $version)
 
 exportAllWikiPagesPDF ($mode, $sortby)
 
 deleteWikiLinks ($keyword)
 
 exportWiki ()
 
 printAllWikiPages ($range_id, $header)
 
 getAllWikiPages ($range_id, $header, $fullhtml=true)
 
 showPageFrameStart ()
 
 showPageFrameEnd ()
 
 getShowPageInfobox ($keyword, $latest_version)
 
 getDiffPageInfobox ($keyword)
 
 get_toc_toggler ()
 
 get_toc_content ()
 
 showWikiPage ($keyword, $version, $special="", $show_comments="icon", $hilight=NULL)
 
 showDiffs ($keyword, $versions_since)
 
 do_diff ($strlines1, $strlines2)
 
 toDiffLineArray ($lines, $who)
 
 showComboDiff ($keyword, $db=NULL)
 

Function Documentation

deleteAllWikiPage (   $keyword,
  $range_id 
)

Delete complete WikiPage with all versions and adjust backlinks.

Parameters
stringWikiPage name
stringID of seminar/einrichtung
deleteAncestorRelation (   $keyword)

When a page gets deleted, set the ancestor to NULL for every descendant page.

Parameters
stringkeyword WikiPage name that was deleted.
deleteWikiLinks (   $keyword)
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
do_diff (   $strlines1,
  $strlines2 
)
exportAllWikiPagesPDF (   $mode,
  $sortby 
)
exportWiki ( )

Show export all dialog

exportWikiPagePDF (   $keyword,
  $version 
)
get_toc_content ( )
get_toc_toggler ( )
getAllWikiPages (   $range_id,
  $header,
  $fullhtml = true 
)

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

Parameters
string$range_idID of veranstaltung/einrichtung
string$headerShort title (header) of veranstaltung/einrichtung
bool$fullhtmlInclude html/head/body tags?
Returns
string
getBacklinks (   $keyword)

Return list of WikiPages containing links to given page

Parameters
stringWiki keyword
getDiffPageInfobox (   $keyword)

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

Parameters
stringWikiPage name
getFirstVersion (   $keyword,
  $range_id 
)

Retrieve oldest version for a given keyword

Parameters
stringWikiPage name
Returns
array
getLatestVersion (   $keyword,
  $range_id 
)

Retrieve latest version for a given keyword

Parameters
stringkeyword WikiPage name
Returns
array
getLock (   $keyword,
  $user_id 
)

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
stringuser_id Internal user id
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?
getWikiIndex (   $descendants,
  $i = 0 
)
getWikiLinks (   $str)

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

Parameters
stringstr
getWikiPage (   $keyword,
  $version = 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.
getWikiPageVersions (   $keyword,
  $limit = 10,
  $getfirst = false 
)

Return array containing version numbes and chdates

Parameters
string$keywordWiki keyword for currently selected seminar
int$limitNumber of links to be retrieved (default:10)
bool$getfirstShould first (=most recent) version be retrieved too?
Returns
array
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
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
keywordExists (   $str,
  $sem_id = null 
)

Check if given keyword exists in current WikiWikiWeb.

Parameters
stringWikiPage keyword
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.
listPageVersions (   $keyword,
  $sortby = null 
)

List all versions of a wiki page

Parameters
string$keywordWikiPage name
string | null$sortbyDifferent sortings of entries.
printAllWikiPages (   $range_id,
  $header 
)

Print HTML-dump of all wiki pages.

Parameters
stringID of veranstaltung/einrichtung
stringShort title (header) of veranstaltung/einrichtung
printWikiPage (   $keyword,
  $version 
)

Display wiki page for print.

Parameters
stringkeyword WikiPage name
stringversion WikiPage version
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
releaseLocks (   $keyword)

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

Parameters
stringWikiPage keyword
releasePageLocks (   $keyword,
  $user_id 
)

Release locks for current wiki page and current user

Parameters
stringkeyword WikiPage name
stringuser_id Internal user id
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
setWikiLock (   $db,
  $user_id,
  $range_id,
  $keyword 
)

Set lock for current user and current page

Parameters
DB_Seminardb DB_Seminar instance (no longer neccessary)
stringuser_id Internal user id
stringrange_if Internal seminar id
stringkeyword WikiPage name
showComboDiff (   $keyword,
  $db = NULL 
)
showDeleteAllDialog (   $keyword)
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
showDiffs (   $keyword,
  $versions_since 
)

Display Page diffs, restrictable to recent versions

Parameters
stringWikiPage name
stringOnly show versions newer than this timestamp
showPageFrameEnd ( )

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

Renders an infobox and closes the table.

Parameters
arrayready to pass to print_infoxbox()
showPageFrameStart ( )

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

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)
stringComment show mode (all, none, icon)
submitWikiPage (   $keyword,
  $version,
  $body,
  $user_id,
  $range_id,
  $ancestor 
)

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
toDiffLineArray (   $lines,
  $who 
)
wikiEdit (   $keyword,
  $wikiData,
  $user_id,
  $backpage = NULL,
  $ancestor = 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