[ Index ]

PHP Cross Reference of DokuWiki

title

Body

[close]

/inc/parser/ -> xhtml.php (summary)

(no description)

File Size: 1992 lines (64 kb)
Included or required: 1 time
Referenced: 1 time
Includes or requires: 2 files
 inc/JpegMeta.php
 inc/FeedParser.php

Defines 1 class

Doku_Renderer_xhtml:: (92 methods):
  startSectionEdit()
  finishSectionEdit()
  getFormat()
  document_start()
  document_end()
  toc_additem()
  header()
  section_open()
  section_close()
  cdata()
  p_open()
  p_close()
  linebreak()
  hr()
  strong_open()
  strong_close()
  emphasis_open()
  emphasis_close()
  underline_open()
  underline_close()
  monospace_open()
  monospace_close()
  subscript_open()
  subscript_close()
  superscript_open()
  superscript_close()
  deleted_open()
  deleted_close()
  footnote_open()
  footnote_close()
  listu_open()
  listu_close()
  listo_open()
  listo_close()
  listitem_open()
  listitem_close()
  listcontent_open()
  listcontent_close()
  unformatted()
  php()
  phpblock()
  html()
  htmlblock()
  quote_open()
  quote_close()
  preformatted()
  file()
  code()
  _highlight()
  acronym()
  smiley()
  entity()
  multiplyentity()
  singlequoteopening()
  singlequoteclosing()
  apostrophe()
  doublequoteopening()
  doublequoteclosing()
  camelcaselink()
  locallink()
  internallink()
  externallink()
  interwikilink()
  windowssharelink()
  emaillink()
  internalmedia()
  externalmedia()
  rss()
  table_open()
  table_close()
  tablethead_open()
  tablethead_close()
  tabletbody_open()
  tabletbody_close()
  tabletfoot_open()
  tabletfoot_close()
  tablerow_open()
  tablerow_close()
  tableheader_open()
  tableheader_close()
  tablecell_open()
  tablecell_close()
  getLastlevel()
  _formatLink()
  _media()
  _xmlEntities()
  _getLinkTitle()
  _imageTitle()
  _getMediaLinkConf()
  _video()
  _audio()
  _getLastMediaRevisionAt()


Class: Doku_Renderer_xhtml  - X-Ref

Renderer for XHTML output

This is DokuWiki's main renderer used to display page content in the wiki

startSectionEdit($start, $data)   X-Ref
Register a new edit section range

param: int    $start  The byte position for the edit start
param: array  $data   Associative array with section data:
return: string  A marker class for the starting HTML element
author: Adrian Lang <lang@cosmocode.de>

finishSectionEdit($end = null, $hid = null)   X-Ref
Finish an edit section range

param: int  $end     The byte position for the edit end; null for the rest of the page
author: Adrian Lang <lang@cosmocode.de>

getFormat()   X-Ref
Returns the format produced by this renderer.

return: string always 'xhtml'

document_start()   X-Ref
Initialize the document


document_end()   X-Ref
Finalize the document


toc_additem($id, $text, $level)   X-Ref
Add an item to the TOC

param: string $id       the hash link
param: string $text     the text to display
param: int    $level    the nesting level

header($text, $level, $pos)   X-Ref
Render a heading

param: string $text  the text to display
param: int    $level header level
param: int    $pos   byte position in the original source

section_open($level)   X-Ref
Open a new section

param: int $level section level (as determined by the previous header)

section_close()   X-Ref
Close the current section


cdata($text)   X-Ref
Render plain text data

param: $text

p_open()   X-Ref
Open a paragraph


p_close()   X-Ref
Close a paragraph


linebreak()   X-Ref
Create a line break


hr()   X-Ref
Create a horizontal line


strong_open()   X-Ref
Start strong (bold) formatting


strong_close()   X-Ref
Stop strong (bold) formatting


emphasis_open()   X-Ref
Start emphasis (italics) formatting


emphasis_close()   X-Ref
Stop emphasis (italics) formatting


underline_open()   X-Ref
Start underline formatting


underline_close()   X-Ref
Stop underline formatting


monospace_open()   X-Ref
Start monospace formatting


monospace_close()   X-Ref
Stop monospace formatting


