internal package Foswiki::Plugins::TablePlugin

See PublishedAPI for packages intended to be used by Plugin and Contrib authors, or browse all packages.
See also Developing plugins, Developer's Bible, Technical Overview

StaticMethod initialiseWhenRender() → 1

Official API call for TablePlugin. Other plugins can reinitialise the plugin which will reset all table counters etc next time the preRenderingHandler is run. The preRenderingHandler is called again when a plugin uses the Foswiki::Func::renderText method. A plugin like CompareRevisionsAddOn uses initialiseWhenRender between the rendering of two revisions of the same topic to avoid table numbers to continue counting up when rendering the topic the second time.

Example of use in a plugin taking care to check for TablePlugin being installed and being of a version that contains this method. Otherwise using a "mother of hacks" to get to the same result.

if ( defined &Foswiki::Plugins::TablePlugin::initPlugin ) { if ( defined &Foswiki::Plugins::TablePlugin::initialiseWhenRender ) { Foswiki::Plugins::TablePlugin::initialiseWhenRender(); } else { # If TablePlugin does not have the reinitialise API # we use try a shameless hack instead if ( defined $Foswiki::Plugins::TablePlugin::initialised ) { $Foswiki::Plugins::TablePlugin::initialised = 0; } } }

Read in plugin settings from TABLEPLUGIN_TABLEATTRIBUTES TABLEATTRIBUTES are no longer supported (NO_PREFS_IN_TOPIC). If no settings are found, use the default settings from configure. And if these cannot be read, use the default values defined here in this plugin.

Settings are applied by the principle of 'filling in the gaps'

addHeadStyles( $id, \@styles )

Store list of CSS lines to be written.

Shorthand debugging call.

Topic revision: r1 - 22 Jan 2018, UnknownUser
This site is powered by FoswikiCopyright © by the contributing authors. All material on this site is the property of the contributing authors.
Ideas, requests, problems regarding Hubert's Wiki? Send feedback