Stud.IP  4.0
 All Data Structures Namespaces Files Functions Variables Groups
WikiFormat Class Reference
Inheritance diagram for WikiFormat:
StudipFormat TextFormat

Public Member Functions

 __construct ()
 
- Public Member Functions inherited from StudipFormat
 __construct ()
 
- Public Member Functions inherited from TextFormat
 __construct ($markup_rules=[])
 
 addMarkup ($name, $start, $end, $callback, $before=null)
 
 getMarkup ($name)
 
 removeMarkup ($name)
 
 format ($text)
 
 quote ($text)
 
 isInsideOf ($rule)
 

Static Public Member Functions

static static addWikiMarkup ($name, $start, $end, $callback, $before=null)
 
static getWikiMarkup ($name)
 
static removeWikiMarkup ($name)
 
- Static Public Member Functions inherited from StudipFormat
static static getStudipMarkups ()
 
static addStudipMarkup ($name, $start, $end, $callback, $before=null)
 
static getStudipMarkup ($name)
 
static removeStudipMarkup ($name)
 

Static Protected Member Functions

static markupWikiComments ($markup, $matches)
 
static markupWikiLinks ($markup, $matches)
 

Additional Inherited Members

- Protected Member Functions inherited from TextFormat
 formatParts ($text, &$parts, $open_rule=NULL)
 

Constructor & Destructor Documentation

__construct ( )

Initializes a new WikiFormat instance.

Member Function Documentation

static static addWikiMarkup (   $name,
  $start,
  $end,
  $callback,
  $before = null 
)
static

Adds a new markup rule to the wiki markup set. This can also be used to replace an existing markup rule. The end regular expression is optional (i.e. may be NULL) to indicate that this rule has an empty content model. The callback is called whenever the rule matches and is passed the following arguments:

  • $markup the markup parser object
  • $matches match results of preg_match for $start
  • $contents (parsed) contents of this markup rule

Sometimes you may want your rule to apply before another specific rule will apply. For this case the parameter $before defines a rulename of existing markup, before which your rule should apply.

Parameters
string$namename of this rule
string$startstart regular expression
string$endend regular expression (optional)
callback$callbackfunction generating output of this rule
string$beforemark before which rule this rule should be appended
static getWikiMarkup (   $name)
static

Returns a single markup-rule if it exists.

Returns
array: array('start' => "...", 'end' => "...", 'callback' => "...")
static markupWikiComments (   $markup,
  $matches 
)
staticprotected

Stud.IP markup for wiki-comments

Parameters
StudipFormat$markupMarkup object
array$matchesFound matches
Returns
string
static markupWikiLinks (   $markup,
  $matches 
)
staticprotected

Stud.IP markup for wiki links

Parameters
StudipFormat$markupMarkup object
array$matchesFound matches
Returns
string
static removeWikiMarkup (   $name)
static

Removes a markup rule from the wiki markup set.

Parameters
string$nameName of the rule

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