subscript_open()   X-Ref
Start a subscript


subscript_close()   X-Ref
Stop a subscript


superscript_open()   X-Ref
Start a superscript


superscript_close()   X-Ref
Stop a superscript


deleted_open()   X-Ref
Start deleted (strike-through) formatting


deleted_close()   X-Ref
Stop deleted (strike-through) formatting


footnote_open()   X-Ref
Callback for footnote start syntax

All following content will go to the footnote instead of
the document. To achieve this the previous rendered content
is moved to $store and $doc is cleared

author: Andreas Gohr <andi@splitbrain.org>

footnote_close()   X-Ref
Callback for footnote end syntax

All rendered content is moved to the $footnotes array and the old
content is restored from $store again

author: Andreas Gohr

listu_open($classes = null)   X-Ref
Open an unordered list

param: string|string[] $classes css classes - have to be valid, do not pass unfiltered user input

listu_close()   X-Ref
Close an unordered list


listo_open($classes = null)   X-Ref
Open an ordered list

param: string|string[] $classes css classes - have to be valid, do not pass unfiltered user input

listo_close()   X-Ref
Close an ordered list


listitem_open($level, $node=false)   X-Ref
Open a list item

param: int $level the nesting level
param: bool $node true when a node; false when a leaf

listitem_close()   X-Ref
Close a list item


listcontent_open()   X-Ref
Start the content of a list item


listcontent_close()   X-Ref
Stop the content of a list item


unformatted($text)   X-Ref
Output unformatted $text

Defaults to $this->cdata()

param: string $text

php($text, $wrapper = 'code')   X-Ref
Execute PHP code if allowed

param: string $text      PHP code that is either executed or printed
param: string $wrapper   html element to wrap result if $conf['phpok'] is okff
author: Andreas Gohr <andi@splitbrain.org>

phpblock($text)   X-Ref
Output block level PHP code

If $conf['phpok'] is true this should evaluate the given code and append the result
to $doc

param: string $text The PHP code

html($text, $wrapper = 'code')   X-Ref
Insert HTML if allowed

param: string $text      html text
param: string $wrapper   html element to wrap result if $conf['htmlok'] is okff
author: Andreas Gohr <andi@splitbrain.org>

htmlblock($text)   X-Ref
Output raw block-level HTML

If $conf['htmlok'] is true this should add the code as is to $doc

param: string $text The HTML

quote_open()   X-Ref
Start a block quote


quote_close()   X-Ref
Stop a block quote


preformatted($text)   X-Ref
Output preformatted text

param: string $text

file($text, $language = null, $filename = null, $options=null)   X-Ref
Display text as file content, optionally syntax highlighted

param: string $text     text to show
param: string $language programming language to use for syntax highlighting
param: string $filename file path label
param: array  $options  assoziative array with additional geshi options

code($text, $language = null, $filename = null, $options=null)   X-Ref
Display text as code content, optionally syntax highlighted

param: string $text     text to show
param: string $language programming language to use for syntax highlighting
param: string $filename file path label
param: array  $options  assoziative array with additional geshi options

_highlight($type, $text, $language = null, $filename = null, $options = null)   X-Ref
Use GeSHi to highlight language syntax in code and file blocks

param: string $type     code|file
param: string $text     text to show
param: string $language programming language to use for syntax highlighting
param: string $filename file path label
param: array  $options  assoziative array with additional geshi options
author: Andreas Gohr <andi@splitbrain.org>

acronym($acronym)   X-Ref
Format an acronym

Uses $this->acronyms

param: string $acronym

smiley($smiley)   X-Ref
Format a smiley

Uses $this->smiley

param: string $smiley

entity($entity)   X-Ref
Format an entity

Entities are basically small text replacements

Uses $this->entities

param: string $entity

multiplyentity($x, $y)   X-Ref
Typographically format a multiply sign

Example: ($x=640, $y=480) should result in "640×480"

param: string|int $x first value
param: string|int $y second value

singlequoteopening()   X-Ref
Render an opening single quote char (language specific)


singlequoteclosing()   X-Ref
Render a closing single quote char (language specific)


apostrophe()   X-Ref
Render an apostrophe char (language specific)


doublequoteopening()   X-Ref
Render an opening double quote char (language specific)


