Line: 118 to 118 | |||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Added: | |||||||||||||||||||||
> > | ObjectMethod dispatch ($handlerName,...)Dispatch the given handler, passing on ... in the parameter vector | ||||||||||||||||||||
ObjectMethod haveHandlerFor ($handlerName) -> $boolean
| |||||||||||||||||||||
Line: 125 to 130 | |||||||||||||||||||||
this type. | |||||||||||||||||||||
Deleted: | |||||||||||||||||||||
< < |
ObjectMethod registrationHandler ()Called by the register script
ObjectMethod beforeCommonTagsHandler ()Called at the beginning (for cache Plugins only)
ObjectMethod commonTagsHandler ()Called after %INCLUDE:"..."%
ObjectMethod afterCommonTagsHandler ()Called at the end (for cache Plugins only)
ObjectMethod preRenderingHandler ($text,\%map)
Placeholders are text strings constructed using the tag name and a sequence number e.g. 'pre1', "verbatim6", "head1" etc. Placeholders are inserted into the text inside \1 characters so the text will contain \1_pre1\1 for placeholder pre1. Each removed block is represented by the block text and the parameters passed to the tag (usually empty) e.g. for <pre class='slobadob'> XYZ </pre>the map will contain: $removed->{'pre1'}{text}: XYZ $removed->{'pre1'}{params}: class="slobadob" Iterating over blocks for a single tag is easy. For example, to prepend a line number to every line of a pre block you might use this code:
foreach my $placeholder ( keys %$map ) { if( $placeholder =~ /^pre/i ) { my $n = 1; $map->{$placeholder}{text} =~ s/^/$n++/gem; } }
ObjectMethod postRenderingHandler (\$text)
ObjectMethod startRenderingHandler ()Called just before the line loop DEPRECATED Use preRenderingHandler instead. This handler correctly handles verbatim and other TWiki ML block types, and exposes them to the plugin.
ObjectMethod outsidePREHandler ()Called in line loop outside of <PRE> tag DEPRECATED Use preRenderingHandler instead. This handler correctly handles pre and other TWiki ML block types, and is called only once instead of line-by-line.
ObjectMethod insidePREHandler ()Called in line loop inside of <PRE> tag DEPRECATED Use preRenderingHandler instead. This handler correctly handles pre and other TWiki ML block types, and is called only once instead of line-by-line.
ObjectMethod endRenderingHandler ()Called just after the line loop DEPRECATED Use postRenderingHandler instead.
ObjectMethod beforeEditHandler ()Called by edit
ObjectMethod afterEditHandler ()Called by edit
ObjectMethod beforeSaveHandler ()Called just before the save action
ObjectMethod afterSaveHandler ()Called just after the save action
ObjectMethod afterRenameHandler ($oldWeb,$oldTopic,$oldAttachment,$newWeb,$newTopic,$newAttachment)Called just after the rename/move/delete action of a web, topic or attachment.
ObjectMethod mergeHandler ()Called to handle text merge.
ObjectMethod beforeAttachmentSaveHandler ($attrHashRef,$topic,$web)This code provides Plugins with the opportunity to alter an uploaded attachment between the upload and save-to-store processes. It is invoked as per other Plugins.
Keys in $attrHashRef:
Note: All keys should be used read-only, except for comment which can be modified. Example usage:
my( $attrHashRef, $topic, $web ) = @_; $$attrHashRef{'comment'} .= " (NOTE: Extracted from blah.tar.gz)";
ObjectMethod afterAttachmentSaveHandler ($attachmentAttrHash,$topic,$web,$error)deal with an uploaded attachment between the upload and save-to-store processes. It is invoked as per other plugins.
Keys in $attrHashRef:
Note: The hash is read-only
ObjectMethod writeHeaderHandler () -> $headersDEPRECATED Use modifyHeaderHandler instead. it is a lot more flexible, and allows you to modify existing headers as well as add new ones. It also works correctly when multiple plugins want to modify headers.
ObjectMethod modifyHeaderHandler (\@headers,$query)
ObjectMethod completePageHandler ($text,$pageType,$contentType)
ObjectMethod redirectCgiQueryHandler () -> $resultCalled by TWiki::redirect
ObjectMethod renderFormFieldForEditHandler ($name,$type,$size,$value,$attributes,$possibleValues) -> $htmlThis handler is called before built-in types are considered. It generates the HTML text rendering this form field, or false, if the rendering should be done by the built-in type handlers.
Note that a common application would be to generate formatting of the field involving generation of javascript. Such usually also requires the insertion of some common javascript into the page header. Unfortunately, there is currently no mechanism to pass that script to where the header of the page is visible. Consequentially, the common javascript may have to be emitted as part of the field formatting and might be duplicated many times throughout the page.
ObjectMethod renderWikiWordHandler () -> $resultChange how a WikiWord is rendered
Originated from the TWiki:Plugins.SpacedWikiWordPlugin |
Line: 70 to 70 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > | ObjectMethod finish ()Break circular references. | |||||||
ObjectMethod load ($allDisabled) -> $loginNameFind all active plugins, and invoke the early initialisation. | ||||||||
Line: 104 to 109 | ||||||||
ObjectMethod addListener ($command,$handler) | ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Add a listener to the end of the list of registered listeners for this event. | ||||||||
Line: 157 to 162 | ||||||||
XYZ | ||||||||
Added: | ||||||||
> > | ||||||||
the map will contain: | ||||||||
Changed: | ||||||||
< < | ||||||||
> > | ||||||||
$removed->{'pre1'}{text}: XYZ $removed->{'pre1'}{params}: class="slobadob" | ||||||||
Deleted: | ||||||||
< < | ||||||||
Iterating over blocks for a single tag is easy. For example, to prepend a line number to every line of a pre block you might use this code: | ||||||||
Added: | ||||||||
> > | ||||||||
foreach my $placeholder ( keys %$map ) { if( $placeholder =~ /^pre/i ) { my $n = 1; $map->{$placeholder}{text} =~ s/^/$n++/gem; } } | ||||||||
Added: | ||||||||
> > | ||||||||
Line: 268 to 275 | ||||||||
This code provides Plugins with the opportunity to alter an uploaded attachment between the upload and save-to-store processes. It is invoked as per other Plugins.
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Keys in $attrHashRef:
| ||||||||
Line: 294 to 301 | ||||||||
deal with an uploaded attachment between the upload and save-to-store processes. It is invoked as per other plugins.
| ||||||||
Changed: | ||||||||
< < |
| |||||||
> > |
| |||||||
Keys in $attrHashRef:
| ||||||||
Line: 311 to 318 | ||||||||
ObjectMethod writeHeaderHandler () -> $headers | ||||||||
Deleted: | ||||||||
< < | Called by TWiki::writePageHeader. DEPRECATED do not use! | |||||||
DEPRECATED Use modifyHeaderHandler instead. it is a lot more flexible, and allows you to modify existing headers as well as add new ones. It also works correctly when | ||||||||
Line: 324 to 329 | ||||||||
Added: | ||||||||
> > | ObjectMethod completePageHandler ($text,$pageType,$contentType) | |||||||
ObjectMethod redirectCgiQueryHandler () -> $resultCalled by TWiki::redirect |
Line: 12 to 12 | ||||||||
---|---|---|---|---|---|---|---|---|
Note that as of version 1.026 of this module, TWiki internal methods are no longer available to plugins. Any calls to TWiki internal methods must be replaced by calls via the | ||||||||
Changed: | ||||||||
< < | $SESSION object in this package, or via the Func package. | |||||||
> > | $SESSION object in this package, or via the Func package. | |||||||
For example, the call: | ||||||||
Changed: | ||||||||
< < | my $pref = TWiki::getPreferencesValue('URGH'); | |||||||
> > | my $pref = TWiki::getPreferencesValue('URGH'); | |||||||
should be replaced with | ||||||||
Changed: | ||||||||
< < | my $pref = TWiki::Func::getPreferencesValue('URGH'); | |||||||
> > | my $pref = TWiki::Func::getPreferencesValue('URGH'); | |||||||
and the call | ||||||||
Changed: | ||||||||
< < | my $t = TWiki::writeWarning($message); | |||||||
> > | my $t = TWiki::writeWarning($message); | |||||||
should be replaced with | ||||||||
Changed: | ||||||||
< < | my $pref = $TWiki::Plugins::SESSION->writeWarning($message); | |||||||
> > | my $pref = $TWiki::Plugins::SESSION->writeWarning($message); | |||||||
Methods in other modules such as Store must be accessed through the relevant TWiki sub-object, for example | ||||||||
Changed: | ||||||||
< < | TWiki::Store::saveTopic(...) | |||||||
> > | TWiki::Store::saveTopic(...) | |||||||
should be replaced with | ||||||||
Changed: | ||||||||
< < | $TWiki::Plugins::SESSION->{store}->saveTopic(...) | |||||||
> > | $TWiki::Plugins::SESSION->{store}->saveTopic(...) | |||||||
Note that calling TWiki internal methods is very very bad practice, and should be avoided wherever practical. | ||||||||
Line: 80 to 82 | ||||||||
Added: | ||||||||
> > | ObjectMethod settings ()Push plugin settings onto preference stack | |||||||
ObjectMethod enable ()Initialisation that is done after the user is known. | ||||||||
Line: 135 to 145 | ||||||||
Changed: | ||||||||
< < | ObjectMethd preRenderingHandler( $text, \%map ) | |||||||
> > | ObjectMethod preRenderingHandler ($text,\%map) | |||||||
| ||||||||
Line: 152 to 162 | ||||||||
$removed->{'pre1'}{text}: XYZ $removed->{'pre1'}{params}: class="slobadob" | ||||||||
Added: | ||||||||
> > | ||||||||
Iterating over blocks for a single tag is easy. For example, to prepend a line number to every line of a pre block you might use this code: | ||||||||
Line: 233 to 245 | ||||||||
Added: | ||||||||
> > | ObjectMethod afterRenameHandler ($oldWeb,$oldTopic,$oldAttachment,$newWeb,$newTopic,$newAttachment)Called just after the rename/move/delete action of a web, topic or attachment.
| |||||||
ObjectMethod mergeHandler ()Called to handle text merge. |
Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Added: | ||||||||
> > | Package
|