Line: 1 to 1 | ||||||||
---|---|---|---|---|---|---|---|---|
Package
The PrefsCache package holds a cache of topics that have been read in, using
the TopicPrefs class. These functions manage that cache.
We maintain 2 hashes of values: | ||||||||
Added: | ||||||||
> > | ObjectMethod finish ()Break circular references. | |||||||
ObjectMethod finalise ($parent)Finalise preferences in this cache, by freezing any preferences listed in FINALPREFERENCES at their current value.
ObjectMethod loadPrefsFromTopic ($web,$topic,$keyPrefix)Loads preferences from a topic. All settings loaded are prefixed with the key prefix (default '').ObjectMethod 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.
| ||||||||
Changed: | ||||||||
< < | ObjectMethod insert ($type,$key,$val) | |||||||
> > | ObjectMethod 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. | ||||||||
Added: | ||||||||
> > | Returns 1 if the preference was defined, 0 otherwise. | |||||||
ObjectMethod stringify ($html,\%shown) -> $textGenerate an (HTML if $html) representation of the content of this cache. |