doublequoteclosing()   X-Ref
Render an closinging double quote char (language specific)


camelcaselink($link, $returnonly = false)   X-Ref
Render a CamelCase link

param: string $link       The link name
param: bool   $returnonly whether to return html or write to doc attribute
return: void|string writes to doc attribute or returns html depends on $returnonly
see: http://en.wikipedia.org/wiki/CamelCase

locallink($hash, $name = null, $returnonly = false)   X-Ref
Render a page local link

param: string $hash       hash link identifier
param: string $name       name for the link
param: bool   $returnonly whether to return html or write to doc attribute
return: void|string writes to doc attribute or returns html depends on $returnonly

internallink($id, $name = null, $search = null, $returnonly = false, $linktype = 'content')   X-Ref
Render an internal Wiki Link

$search,$returnonly & $linktype are not for the renderer but are used
elsewhere - no need to implement them in other renderers

param: string      $id         pageid
param: string|null $name       link name
param: string|null $search     adds search url param
param: bool        $returnonly whether to return html or write to doc attribute
param: string      $linktype   type to set use of headings
return: void|string writes to doc attribute or returns html depends on $returnonly
author: Andreas Gohr <andi@splitbrain.org>

externallink($url, $name = null, $returnonly = false)   X-Ref
Render an external link

param: string       $url        full URL with scheme
param: string|array $name       name for the link, array for media file
param: bool         $returnonly whether to return html or write to doc attribute
return: void|string writes to doc attribute or returns html depends on $returnonly

interwikilink($match, $name, $wikiName, $wikiUri, $returnonly = false)   X-Ref
Render an interwiki link

You may want to use $this->_resolveInterWiki() here

param: string       $match      original link - probably not much use
param: string|array $name       name for the link, array for media file
param: string       $wikiName   indentifier (shortcut) for the remote wiki
param: string       $wikiUri    the fragment parsed from the original link
param: bool         $returnonly whether to return html or write to doc attribute
return: void|string writes to doc attribute or returns html depends on $returnonly

windowssharelink($url, $name = null, $returnonly = false)   X-Ref
Link to windows share

param: string       $url        the link
param: string|array $name       name for the link, array for media file
param: bool         $returnonly whether to return html or write to doc attribute
return: void|string writes to doc attribute or returns html depends on $returnonly

emaillink($address, $name = null, $returnonly = false)   X-Ref
Render a linked E-Mail Address

Honors $conf['mailguard'] setting

param: string       $address    Email-Address
param: string|array $name       name for the link, array for media file
param: bool         $returnonly whether to return html or write to doc attribute
return: void|string writes to doc attribute or returns html depends on $returnonly

internalmedia($src, $title = null, $align = null, $width = null,$height = null, $cache = null, $linking = null, $return = false)   X-Ref
Render an internal media file

param: string $src       media ID
param: string $title     descriptive text
param: string $align     left|center|right
param: int    $width     width of media in pixel
param: int    $height    height of media in pixel
param: string $cache     cache|recache|nocache
param: string $linking   linkonly|detail|nolink
param: bool   $return    return HTML instead of adding to $doc
return: void|string writes to doc attribute or returns html depends on $return

externalmedia($src, $title = null, $align = null, $width = null,$height = null, $cache = null, $linking = null, $return = false)   X-Ref
Render an external media file

param: string $src     full media URL
param: string $title   descriptive text
param: string $align   left|center|right
param: int    $width   width of media in pixel
param: int    $height  height of media in pixel
param: string $cache   cache|recache|nocache
param: string $linking linkonly|detail|nolink
param: bool   $return  return HTML instead of adding to $doc
return: void|string writes to doc attribute or returns html depends on $return

rss($url, $params)   X-Ref
Renders an RSS feed

param: string $url    URL of the feed
param: array  $params Finetuning of the output
author: Andreas Gohr <andi@splitbrain.org>

table_open($maxcols = null, $numrows = null, $pos = null, $classes = null)   X-Ref
Start a table

param: int $maxcols maximum number of columns
param: int $numrows NOT IMPLEMENTED
param: int $pos byte position in the original source
param: string|string[] $classes css classes - have to be valid, do not pass unfiltered user input

