Package TWiki::Prefs::PrefsCache
The Prefs Cache? package holds a cache of topics that have been read in, using
the Topic Prefs? class. These functions manage that cache.
We maintain 2 hashes of values: - {locals} Contains all locals at this level. Locals are values that only apply when the current topic is the topic where the local is defined. The variable names are decorated with the locality where they apply.
- {values} contains all sets, locals, and all values inherited from the parent level
On this page:
- ClassMethod new ($prefs,$parent,$type,$web,$topic,$prefix)
- ObjectMethod finish ()
- ObjectMethod finalise ($parent)
- ObjectMethod loadPrefsFromTopic ($web,$topic,$keyPrefix)
- ObjectMethod loadPrefsFromText ($text,$meta,$web,$topic)
- ObjectMethod insert ($type,$key,$val) -> $boolean
- ObjectMethod stringify ($html,\%shown) -> $text
Class Method new ($prefs,$parent,$type,$web,$topic,$prefix)
Creates a new Prefs object.-
$prefs- controlling TWiki::Prefs object -
$parent- the Prefs Cache? object to use to initialise values from -
$type- Type of prefs object to create, see notes. -
$web- web containing topic to load from (required is$topicis set) -
$topic- topic to load from -
$prefix- key prefix for all preferences (used for plugins)
Object Method finish ()
Break circular references.Object Method finalise ($parent)
Finalise preferences in this cache, by freezing any preferences listed in FINALPREFERENCES at their current value.- $parent = object that supports getPreferenceValue
Object Method loadPrefsFromTopic ($web,$topic,$keyPrefix)
Loads preferences from a topic. All settings loaded are prefixed with the key prefix (default '').Object Method loadPrefsFromText ($text,$meta,$web,$topic)
Loads preferences from text and optional metadata. All settings loaded are prefixed with the key prefix (default ''). If$meta is defined,
then metadata will be taken from that object. Otherwise, $text will
be parsed to extract meta-data.
Object Method insert ($type,$key,$val) -> $boolean
Adds a key-value pair of the given type to the object. Type is Set or Local. Callback used for the Prefs::Parser object, or can be used to add arbitrary new entries to a prefs cache. Note that attempts to redefine final preferences will be ignored. Returns 1 if the preference was defined, 0 otherwise.Object Method stringify ($html,\%shown) -> $text
Generate an (HTML if $html) representation of the content of this cache.| Topic TWikiPrefsPrefsCacheDotPm . { Edit | Attach | Backlinks: Web All webs | Printable | History: r4 < r3 < r2 < r1 More } |