Simplewiki 1
|
$emitter = new SimpleWiki_Emitter() - create new instance of emitter
$html = $emitter->emit($dom); see Muster_SimpleWiki_DocNode for docnode type documentation.
More...
Public Member Functions | |
Property accessors | |
symlinks () | |
returns registered symlinks | |
symlink_handler () | |
returns registered symlink handler | |
blocktags ($blocktaglist=NULL) | |
get or set collection of block declarations recognized by emitter | |
Register callouts | |
Clients register callouts for classes, macros, symlinks, and events. All callbacks are passed nodes | |
register_events ($callbacks) | |
['event']=>'methodref'. | |
register_symlinks ($symlinks) | |
[$symlink]=>$value. | |
register_symlink_handler ($handler) | |
Default handler for symlinks not registered: array($objectref,'methodname'). | |
register_charfilter_handler ($handler) | |
Handler for rawlinks: array($objectref,'methodname'). | |
register_rawlink_handler ($handler) | |
Handler for rawlinks: array($objectref,'methodname'). | |
register_class_callouts ($callouts) | |
[$nodetype][$classname]=>$methodref. | |
register_property_callouts ($callouts) | |
[$nodetype][$propertyname]=>$methodref. | |
register_macro_callouts ($callouts) | |
[$macroname]=>$methodref. | |
register_blockdef_handler ($handler) | |
Handler for block definitions: array($objectref,'methodname'). | |
Protected Member Functions | |
Invoke callouts | |
expand_symlink ($node) | |
triggered from prepare_link_node. | |
expand_rawlink ($node) | |
triggered from prepare_link_node. | |
call_macro ($node) | |
triggered from prepare_macro. | |
call_classes ($node) | |
triggered from prepare_node. | |
call_properties ($node) | |
triggered from prepare_node. | |
call_event ($event, $node) | |
triggered from _document_emit | |
Support methods | |
prepare_image_node ($node) | |
interpret address, inlcuding symlink; prepare src, alt, title attributes. | |
prepare_link_node ($node) | |
identify anchor for special handling; prepare attributes - name, href, title. | |
prepare_macro_node ($node) | |
trigger callouts; prepare output property | |
prepare_node ($node) | |
Standard data preparation for emitting html. | |
standard_assembly ($node) | |
Assembles and returns standard node html components. | |
char_filter ($text, $node=NULL) | |
Filters text with htmlspecialchars($text) by default. | |
Node emitters | |
_document_emit ($node) | |
emit html for document. | |
_paragraph_emit ($node) | |
emit html for paragraph. | |
_text_emit ($node) | |
emit html for text node. | |
_heading_emit ($node) | |
emit html for heading. | |
_emphasis_emit ($node) | |
emit html for emphasis. | |
_strong_emit ($node) | |
emit html for strong. | |
_linebreak_emit ($node) | |
emit html for linebreak. | |
_horizontalrule_emit ($node) | |
emit html for horizontalrule. | |
_link_emit ($node) | |
emit html for link. | |
_image_emit ($node) | |
emit html for image. | |
_def_list_emit ($node) | |
emit html for definition list. | |
_def_term_emit ($node) | |
emit html for definition term. | |
_def_desc_emit ($node) | |
emit html for definition description. | |
_ordered_list_emit ($node) | |
emit html for ordered list. | |
_unordered_list_emit ($node) | |
emit html for unordered list. | |
_list_item_emit ($node) | |
emit html for list item. | |
_table_emit ($node) | |
emit html for table. | |
_table_row_emit ($node) | |
emit html for table row. | |
_table_headcell_emit ($node) | |
emit html for table head cell. | |
_table_cell_emit ($node) | |
emit html for table data cell. | |
_span_emit ($node) | |
emit html for span. | |
_blockdivider_emit ($node) | |
emit html for block divider. | |
_code_emit ($node) | |
emit html for code. | |
_preformatted_emit ($node) | |
emit html for preformatted. | |
_blockdef_emit ($node) | |
emit html for blockdef. | |
_macro_emit ($node) | |
emit html for macro. | |
Protected Attributes | |
Data properties | |
$_dom | |
document object model, through the root node | |
$_rules | |
regex rules combined into applied regular expressions | |
$_link_re | |
link regular expressions, external link, symlink, and anchor | |
$_image_re | |
image link regular expressions, external link and symlink | |
$_blocktags | |
supported block tags | |
Registered data | |
$_class_callouts = array() | |
[$nodetype][$classname]=>$methodref | |
$_property_callouts = array() | |
[$nodetype][$propertyname]=>$methodref | |
$_macro_callouts = array() | |
[$macroname]=>$methodref | |
$_symlinks = array() | |
[$symlink]=>$value | |
$_symlink_handler | |
array($objectref,'methodname') | |
$_rawlink_handler | |
array($objectref,'methodname') | |
$_charfilter_handler | |
array($objectref,'methodname') | |
$_events = array() | |
['event']=>'methodref' | |
$_blockdef_handler | |
array($objectref,'methodname') | |
Creation | |
__construct () | |
The constructor. | |
set_rules () | |
Sets rules used in the class. | |
set_re ($rules) | |
Sets the regelar expressions applied. | |
Control methods | |
emit ($dom) | |
generate html from the passed document object model. | |
emit_children ($node) | |
collects and returns html for chilren. | |
emit_node_text ($node) | |
text only, no html or other markup. | |
emit_node ($node) | |
controller directs flow to one of the node emit methods. | |
emit_children_text ($node) | |
supports emit_node_text. |
$emitter = new SimpleWiki_Emitter() - create new instance of emitter
$html = $emitter->emit($dom); see Muster_SimpleWiki_DocNode for docnode type documentation.
Definition at line 17 of file muster_simplewiki_emitter.php.
__construct | ( | ) |
The constructor.
Sets regex rules, and combines them into applied regex. No parameters.
Definition at line 64 of file muster_simplewiki_emitter.php.
_blockdef_emit | ( | $ | node | ) | [protected] |
emit html for blockdef.
object | $node | document node |
Definition at line 976 of file muster_simplewiki_emitter.php.
_blockdivider_emit | ( | $ | node | ) | [protected] |
emit html for block divider.
object | $node | document node |
Definition at line 930 of file muster_simplewiki_emitter.php.
_code_emit | ( | $ | node | ) | [protected] |
emit html for code.
object | $node | document node |
Definition at line 944 of file muster_simplewiki_emitter.php.
_def_desc_emit | ( | $ | node | ) | [protected] |
emit html for definition description.
object | $node | document node |
Definition at line 807 of file muster_simplewiki_emitter.php.
_def_list_emit | ( | $ | node | ) | [protected] |
emit html for definition list.
object | $node | document node |
Definition at line 781 of file muster_simplewiki_emitter.php.
_def_term_emit | ( | $ | node | ) | [protected] |
emit html for definition term.
object | $node | document node |
Definition at line 794 of file muster_simplewiki_emitter.php.
_document_emit | ( | $ | node | ) | [protected] |
emit html for document.
object | $node | document node |
Definition at line 596 of file muster_simplewiki_emitter.php.
_emphasis_emit | ( | $ | node | ) | [protected] |
emit html for emphasis.
object | $node | document node |
Definition at line 647 of file muster_simplewiki_emitter.php.
_heading_emit | ( | $ | node | ) | [protected] |
emit html for heading.
object | $node | document node |
Definition at line 634 of file muster_simplewiki_emitter.php.
_horizontalrule_emit | ( | $ | node | ) | [protected] |
emit html for horizontalrule.
object | $node | document node |
Definition at line 671 of file muster_simplewiki_emitter.php.
_image_emit | ( | $ | node | ) | [protected] |
emit html for image.
object | $node | document node |
Definition at line 742 of file muster_simplewiki_emitter.php.
_linebreak_emit | ( | $ | node | ) | [protected] |
emit html for linebreak.
object | $node | document node |
Definition at line 663 of file muster_simplewiki_emitter.php.
_link_emit | ( | $ | node | ) | [protected] |
emit html for link.
object | $node | document node |
Definition at line 680 of file muster_simplewiki_emitter.php.
_list_item_emit | ( | $ | node | ) | [protected] |
emit html for list item.
object | $node | document node |
Definition at line 848 of file muster_simplewiki_emitter.php.
_macro_emit | ( | $ | node | ) | [protected] |
emit html for macro.
object | $node | document node |
Definition at line 1019 of file muster_simplewiki_emitter.php.
_ordered_list_emit | ( | $ | node | ) | [protected] |
emit html for ordered list.
object | $node | document node |
Definition at line 820 of file muster_simplewiki_emitter.php.
_paragraph_emit | ( | $ | node | ) | [protected] |
emit html for paragraph.
object | $node | document node |
Definition at line 611 of file muster_simplewiki_emitter.php.
_preformatted_emit | ( | $ | node | ) | [protected] |
emit html for preformatted.
object | $node | document node |
Definition at line 959 of file muster_simplewiki_emitter.php.
_span_emit | ( | $ | node | ) | [protected] |
emit html for span.
object | $node | document node |
Definition at line 916 of file muster_simplewiki_emitter.php.
_strong_emit | ( | $ | node | ) | [protected] |
emit html for strong.
object | $node | document node |
Definition at line 655 of file muster_simplewiki_emitter.php.
_table_cell_emit | ( | $ | node | ) | [protected] |
emit html for table data cell.
object | $node | document node |
Definition at line 901 of file muster_simplewiki_emitter.php.
_table_emit | ( | $ | node | ) | [protected] |
emit html for table.
object | $node | document node |
Definition at line 862 of file muster_simplewiki_emitter.php.
_table_headcell_emit | ( | $ | node | ) | [protected] |
emit html for table head cell.
object | $node | document node |
Definition at line 888 of file muster_simplewiki_emitter.php.
_table_row_emit | ( | $ | node | ) | [protected] |
emit html for table row.
object | $node | document node |
Definition at line 875 of file muster_simplewiki_emitter.php.
_text_emit | ( | $ | node | ) | [protected] |
emit html for text node.
object | $node | document node |
Definition at line 624 of file muster_simplewiki_emitter.php.
_unordered_list_emit | ( | $ | node | ) | [protected] |
emit html for unordered list.
object | $node | document node |
Definition at line 835 of file muster_simplewiki_emitter.php.
blocktags | ( | $ | blocktaglist = NULL | ) |
get or set collection of block declarations recognized by emitter
Definition at line 172 of file muster_simplewiki_emitter.php.
call_classes | ( | $ | node | ) | [protected] |
triggered from prepare_node.
Definition at line 353 of file muster_simplewiki_emitter.php.
call_event | ( | $ | event, |
$ | node | ||
) | [protected] |
triggered from _document_emit
string | $event | the event being triggered |
object | $node | the current document node |
Definition at line 404 of file muster_simplewiki_emitter.php.
call_macro | ( | $ | node | ) | [protected] |
triggered from prepare_macro.
object | $node | the current document node |
Definition at line 339 of file muster_simplewiki_emitter.php.
call_properties | ( | $ | node | ) | [protected] |
triggered from prepare_node.
object | $node | the current document node |
Definition at line 378 of file muster_simplewiki_emitter.php.
char_filter | ( | $ | text, |
$ | node = NULL |
||
) | [protected] |
Filters text with htmlspecialchars($text) by default.
But allows substitution of alternate or custom character filters.
Definition at line 578 of file muster_simplewiki_emitter.php.
emit | ( | $ | dom | ) |
generate html from the passed document object model.
object | $dom | the root node of the document object model for which html is being emitted. |
Definition at line 107 of file muster_simplewiki_emitter.php.
emit_children | ( | $ | node | ) |
collects and returns html for chilren.
Can be useful for registered method classes, macros and events, so it is public.
object | $node |
Definition at line 125 of file muster_simplewiki_emitter.php.
emit_children_text | ( | $ | node | ) | [protected] |
supports emit_node_text.
text only, no html or other markup, helpful for registrants.
Definition at line 148 of file muster_simplewiki_emitter.php.
emit_node | ( | $ | node | ) | [protected] |
controller directs flow to one of the node emit methods.
object | $node |
Definition at line 116 of file muster_simplewiki_emitter.php.
emit_node_text | ( | $ | node | ) |
text only, no html or other markup.
Can be helpful for registrants, so it is public.
Definition at line 138 of file muster_simplewiki_emitter.php.
expand_rawlink | ( | $ | node | ) | [protected] |
triggered from prepare_link_node.
object | $node | the current document node |
Definition at line 324 of file muster_simplewiki_emitter.php.
expand_symlink | ( | $ | node | ) | [protected] |
triggered from prepare_link_node.
object | $node | the current document node |
Definition at line 306 of file muster_simplewiki_emitter.php.
prepare_image_node | ( | $ | node | ) | [protected] |
interpret address, inlcuding symlink; prepare src, alt, title attributes.
Then call standard prepare_node
object | $node | the current document node |
Definition at line 428 of file muster_simplewiki_emitter.php.
prepare_link_node | ( | $ | node | ) | [protected] |
identify anchor for special handling; prepare attributes - name, href, title.
Then call standard prepare_node
object | $node |
Definition at line 471 of file muster_simplewiki_emitter.php.
prepare_macro_node | ( | $ | node | ) | [protected] |
trigger callouts; prepare output property
object | $node | document node |
Definition at line 515 of file muster_simplewiki_emitter.php.
prepare_node | ( | $ | node | ) | [protected] |
Standard data preparation for emitting html.
trigger class and property callouts; prepare attributes, classes, and styles for HTML by combining into single attribute array
object | $node | document node |
Definition at line 531 of file muster_simplewiki_emitter.php.
register_blockdef_handler | ( | $ | handler | ) |
Handler for block definitions: array($objectref,'methodname').
$param methodref $handler normally array($object,'methodname')
Definition at line 294 of file muster_simplewiki_emitter.php.
register_charfilter_handler | ( | $ | handler | ) |
Handler for rawlinks: array($objectref,'methodname').
Definition at line 219 of file muster_simplewiki_emitter.php.
register_class_callouts | ( | $ | callouts | ) |
[$nodetype][$classname]=>$methodref.
Typically called by SimpleWiki (as facade). One callback per type class.
Definition at line 233 of file muster_simplewiki_emitter.php.
register_events | ( | $ | callbacks | ) |
['event']=>'methodref'.
Definition at line 186 of file muster_simplewiki_emitter.php.
register_macro_callouts | ( | $ | callouts | ) |
[$macroname]=>$methodref.
Typically called by SimpleWiki (as facade).
Definition at line 280 of file muster_simplewiki_emitter.php.
register_property_callouts | ( | $ | callouts | ) |
[$nodetype][$propertyname]=>$methodref.
Typically called by SimpleWiki (as facade). One callback per type class.
Definition at line 257 of file muster_simplewiki_emitter.php.
register_rawlink_handler | ( | $ | handler | ) |
Handler for rawlinks: array($objectref,'methodname').
Definition at line 226 of file muster_simplewiki_emitter.php.
register_symlink_handler | ( | $ | handler | ) |
Default handler for symlinks not registered: array($objectref,'methodname').
Definition at line 212 of file muster_simplewiki_emitter.php.
register_symlinks | ( | $ | symlinks | ) |
[$symlink]=>$value.
Definition at line 201 of file muster_simplewiki_emitter.php.
set_re | ( | $ | rules | ) | [protected] |
Sets the regelar expressions applied.
_link_re for link addresses; _image_re for image addresses (excludes anchors)
Definition at line 96 of file muster_simplewiki_emitter.php.
set_rules | ( | ) | [protected] |
Sets rules used in the class.
lists prototypes, sets regex for external url's, symlinks, and anchors
Definition at line 73 of file muster_simplewiki_emitter.php.
standard_assembly | ( | $ | node | ) | [protected] |
Assembles and returns standard node html components.
opentag_head, node attributes, opentag_tail, elementcontent, and closetag.
object | $node | document node |
Definition at line 570 of file muster_simplewiki_emitter.php.
symlink_handler | ( | ) |
returns registered symlink handler
Definition at line 167 of file muster_simplewiki_emitter.php.
symlinks | ( | ) |
returns registered symlinks
Definition at line 162 of file muster_simplewiki_emitter.php.
$_blockdef_handler [protected] |
array($objectref,'methodname')
Definition at line 56 of file muster_simplewiki_emitter.php.
$_blocktags [protected] |
array ( 'div', 'blockquote', # division, blockquote 'table', 'thead', 'tbody', 'tr', 'td', 'th', 'tfoot', 'caption', # table 'ul', 'ol', 'li', 'dl', 'dt', 'dd', # lists 'dlmodule','dlwidget','dlsettings','dlmarker' #dlml )
supported block tags
Definition at line 29 of file muster_simplewiki_emitter.php.
$_charfilter_handler [protected] |
array($objectref,'methodname')
Definition at line 52 of file muster_simplewiki_emitter.php.
$_class_callouts = array() [protected] |
[$nodetype][$classname]=>$methodref
Definition at line 40 of file muster_simplewiki_emitter.php.
$_dom [protected] |
document object model, through the root node
Definition at line 21 of file muster_simplewiki_emitter.php.
$_events = array() [protected] |
['event']=>'methodref'
Definition at line 54 of file muster_simplewiki_emitter.php.
$_image_re [protected] |
image link regular expressions, external link and symlink
Definition at line 27 of file muster_simplewiki_emitter.php.
$_link_re [protected] |
link regular expressions, external link, symlink, and anchor
Definition at line 25 of file muster_simplewiki_emitter.php.
$_macro_callouts = array() [protected] |
[$macroname]=>$methodref
Definition at line 44 of file muster_simplewiki_emitter.php.
$_property_callouts = array() [protected] |
[$nodetype][$propertyname]=>$methodref
Definition at line 42 of file muster_simplewiki_emitter.php.
$_rawlink_handler [protected] |
array($objectref,'methodname')
Definition at line 50 of file muster_simplewiki_emitter.php.
$_rules [protected] |
regex rules combined into applied regular expressions
Definition at line 23 of file muster_simplewiki_emitter.php.
$_symlink_handler [protected] |
array($objectref,'methodname')
Definition at line 48 of file muster_simplewiki_emitter.php.
$_symlinks = array() [protected] |
[$symlink]=>$value
Definition at line 46 of file muster_simplewiki_emitter.php.