table_close($pos = null)   X-Ref
Close a table

param: int $pos byte position in the original source

tablethead_open()   X-Ref
Open a table header


tablethead_close()   X-Ref
Close a table header


tabletbody_open()   X-Ref
Open a table body


tabletbody_close()   X-Ref
Close a table body


tabletfoot_open()   X-Ref
Open a table footer


tabletfoot_close()   X-Ref
Close a table footer


tablerow_open($classes = null)   X-Ref
Open a table row

param: string|string[] $classes css classes - have to be valid, do not pass unfiltered user input

tablerow_close()   X-Ref
Close a table row


tableheader_open($colspan = 1, $align = null, $rowspan = 1, $classes = null)   X-Ref
Open a table header cell

param: int    $colspan
param: string $align left|center|right
param: int    $rowspan
param: string|string[] $classes css classes - have to be valid, do not pass unfiltered user input

tableheader_close()   X-Ref
Close a table header cell


tablecell_open($colspan = 1, $align = null, $rowspan = 1, $classes = null)   X-Ref
Open a table cell

param: int       $colspan
param: string    $align left|center|right
param: int       $rowspan
param: string|string[]    $classes css classes - have to be valid, do not pass unfiltered user input

tablecell_close()   X-Ref
Close a table cell


getLastlevel()   X-Ref
Returns the current header level.
(required e.g. by the filelist plugin)

return: int The current header level

_formatLink($link)   X-Ref
Build a link

Assembles all parts defined in $link returns HTML for the link

param: array $link attributes of a link
return: string
author: Andreas Gohr <andi@splitbrain.org>

_media($src, $title = null, $align = null, $width = null,$height = null, $cache = null, $render = true)   X-Ref
Renders internal and external media

param: string $src       media ID
param: string $title     descriptive text
param: string $align     left|center|right
param: int    $width     width of media in pixel
param: int    $height    height of media in pixel
param: string $cache     cache|recache|nocache
param: bool   $render    should the media be embedded inline or just linked
return: string
author: Andreas Gohr <andi@splitbrain.org>

_xmlEntities($string)   X-Ref
Escape string for output

param: $string
return: string

_getLinkTitle($title, $default, &$isImage, $id = null, $linktype = 'content')   X-Ref
Construct a title and handle images in titles

param: string|array $title    either string title or media array
param: string       $default  default title if nothing else is found
param: bool         $isImage  will be set to true if it's a media file
param: null|string  $id       linked page id (used to extract title from first heading)
param: string       $linktype content|navigation
return: string      HTML of the title, might be full image tag or just escaped text
author: Harry Fuecks <hfuecks@gmail.com>

_imageTitle($img)   X-Ref
Returns HTML code for images used in link titles

param: array $img
return: string HTML img tag or similar
author: Andreas Gohr <andi@splitbrain.org>

_getMediaLinkConf($src, $title, $align, $width, $height, $cache, $render)   X-Ref
helperfunction to return a basic link to a media

used in internalmedia() and externalmedia()

param: string $src       media ID
param: string $title     descriptive text
param: string $align     left|center|right
param: int    $width     width of media in pixel
param: int    $height    height of media in pixel
param: string $cache     cache|recache|nocache
param: bool   $render    should the media be embedded inline or just linked
return: array associative array with link config
author: Pierre Spring <pierre.spring@liip.ch>

_video($src, $width, $height, $atts = null)   X-Ref
Embed video(s) in HTML

param: string $src         - ID of video to embed
param: int    $width       - width of the video in pixels
param: int    $height      - height of the video in pixels
param: array  $atts        - additional attributes for the <video> tag
return: string
author: Anika Henke <anika@selfthinker.org>
author: Schplurtz le Déboulonné <Schplurtz@laposte.net>

_audio($src, $atts = array()   X-Ref
Embed audio in HTML

param: string $src       - ID of audio to embed
param: array  $atts      - additional attributes for the <audio> tag
return: string
author: Anika Henke <anika@selfthinker.org>

_getLastMediaRevisionAt($media_id)   X-Ref
_getLastMediaRevisionAt is a helperfunction to internalmedia() and _media()
which returns an existing media revision less or equal to rev or date_at

param: string $media_id
return: string revision ('' for current)
author: lisps