TWiki
>
TWiki/ Web
>
TWikiPrefsDotPm
(revision 3) (raw view)
Edit
Attach
---+ Package =TWiki::Prefs= The Prefs class is a singleton that implements management of preferences. It uses a stack of TWiki::Prefs::PrefsCache objects to store the preferences for global, web, user and topic contexts, and provides the means to look up preferences in these. Preferences from different places stack on top of each other, so there are global preferences, then site, then web (and subweb and subsubweb), then topic, included topic and so on. Each level of the stack is tagged with a type identifier. The module also maintains a separate of the preferences found in every topic and web it reads. This supports the lookup of preferences for webs and topics that are not on the stack, and must not be chained in (you can't allow a user to override protections from their home topic!) %TOC% ---++ ClassMethod *new* <tt>($session[,$cache])</tt> Creates a new Prefs object. If $cache is defined, it will be pushed onto the stack. ---++ ObjectMethod *finish* <tt></tt> Complete processing after the client's HTTP request has been responded to. 1 breaking circular references to allow garbage collection in persistent environments ---++ ObjectMethod *pushGlobalPreferences* <tt>()</tt> Add global preferences to this preferences stack. ---++ ObjectMethod *pushPreferences* <tt>($web,$topic,$type)</tt> * =$web= - web to read from * =$topic= - topic to read * =$type= - DEFAULT, SITE, USER, SESSION, WEB, TOPIC or PLUGIN * =$prefix= - key prefix for all preferences (used for plugins) Reads preferences from the given topic, and pushes them onto the preferences stack. ---++ ObjectMethod *pushWebPreferences* <tt>($web)</tt> Pushes web preferences. Web preferences for a particular web depend on the preferences of all containing webs. ---++ ObjectMethod *pushPreferencesValues* <tt>($type,\%values)</tt> Push a new preference level using type and values given ---++ ObjectMethod *mark* <tt>()</tt> Return a marker representing the current top of the preferences stack. Used to remember the stack when new web and topic preferences are pushed during a topic include. ---++ ObjectMethod *resetTo* <tt>($mark)</tt> Resets the preferences stack to the given mark, to recover after a topic include. ---++ ObjectMethod *getPreferencesValue* <tt>($key) -> $value</tt> * =$key - key to look up Returns the value of the preference =$key=, or undef. Looks up local preferences when the level topic is the same as the current web,topic in the session. ---++ ObjectMethod *isFinalised* <tt>($key)</tt> Return true if $key is finalised somewhere in the prefs stack ---++ ObjectMethod *getTopicPreferencesValue* <tt>($key,$web,$topic) -> $value</tt> Recover a preferences value that is defined in a specific topic. Does not recover web, user or global settings. Intended for use in protections mechanisms, where the order doesn't match the prefs stack. ---++ getTextPreferencesValue( $key, $text, $web, $topic ) -> $value Get a preference value from the settings in the text. The values are *not* cached. ---++ ObjectMethod *getWebPreferencesValue* <tt>($key,$web) -> $value</tt> Recover a preferences value that is defined in the webhome topic of a specific web.. Does not recover user or global settings, but does recover settings from containing webs. Intended for use in protections mechanisms, where the order doesn't match the prefs stack. ---++ObjectMethod stringify() -> $text Generate a TML-formatted version of the current preferences
Edit
|
Attach
|
P
rint version
|
H
istory
:
r6
<
r5
<
r4
<
r3
<
r2
|
B
acklinks
|
V
iew topic
|
Raw edit
|
More topic actions...
Topic revision: r3 - 25 Jun 2006 - 13:26:33 -
TWikiContributor
TWiki/
Log In
or
Register
TWiki/ Web
Users
Groups
Index
Search
Changes
Notifications
RSS Feed
Statistics
Preferences
User Reference
ATasteOfTWiki
TextFormattingRules
TWikiVariables
FormattedSearch
QuerySearch
TWikiDocGraphics
TWikiSkinBrowser
InstalledPlugins
Admin Maintenance
Reference Manual
AdminToolsCategory
InterWikis
ManagingWebs
TWikiSiteTools
TWikiPreferences
WebPreferences
Categories
Admin Documentation
Admin Tools
Developer Doc
User Documentation
User Tools
Webs
Abacos
Acbahia
AnpedGT16
ArcoDigital
Argumento
Avsan
CalculoB
Ceb
Cetad
CetadObserva
Cibercultura
Ciberfem
CiberParque
ColoquioCiags
Coloquiofasa
ConexoesSaberes
Cpdteste
Cppd
Creche
Cridi
Da
DACN
DCE
DelzaTeste
DeniseCarla
DepHistoria
DicionarioBelasartes
Ecologia
EDC
Educandow
EduMus
EleicoesReitor2010
Encima
Enearte
Estruturas
EstruturasEng
FACED
FAT
FepFaced
GEC
GeneticaBiodiversidade
GeneticaBiodiversidade3
GeneticaBiodiversidade
Gepindi
GetecEng
Godofredofilho
GrupoAlgebra
ICI010
Informev
Ites
LabioComp
LEG
Lepeja
Letras
LivroLivreSalvador
Main
MaisUm
Mata07
Mefes
MefesCpd
MetaReciclagem
Neclif
NelsonPretto
Nuclear
Numcad
Nutricao
Observa
OrfaosdeRua
PauloCostaLima
PdI
PescandoLetras
PETFilosofia
Pgif
PGNUT
PortalPpga
PosCultura
Pospetroigeo
PPGAC
PPGE
PpggBio
Ppggenbio
Pretto
Proad
PROGESP
ProjetoLencois
Quimica
RadioFACED
RadioTeatro
RadioWeb
Riosymposium10
Ripe
Salasdoctai
Sat
Sedu
SemBio
SeminarioPibid
SimoneLucena
Sociologia
SSL
Tabuleiro
TabuleirosUfba
TCinema
TerritoriosDigitais
TWiki
Twikidea
UFBAIrece
UniversidadeNova
VizinhoEstrangeiro
XIISNHCT
Български
English
Español
日本語
Português
Copyright � by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback