summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorchris <chris@teacherscpd.co.uk>2005-08-02 02:58:46 +0200
committerchris <chris@teacherscpd.co.uk>2005-08-02 02:58:46 +0200
commit4b8edb9d27253137965d9c07ac1b0abe1af3bc31 (patch)
tree1afe451319ca8319e7a5ab9961f60a1610b7beb4 /lib
parente2e0a40f4ecbcbecec1e482ee4a8770f3f5e0f5d (diff)
downloadrpg-4b8edb9d27253137965d9c07ac1b0abe1af3bc31.tar.gz
rpg-4b8edb9d27253137965d9c07ac1b0abe1af3bc31.tar.bz2
syntax plugin class prototypes : fixes to previous update
darcs-hash:20050802005846-50fdc-9e5ec3b31966b308543d5a16da10c1af22489553.gz
Diffstat (limited to 'lib')
-rw-r--r--lib/plugins/syntax.php21
1 files changed, 13 insertions, 8 deletions
diff --git a/lib/plugins/syntax.php b/lib/plugins/syntax.php
index 59b02d7dc..25d0c6c17 100644
--- a/lib/plugins/syntax.php
+++ b/lib/plugins/syntax.php
@@ -73,7 +73,9 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
/**
* Handler to prepare matched data for the rendering process
- * This function is called statically - it may not reference any object properties
+ *
+ * This function can only pass data to render() via its return value - render()
+ * may be not be run during the object's current life.
*
* Usually you should only need the $match param.
*
@@ -89,7 +91,10 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
/**
* Handles the actual output creation.
- * This function is called statically - it may not reference any object properties
+ *
+ * The function must not assume any other of the classes methods have been run
+ * during the object's current life. The only reliable data it receives are its
+ * parameters.
*
* The function should always check for the given mode and return false
* when a mode isn't supported.
@@ -109,28 +114,28 @@ class DokuWiki_Syntax_Plugin extends Doku_Parser_Mode {
*/
function render($mode, &$renderer, $data) {
trigger_error('render() not implemented in '.get_class($this), E_USER_WARNING);
+
}
/**
* There should be no need to override this function
*/
function accepts($mode) {
-
- if (!$allowedModesSetup) {
+
+ if (!$this->allowedModesSetup) {
global $PARSER_MODES;
$allowedModeTypes = $this->getAllowedTypes();
foreach($allowedModeTypes as $mt) {
- array_merge($this->allowedModes, $PARSER_MODES[$mt]);
+ $this->allowedModes = array_merge($this->allowedModes, $PARSER_MODES[$mt]);
}
unset($this->allowedModes[array_search(substr(get_class($this), 7), $this->allowedModes)]);
- $allowedModesSetup = true;
+ $this->allowedModesSetup = true;
}
return parent::accepts($mode);
}
}
-
-//Setup VIM: ex: et ts=4 enc=utf-8 :
+//Setup VIM: ex: et ts=4 enc=utf-8 : \ No newline at end of file