Index: lib/Foswiki.spec
===================================================================
--- lib/Foswiki.spec (revision 13816)
+++ lib/Foswiki.spec (working copy)
@@ -185,7 +185,7 @@
# Control whether Foswiki will use persistent sessions.
$Foswiki::cfg{UseClientSessions} = 1;
-# **STRING 20**
+# **STRING 20 DISPLAY_IF {UseClientSessions}**
# Set the session timeout, in seconds. The session will be cleared after this
# amount of time without the session being accessed. The default is 6 hours
# (21600 seconds).
@@ -201,7 +201,7 @@
# Session files are stored in the {WorkingDir}/tmp directory.
$Foswiki::cfg{Sessions}{ExpireAfter} = 21600;
-# **NUMBER EXPERT**
+# **NUMBER DISPLAY_IF {UseClientSessions} && {LoginManager}=='Foswiki::LoginManager::TemplateLogin'**
# TemplateLogin only.
# Normally the cookie that remembers a user session is set to expire
# when the browser exits, but using this value you can make the cookie
@@ -215,7 +215,7 @@
# One month is roughly equal to 2600000 seconds.
$Foswiki::cfg{Sessions}{ExpireCookiesAfter} = 0;
-# **BOOLEAN EXPERT**
+# **BOOLEAN DISPLAY_IF {UseClientSessions}**
# If you have persistent sessions enabled, then Foswiki will use a cookie in
# the browser to store the session ID. If the client has cookies disabled,
# then Foswiki will not be able to record the session. As a fallback, Foswiki
@@ -227,7 +227,7 @@
# {Sessions}{MapIP2SID}).
$Foswiki::cfg{Sessions}{IDsInURLs} = 0;
-# **BOOLEAN EXPERT**
+# **BOOLEAN DISPLAY_IF {UseClientSessions}**
# It is possible to enable a check that the user trying to use a session
# is on the same IP address that was used when the session was created.
# This gives a small increase in security. Public web sites can easily be
@@ -241,7 +241,7 @@
# session.
$Foswiki::cfg{Sessions}{UseIPMatching} = 0;
-# **BOOLEAN EXPERT**
+# **BOOLEAN DISPLAY_IF {UseClientSessions}**
# For compatibility with older versions, Foswiki supports the mapping of the
# clients IP address to a session ID. You can only use this if all
# client IP addresses are known to be unique.
@@ -252,7 +252,7 @@
# off.
$Foswiki::cfg{Sessions}{MapIP2SID} = 0;
-# **STRING 20 EXPERT**
+# **STRING 20 DISPLAY_IF {UseClientSessions}**
# By default the Foswiki session cookie is only accessible by the host which
# sets it. To change the scope of this cookie you can set this to any other
# value (ie. company.com). Make sure, Foswiki can access its own cookie.
@@ -280,18 +280,18 @@
# be performed.
$Foswiki::cfg{Validation}{Method} = 'strikeone';
-# **NUMBER EXPERT**
+# **NUMBER DISPLAY_IF {Validation}{Method}!='none'**
# Validation keys are stored for a maximum of this amount of time before
# they are invalidated. Time in seconds.
$Foswiki::cfg{Validation}{ValidForTime} = 3600;
-# **NUMBER EXPERT**
+# **NUMBER DISPLAY_IF {Validation}{Method}!='none'**
# The maximum number of validation keys to store in a session. There is one
# key stored for each page rendered. If the number of keys exceeds this
# number, the oldest keys will be force-expired to bring the number down.
$Foswiki::cfg{Validation}{MaxKeysPerSession} = 1000;
-# **BOOLEAN EXPERT**
+# **BOOLEAN DISPLAY_IF {Validation}{Method}!='none'**
# Expire a validation key immediately when it is used to validate the saving
# of a page. This protects against an attacker evesdropping the communication
# between browser and server and exploiting the keys sent from browser to
@@ -333,7 +333,7 @@
# edit topics without authentication.
$Foswiki::cfg{AuthScripts} = 'attach,compareauth,edit,manage,previewauth,rdiffauth,rename,rest,restauth,save,statistics,upload,viewauth,viewfileauth';
-# **BOOLEAN EXPERT**
+# **BOOLEAN DISPLAY_IF {LoginManager}=='Foswiki::LoginManager::TemplateLogin'**
# Browsers typically remember your login and passwords to make authentication
# more convenient for users. If your Foswiki is used on public terminals,
# you can prevent this, forcing the user to enter the login and password
@@ -451,14 +451,14 @@
# If you want to allow null passwords, set this to 0.
$Foswiki::cfg{MinPasswordLength} = 7;
-# **PATH**
+# **PATH DISPLAYIF /htpasswd/i.test({PasswordManager})**
# Path to the file that stores passwords, for the Foswiki::Users::HtPasswdUser
# password manager. You can use the htpasswd Apache program to create a new
# password file with the right encoding, however use caution, as it will remove
# email addresses from an existing file.
$Foswiki::cfg{Htpasswd}{FileName} = '$Foswiki::cfg{DataDir}/.htpasswd';
-# **PATH EXPERT**
+# **PATH DISPLAYIF /htpasswd/i.test({PasswordManager})**
# Path to the lockfile for the password file. This normally does not need to be changed
# however if two Foswiki installations share and update a common password file it is
# critical that both use the same lockfile. For example, change it to the location of the
@@ -467,13 +467,13 @@
# Only applicable to HtPasswdUser.
$Foswiki::cfg{Htpasswd}{LockFileName} = '$Foswiki::cfg{WorkingDir}/htpasswd.lock';
-# **BOOLEAN EXPERT**
+# **BOOLEAN DISPLAYIF /htpasswd/i.test({PasswordManager})**
# Enable this option on systems using FastCGI, FCGID, or Mod_Perl in order to avoid reading the
# for every transaction. It will cause the HtPasswdUser module to globally
# cache the password file, reading it only once on initization. Only applicable to HtPasswdUser.
$Foswiki::cfg{Htpasswd}{GlobalCache} = $FALSE;
-# **BOOLEAN EXPERT**
+# **BOOLEAN DISPLAYIF /htpasswd/i.test({PasswordManager})**
# Enable this option if the .htpasswd file can be updated either external to Foswiki
# or by another Foswiki instance. When enabled, Foswiki will verify the timestamp of
# the file and will invalidate the cache if the file has been changed. This is only useful
@@ -481,7 +481,7 @@
# Only applicable to HtPasswdUser.
$Foswiki::cfg{Htpasswd}{DetectModification} = $FALSE;
-# **SELECT htdigest-md5,sha1,apache-md5,crypt-md5,crypt,plain**
+# **SELECT htdigest-md5,sha1,apache-md5,crypt-md5,crypt,plain DISPLAYIF /htpasswd/i.test({PasswordManager})**
# Password encryption, for the Foswiki::Users::HtPasswdUser password manager. This
# specifies the type of password hash to generate when writing entries to .htpasswd
# It is also used when reading password entries unless the parameter
@@ -518,7 +518,7 @@
# the .htpasswd file.
$Foswiki::cfg{Htpasswd}{Encoding} = 'crypt';
-# **BOOLEAN**
+# **BOOLEAN DISPLAYIF /htpasswd/i.test({PasswordManager})**
# Allow the Foswiki::Users::HtPasswdUserpassword check routines to auto-detect the stored encoding type. Enable
# this to allow migration from one encoding format to another format. Note that this does
# add a small overhead to the parsing of the .htpasswd file. Tests show approximately 1ms per 1000 entries. It should be used
@@ -551,8 +551,7 @@
# **BOOLEAN EXPERT**
# Controls whether the user password has to be entered twice on the
# registration page or not. The default is to require confirmation, in which
-# case the same password must be provided in the Twk1Password and
-# Twk1Confirm inputs.
+# case the same password must be provided in the confirmation input.
$Foswiki::cfg{Register}{DisablePasswordConfirmation} = $FALSE;
# **BOOLEAN EXPERT**
@@ -805,7 +804,7 @@
# from LocalSite.cfg and re-running configure.
$Foswiki::cfg{Log}{Implementation} = 'Foswiki::Logger::PlainFile';
-# **BOOLEAN EXPERT**
+# **BOOLEAN DISPLAY_IF /PlainFile::Obfuscating/i.test({Log}{Implementation})**
# The Obfuscating logger can either replace IP addresses with a hashed address
# that cannot be easily reversed to the original IP, or the IP address can
# be completely masked as x.x.x.x. Enable this parameter to replace
@@ -916,7 +915,7 @@
# Enable the used of {Site}{Locale}
$Foswiki::cfg{UseLocale} = $FALSE;
-# **STRING 50**
+# **STRING 50 DISPLAY_IF {UseLocale}**
# Site-wide locale - used by Foswiki and external programs such as grep, and to
# specify the character set in which content must be presented for the user's
# web browser.
@@ -945,13 +944,12 @@
$Foswiki::cfg{Site}{Locale} = 'en_US.ISO-8859-1';
# **STRING 50 **
-# Set this to match your chosen {Site}{Locale} (from 'locale -a')
+# Set this to match your site locale (from 'locale -a')
# whose character set is not supported by your available perl conversion module
# (i.e. Encode for Perl 5.8 or higher, or Unicode::MapUTF8 for other Perl
# versions). For example, if the locale 'ja_JP.eucjp' exists on your system
# but only 'euc-jp' is supported by Unicode::MapUTF8, set this to 'euc-jp'.
# If you don't define it, it will automatically be defaulted to iso-8859-1
-# UTF-8 support is still considered experimental. Use the value 'utf-8' to try it.
$Foswiki::cfg{Site}{CharSet} = undef;
# **SELECT gmtime,servertime**
@@ -974,7 +972,7 @@
# only be disabled if you have locale problems.
$Foswiki::cfg{Site}{LocaleRegexes} = $TRUE;
-# **STRING EXPERT**
+# **STRING DISPLAY_IF ! {UseLocale} || ! {Site}{LocaleRegexes} **
# If a suitable working locale is not available (i.e. {UseLocale}
# is disabled), OR you are using Perl 5.005 (with or without working
# locales), OR {Site}{LocaleRegexes} is disabled, you can use WikiWords with
@@ -989,11 +987,11 @@
# 5.005 as long as {UseLocale} is set and you have working
# locales.
$Foswiki::cfg{UpperNational} = '';
-# **STRING EXPERT**
+# **STRING DISPLAY_IF ! {UseLocale}**
#
$Foswiki::cfg{LowerNational} = '';
-# **BOOLEAN EXPERT**
+# **BOOLEAN**
# Change non-existent plural topic name to singular,
# e.g. TestPolicies to TestPolicy. Only works in English.
$Foswiki::cfg{PluralToSingular} = $TRUE;
@@ -1060,7 +1058,7 @@
$grepDefaultPath = '/usr/bin/' if ($^O eq 'darwin');
$grepDefaultPath = 'c:/PROGRA~1/GnuWin32/bin/' if ($^O eq 'MSWin32');
-# **COMMAND EXPERT**
+# **COMMAND DISPLAY_IF {Store}{SearchAlgorithm}=='Foswiki::Store::SearchAlgorithms::Forking' **
# Full path to GNU-compatible egrep program. This is used for searching when
# {SearchAlgorithm} is 'Foswiki::Store::SearchAlgorithms::Forking'.
# %CS{|-i}% will be expanded
@@ -1069,7 +1067,7 @@
# (see the documentation on these options with GNU grep for details).
$Foswiki::cfg{Store}{EgrepCmd} = $grepDefaultPath.'grep -E %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';
-# **COMMAND EXPERT**
+# **COMMAND DISPLAY_IF {Store}{SearchAlgorithm}=='Foswiki::Store::SearchAlgorithms::Forking'**
# Full path to GNU-compatible fgrep program. This is used for searching when
# {SearchAlgorithm} is 'Foswiki::Store::SearchAlgorithms::Forking'.
$Foswiki::cfg{Store}{FgrepCmd} = $grepDefaultPath.'grep -F %CS{|-i}% %DET{|-l}% -H -- %TOKEN|U% %FILES|F%';
@@ -1097,7 +1095,7 @@
# 'Foswiki::Plugins::MongoDBPlugin::Listener' => 200 }.
$Foswiki::cfg{Store}{Listeners} = {};
-# **BOOLEAN EXPERT**
+# **BOOLEAN DISPLAY_IF /Foswiki::Store::Rcs/.test({Store}{Implementation})**
# Some systems will override the default umask to a highly restricted setting,
# which will block the application of the file and directory permissions.
# If mod_suexec is enabled, the Apache umask directive will also be ignored.
@@ -1106,7 +1104,7 @@
# {RCS}{filePermission} to be consistent with the system umask.
$Foswiki::cfg{RCS}{overrideUmask}= $FALSE;
-# **OCTAL EXPERT**
+# **OCTAL DISPLAY_IF /Foswiki::Store::Rcs/.test({Store}{Implementation})**
# File security for new directories created by RCS stores. You may have
# to adjust these
# permissions to allow (or deny) users other than the webserver user access
@@ -1114,14 +1112,14 @@
# representing the standard UNIX permissions (e.g. 755 == rwxr-xr-x)
$Foswiki::cfg{RCS}{dirPermission}= 0755;
-# **OCTAL EXPERT**
+# **OCTAL DISPLAY_IF /Foswiki::Store::Rcs/.test({Store}{Implementation})**
# File security for new files created by RCS stores. You may have to adjust these
# permissions to allow (or deny) users other than the webserver user access
# to files that Foswiki creates. This is an octal number
# representing the standard UNIX permissions (e.g. 644 == rw-r--r--)
$Foswiki::cfg{RCS}{filePermission}= 0644;
-# **BOOLEAN EXPERT**
+# **BOOLEAN DISPLAY_IF /Foswiki::Store::Rcs/.test({Store}{Implementation})**
# Some file-based Store implementations (RcsWrap and RcsLite) store
# attachment meta-data separately from the actual attachments.
# This means that it is possible to have a file in an attachment directory
@@ -1131,31 +1129,31 @@
# Considered experimental.
$Foswiki::cfg{RCS}{AutoAttachPubFiles} = $FALSE;
-# **STRING 20 EXPERT**
+# **STRING 20 DISPLAY_IF {Store}{Implementation}=='Foswiki::Store::RcsWrap'**
# Specifies the extension to use on RCS files. Set to -x,v on windows, leave
# blank on other platforms.
$Foswiki::cfg{RCS}{ExtOption} = "";
-# **REGEX EXPERT**
+# **REGEX DISPLAY_IF /Foswiki::Store::Rcs/.test({Store}{Implementation})**
# Perl regular expression matching suffixes valid on plain text files
# Defines which attachments will be treated as ASCII in RCS. This is a
# filter in, so any filenames that match this expression will
# be treated as ASCII.
$Foswiki::cfg{RCS}{asciiFileSuffixes} = qr/\.(txt|html|xml|pl)$/;
-# **BOOLEAN EXPERT**
+# **BOOLEAN DISPLAY_IF {Store}{Implementation}=='Foswiki::Store::RcsWrap'**
# Set this if your RCS cannot check out using the -p option.
# May be needed in some windows installations (not required for cygwin)
$Foswiki::cfg{RCS}{coMustCopy} = $FALSE;
-# **COMMAND EXPERT**
+# **COMMAND DISPLAY_IF {Store}{Implementation}=='Foswiki::Store::RcsWrap'**
# RcsWrap initialise a file as binary.
# %FILENAME|F% will be expanded to the filename.
$Foswiki::cfg{RCS}{initBinaryCmd} = "/usr/bin/rcs $Foswiki::cfg{RCS}{ExtOption} -i -t-none -kb %FILENAME|F%";
-# **COMMAND EXPERT**
+# **COMMAND DISPLAY_IF {Store}{Implementation}=='Foswiki::Store::RcsWrap'**
# RcsWrap initialise a topic file.
$Foswiki::cfg{RCS}{initTextCmd} = "/usr/bin/rcs $Foswiki::cfg{RCS}{ExtOption} -i -t-none -ko %FILENAME|F%";
-# **COMMAND EXPERT**
+# **COMMAND DISPLAY_IF {Store}{Implementation}=='Foswiki::Store::RcsWrap'**
# RcsWrap uses this on Windows to create temporary binary files during upload.
$Foswiki::cfg{RCS}{tmpBinaryCmd} = "/usr/bin/rcs $Foswiki::cfg{RCS}{ExtOption} -kb %FILENAME|F%";
# **COMMAND EXPERT**
@@ -1164,47 +1162,47 @@
# %COMMENT|U% will be expanded to the comment.
$Foswiki::cfg{RCS}{ciCmd} =
"/usr/bin/ci $Foswiki::cfg{RCS}{ExtOption} -m%COMMENT|U% -t-none -w%USERNAME|S% -u %FILENAME|F%";
-# **COMMAND EXPERT**
+# **COMMAND DISPLAY_IF {Store}{Implementation}=='Foswiki::Store::RcsWrap'**
# RcsWrap check in, forcing the date.
# %DATE|D% will be expanded to the date.
$Foswiki::cfg{RCS}{ciDateCmd} =
"/usr/bin/ci $Foswiki::cfg{RCS}{ExtOption} -m%COMMENT|U% -t-none -d%DATE|D% -u -w%USERNAME|S% %FILENAME|F%";
-# **COMMAND EXPERT**
+# **COMMAND DISPLAY_IF {Store}{Implementation}=='Foswiki::Store::RcsWrap'**
# RcsWrap check out.
# %REVISION|N% will be expanded to the revision number
$Foswiki::cfg{RCS}{coCmd} =
"/usr/bin/co $Foswiki::cfg{RCS}{ExtOption} -p%REVISION|N% -ko %FILENAME|F%";
-# **COMMAND EXPERT**
+# **COMMAND DISPLAY_IF {Store}{Implementation}=='Foswiki::Store::RcsWrap'**
# RcsWrap file history.
$Foswiki::cfg{RCS}{histCmd} =
"/usr/bin/rlog $Foswiki::cfg{RCS}{ExtOption} -h %FILENAME|F%";
-# **COMMAND EXPERT**
+# **COMMAND DISPLAY_IF {Store}{Implementation}=='Foswiki::Store::RcsWrap'**
# RcsWrap revision info about the file.
$Foswiki::cfg{RCS}{infoCmd} =
"/usr/bin/rlog $Foswiki::cfg{RCS}{ExtOption} -r%REVISION|N% %FILENAME|F%";
-# **COMMAND EXPERT**
+# **COMMAND DISPLAY_IF {Store}{Implementation}=='Foswiki::Store::RcsWrap'**
# RcsWrap revision info about the revision that existed at a given date.
# %REVISIONn|N% will be expanded to the revision number.
# %CONTEXT|N% will be expanded to the number of lines of context.
$Foswiki::cfg{RCS}{rlogDateCmd} =
"/usr/bin/rlog $Foswiki::cfg{RCS}{ExtOption} -d%DATE|D% %FILENAME|F%";
-# **COMMAND EXPERT**
+# **COMMAND DISPLAY_IF {Store}{Implementation}=='Foswiki::Store::RcsWrap'**
# RcsWrap differences between two revisions.
$Foswiki::cfg{RCS}{diffCmd} =
"/usr/bin/rcsdiff $Foswiki::cfg{RCS}{ExtOption} -q -w -B -r%REVISION1|N% -r%REVISION2|N% -ko --unified=%CONTEXT|N% %FILENAME|F%";
-# **COMMAND EXPERT**
+# **COMMAND DISPLAY_IF {Store}{Implementation}=='Foswiki::Store::RcsWrap'**
# RcsWrap lock a file.
$Foswiki::cfg{RCS}{lockCmd} =
"/usr/bin/rcs $Foswiki::cfg{RCS}{ExtOption} -l %FILENAME|F%";
-# **COMMAND EXPERT**
+# **COMMAND DISPLAY_IF {Store}{Implementation}=='Foswiki::Store::RcsWrap'**
# RcsWrap unlock a file.
$Foswiki::cfg{RCS}{unlockCmd} =
"/usr/bin/rcs $Foswiki::cfg{RCS}{ExtOption} -u %FILENAME|F%";
-# **COMMAND EXPERT**
+# **COMMAND DISPLAY_IF {Store}{Implementation}=='Foswiki::Store::RcsWrap'**
# RcsWrap break a file lock.
$Foswiki::cfg{RCS}{breaklockCmd} =
"/usr/bin/rcs $Foswiki::cfg{RCS}{ExtOption} -u -M %FILENAME|F%";
-# **COMMAND EXPERT**
+# **COMMAND DISPLAY_IF {Store}{Implementation}=='Foswiki::Store::RcsWrap'**
# RcsWrap delete a specific revision.
$Foswiki::cfg{RCS}{delRevCmd} =
"/usr/bin/rcs $Foswiki::cfg{RCS}{ExtOption} -o%REVISION|N% %FILENAME|F%";
@@ -1245,46 +1243,46 @@
# This setting will switch on/off caching.
$Foswiki::cfg{Cache}{Enabled} = $FALSE;
-# **STRING 80 EXPERT**
+# **STRING 80 DISPLAY_IF {Cache}{Enabled}**
# List of those topics that have a manual dependency on every topic
# in a web. Web dependencies can also be specified using the WEBDEPENDENCIES
# preference, which overrides this setting.
$Foswiki::cfg{Cache}{WebDependencies} = 'WebRss, WebAtom, WebTopicList, WebIndex, WebSearch, WebSearchAdvanced';
-# **REGEX EXPERT**
+# **REGEX DISPLAY_IF {Cache}{Enabled}**
# Exclude topics that match this regular expression from the dependency
# tracker.
$Foswiki::cfg{Cache}{DependencyFilter} = '$Foswiki::cfg{SystemWebName}\..*|$Foswiki::cfg{TrashWebName}\..*|.*Template$|TWiki\..*';
-# **SELECTCLASS Foswiki::Cache::* EXPERT**
+# **SELECTCLASS Foswiki::Cache::* DISPLAY_IF {Cache}{Enabled}**
# Select the default caching mechanism. Note that individual subsystems might
# choose a different backend for their own purposes.
$Foswiki::cfg{CacheManager} = 'Foswiki::Cache::FileCache';
-# **SELECT Foswiki::Cache::DB_File,Foswiki::Cache::BDB EXPERT**
+# **SELECT Foswiki::Cache::DB_File,Foswiki::Cache::BDB DISPLAY_IF {Cache}{Enabled}**
# Select the database backend use to store meta data for the page cache.
$Foswiki::cfg{MetaCacheManager} = 'Foswiki::Cache::DB_File';
-# **PATH EXPERT**
+# **PATH DISPLAY_IF {Cache}{Enabled}**
# Specify the root directory for CacheManagers that use file-system based
# storage. This is where the database files will be stored.
$Foswiki::cfg{Cache}{RootDir} = '$Foswiki::cfg{WorkingDir}/tmp/cache';
-# **STRING 30 EXPERT**
+# **STRING 30 DISPLAY_IF {Cache}{Enabled}**
# Specify the database file for the Foswiki::Cache::DB_File
# CacheManager
$Foswiki::cfg{Cache}{DBFile} = '$Foswiki::cfg{WorkingDir}/tmp/foswiki_db';
-# **STRING EXPERT**
+# **STRING DISPLAY_IF {Cache}{Enabled}**
# Specify the namespace used by this site in a store shared with other systems.
$Foswiki::cfg{Cache}{NameSpace} = '$Foswiki::cfg{DefaultUrlHost}';
-# **NUMBER EXPERT**
+# **NUMBER DISPLAY_IF {Cache}{Enabled}**
# Specify the maximum number of cache entries for size-aware CacheManagers like
# MemoryLRU
. This won't have any effect on other CacheManagers.
$Foswiki::cfg{Cache}{MaxSize} = 1000;
-# **STRING 30 EXPERT**
+# **STRING 30 DISPLAY_IF {Cache}{Enabled}**
# Specify a comma separated list of servers for distributed CacheManagers like
# Memcached
. This setting won't have any effect on other CacheManagers.
$Foswiki::cfg{Cache}{Servers} = '127.0.0.1:11211';
@@ -1347,13 +1345,13 @@
# MIME format mail messages on standard input, and mails them.
$Foswiki::cfg{MailProgram} = '/usr/sbin/sendmail -t -oi -oeq';
-# **BOOLEAN EXPERT**
+# **BOOLEAN DISPLAY_IF {Email}{MailMethod}=='Net::SMTP'**
# Set this option on to enable debug
# mode in SMTP. Output will go to the webserver error log.
$Foswiki::cfg{SMTP}{Debug} = 0;
-# **STRING 30**
-# Mail host for outgoing mail. This is only used if Net::SMTP is installed.
+# **STRING 30 ENABLE_IF {Email}{MailMethod}=='Net::SMTP'**
+# Mail host for outgoing mail. This is only used if Net::SMTP is used.
# Examples: mail.your.company If the smtp server uses a different port
# than the default 25 # use the syntax mail.your.company:portnumber
# CAUTION This setting can be overridden by a setting of SMTPMAILHOST
@@ -1363,24 +1361,23 @@
# and provide your gmail email address and password below for authentication.
$Foswiki::cfg{SMTP}{MAILHOST} = '';
-# **STRING 30**
-# Mail domain sending mail, required if you are using Net::SMTP. SMTP
+# **STRING 30 DISPLAY_IF {Email}{MailMethod}=='Net::SMTP'**
+# Mail domain sending mail, required. SMTP
# requires that you identify the server sending mail. If not set,
# Net::SMTP will guess it for you. Example: foswiki.your.company.
# CAUTION This setting can be overridden by a setting of %SMTPSENDERHOST%
# in SitePreferences. Make sure you delete that setting.
$Foswiki::cfg{SMTP}{SENDERHOST} = '';
-# **STRING 30**
-# Username for SMTP. Only required if your server requires authentication. If
+# **STRING 30 DISPLAY_IF {Email}{MailMethod}=='Net::SMTP'**
+# Username for SMTP. Only required if your mail server requires authentication. If
# this is left blank, Foswiki will not attempt to authenticate the mail sender.
$Foswiki::cfg{SMTP}{Username} = '';
-# **PASSWORD 30**
+# **PASSWORD 30 DISPLAY_IF {Email}{MailMethod}=='Net::SMTP'**
# Password for your {SMTP}{Username}.
$Foswiki::cfg{SMTP}{Password} = '';
-
#---++ S/MIME
# Configure signing of outgoing email. (Secure/Multipurpose Internet Mail Extensions)
# is a standard for public key encryption and signing of MIME encoded email messages.
@@ -1433,24 +1430,24 @@
#---+ Miscellaneous -- EXPERT
#
Miscellaneous expert options.
-# **STRING 20 EXPERT**
+# **STRING 20**
# Name of the web where documentation and default preferences are held. If you
# change this setting, you must make sure the web exists and contains
# appropriate content, and upgrade scripts may no longer work (i.e. don't
# change it unless you are certain that you know what you are doing!)
$Foswiki::cfg{SystemWebName} = 'System';
-# **STRING 20 EXPERT**
+# **STRING 20**
# Name of the web used as a trashcan (where deleted topics are moved)
# If you change this setting, you must make sure the web exists.
$Foswiki::cfg{TrashWebName} = 'Trash';
-# **STRING 20 EXPERT**
+# **STRING 20**
# Name of the web used as a scratchpad or temporary workarea for users to
# experiment with Foswiki topics.
$Foswiki::cfg{SandboxWebName} = 'Sandbox';
-# **STRING 20 EXPERT**
+# **STRING 20**
# Name of site-level preferences topic in the {SystemWebName} web.
# If you change this setting you will have to
# use Foswiki and *manually* rename the existing topic.
@@ -1458,7 +1455,7 @@
# you are doing!)
$Foswiki::cfg{SitePrefsTopicName} = 'DefaultPreferences';
-# **STRING 70 EXPERT**
+# **STRING 70**
# Web.TopicName of the site-level local preferences topic. If this topic
# exists, any settings in it will override settings in
# {SitePrefsTopicName}.
@@ -1467,7 +1464,7 @@
# as it will make upgrading a lot easier.
$Foswiki::cfg{LocalSitePreferences} = '$Foswiki::cfg{UsersWebName}.SitePreferences';
-# **STRING 20 EXPERT**
+# **STRING 20**
# Name of main topic in a web.
# If you change this setting you will have to
# use Foswiki to manually rename the topic in all existing webs
@@ -1475,7 +1472,7 @@
# you are doing!)
$Foswiki::cfg{HomeTopicName} = 'WebHome';
-# **STRING 20 EXPERT**
+# **STRING 20**
# Name of preferences topic in a web.
# If you change this setting you will have to
# use Foswiki to manually rename the topic in all existing webs
@@ -1483,7 +1480,7 @@
# you are doing!)
$Foswiki::cfg{WebPrefsTopicName} = 'WebPreferences';
-# **STRING 20 EXPERT**
+# **STRING 20**
# Name of the web where usertopics are stored. If you
# change this setting, you must make sure the web exists and contains
# appropriate content, and upgrade scripts may no longer work
@@ -1491,7 +1488,7 @@
# you are doing!)
$Foswiki::cfg{UsersWebName} = 'Main';
-# **STRING 70x10 EXPERT**
+# **STRING 70x10**
# A comma-separated list of generic file name templates that defines the order
# in which templates are assigned to skin path components.
# The file name templates can either be absolute file names ending in ".tmpl"
@@ -1506,7 +1503,7 @@
# setting this path for increased security.
$Foswiki::cfg{TemplatePath} = '$Foswiki::cfg{TemplateDir}/$web/$name.$skin.tmpl, $Foswiki::cfg{TemplateDir}/$name.$skin.tmpl, $web.$skinSkin$nameTemplate, $Foswiki::cfg{SystemWebName}.$skinSkin$nameTemplate, $Foswiki::cfg{TemplateDir}/$web/$name.tmpl, $Foswiki::cfg{TemplateDir}/$name.tmpl, $web.$nameTemplate, $Foswiki::cfg{SystemWebName}.$nameTemplate';
-# **STRING 120 EXPERT**
+# **STRING 120**
# List of protocols (URI schemes) that Foswiki will
# automatically recognize in absolute links.
# Add any extra protocols specific to your environment (for example, you might
@@ -1516,7 +1513,7 @@
# found at http://en.wikipedia.org/wiki/URI_scheme.
$Foswiki::cfg{LinkProtocolPattern} = '(file|ftp|gopher|https|http|irc|mailto|news|nntp|telnet)';
-# **BOOLEAN EXPERT**
+# **BOOLEAN**
# 'Anchors' are positions within a Foswiki page that can be targeted in
# a URL using the #anchor syntax. The format of these anchors has
# changed several times. If this option is set, Foswiki will generate extra
@@ -1527,11 +1524,11 @@
# links to the internals of pages to continue to work.
$Foswiki::cfg{RequireCompatibleAnchors} = 0;
-# **NUMBER EXPERT**
+# **NUMBER**
# How many links to other revisions to show in the bottom bar. 0 for all
$Foswiki::cfg{NumberOfRevisions} = 4;
-# **NUMBER EXPERT**
+# **NUMBER**
# Set the upper limit of the maximum number of difference that will be
# displayed when viewing the entire history of a page. The compared revisions
# will be evenly spaced across the history of the page e.g. if the page has
@@ -1539,7 +1536,7 @@
# between r100 and r90, r90 and r80, r80 and r70 and so on.
$Foswiki::cfg{MaxRevisionsInADiff} = 25;
-# **NUMBER EXPERT**
+# **NUMBER**
# If this is set to a > 0 value, and the revision control system
# supports it (RCS does), then if a second edit of the same topic
# is done by the same user within this number of seconds, a new
@@ -1548,7 +1545,7 @@
# a new revision (as required by most formal development processes).
$Foswiki::cfg{ReplaceIfEditedAgainWithin} = 3600;
-# **NUMBER EXPERT**
+# **NUMBER**
# When a topic is edited, the user takes a "lease" on that topic.
# If another user tries to also edit the topic while the lease
# is still active, they will get a warning. Leases are released
@@ -1564,7 +1561,7 @@
# at the same time as the lease expires.
$Foswiki::cfg{LeaseLength} = 3600;
-# **NUMBER EXPERT**
+# **NUMBER**
# Even if the other users' lease has expired, then you can specify that
# they should still get a (less forceful) warning about the old lease for
# some additional time after the lease expired. You can set this to 0 to
@@ -1572,19 +1569,13 @@
# issued, or to a number of seconds since the old lease expired.
$Foswiki::cfg{LeaseLengthLessForceful} = 3600;
-# **PATH EXPERT**
+# **PATH**
# Pathname to file that maps file suffixes to MIME types :
# For Apache server set this to Apache's mime.types file pathname,
# for example /etc/httpd/mime.types, or use the default shipped in
# the Foswiki data directory.
$Foswiki::cfg{MimeTypesFileName} = '$Foswiki::cfg{DataDir}/mime.types';
-# **BOOLEAN EXPERT**
-# If set, this will cause Foswiki to treat warnings as errors that will
-# cause Foswiki to die. Provided for use by Plugin and Skin developers,
-# who should develop with it switched on.
-$Foswiki::cfg{WarningsAreErrors} = $FALSE;
-
#---+ Extensions -- TABS
#---++ Install and update extensions
@@ -1699,7 +1690,7 @@
1;
__END__
#
-# Copyright (C) 2008-2009 Foswiki Contributors. Foswiki Contributors
+# Copyright (C) 2008-2012 Foswiki Contributors. Foswiki Contributors
# are listed in the AUTHORS file in the root of this distribution.
# NOTE: Please extend that file, not this notice.
#
Index: lib/Foswiki/Configure/Value.pm
===================================================================
--- lib/Foswiki/Configure/Value.pm (revision 13816)
+++ lib/Foswiki/Configure/Value.pm (working copy)
@@ -69,7 +69,11 @@
$this->{mandatory} = ( $this->{opts} =~ /(\b|^)M(\b|$)/ );
$this->{hidden} = ( $this->{opts} =~ /(\b|^)H(\b|$)/ );
$this->{expertsOnly} = 1
- if ( $this->{opts} =~ s/\bEXPERT\b// );
+ if ( $this->{opts} =~ s/(\b|^)EXPERT(\b|$)// );
+ $this->{displayIf} = $1
+ if ( $this->{opts} =~ s/(?:\b|^)DISPLAY_IF\s+(.*?)(\/DISPLAY_IF|$)// );
+ $this->{enableIf} = $1
+ if ( $this->{opts} =~ s/(?:\b|^)ENABLE_IF\s+(.*?)(\/ENABLE_IF|$)// );
}
return $this;
@@ -81,6 +85,16 @@
return $this->{expertsOnly};
}
+sub displayIf {
+ my $this = shift;
+ return $this->{displayIf} || '';
+}
+
+sub enableIf {
+ my $this = shift;
+ return $this->{enableIf} || '';
+}
+
# See Foswiki::Configure::Item
sub getKeys {
my $this = shift;
Index: lib/Foswiki/Configure/Load.pm
===================================================================
--- lib/Foswiki/Configure/Load.pm (revision 13816)
+++ lib/Foswiki/Configure/Load.pm (working copy)
@@ -7,6 +7,9 @@
Handling for loading configuration information (Foswiki.spec, Config.spec and
LocalSite.cfg) as efficiently and flexibly as possible.
+This reads *values* from these files and does *not* parse the structured comments. For that,
+see FoswikiCfg.pm
+
=cut
package Foswiki::Configure::Load;
Index: lib/Foswiki/Configure/UIs/Value.pm
===================================================================
--- lib/Foswiki/Configure/UIs/Value.pm (revision 13816)
+++ lib/Foswiki/Configure/UIs/Value.pm (working copy)
@@ -41,6 +41,8 @@
return '' if $value->{hidden};
my $isExpert = $value->isExpertsOnly();
+ my $displayIf = $value->displayIf();
+ my $enableIf = $value->enableIf();
my $info = '';
$info .= $value->{desc};
@@ -139,12 +141,17 @@
"$info
";
}
- my $class = join( ' ', @cssClasses );
+ my %props;
+ $props{class} = join( ' ', @cssClasses ) if ( scalar @cssClasses );
+ $props{'data-displayif'} = $displayIf if $displayIf;
+ $props{'data-enableif'} = $enableIf if $enableIf;
- $output .=
- _getRowHtml( $class, "$index$hiddenTypeOf", $helpTextLink,
- "$control $resetToDefaultLinkText$check$helpText" )
- . "\n";
+ $output .= CGI::Tr(
+ \%props,
+ CGI::th( "$index$hiddenTypeOf" )
+ . CGI::td( "$control $resetToDefaultLinkText$check$helpText" )
+ . CGI::td( { class => "configureHelp" }, $helpTextLink ) )
+ . "\n";
return (
$output,
@@ -158,16 +165,6 @@
);
}
-sub _getRowHtml {
- my ( $class, $header, $info, $data ) = @_;
-
- my $classProp = $class ? { class => $class } : undef;
- return CGI::Tr( $classProp,
- CGI::th( $classProp, $header )
- . CGI::td( {}, $data )
- . CGI::td( { class => "$class configureHelp" }, $info ) );
-}
-
1;
__END__
Foswiki - The Free and Open Source Wiki, http://foswiki.org/
Index: lib/Foswiki/Configure/resources/scripts.js
===================================================================
--- lib/Foswiki/Configure/resources/scripts.js (revision 13816)
+++ lib/Foswiki/Configure/resources/scripts.js (working copy)
@@ -416,6 +416,12 @@
});
}
+function valueOf($el) {
+ if ($el.attr("type") == "checkbox")
+ return $el.is(":checked");
+ return $el.val();
+}
+
function newHideContent(elts, settings, callback) {
elts.contentWrapper.hide();
callback();
@@ -526,83 +532,118 @@
* jquery init
*/
$(document).ready(function() {
- $(".enableWhenSomethingChanged").each(function() {
- enableWhenSomethingChangedElements.push(this);
- if (this.tagName.toLowerCase() == 'input') {
- /* disable the Save Changes button until a change has been made */
- /* we won't use this until an AJAX call has been implemented to make
- this fault proof
- $(this).attr('disabled', 'disabled');
- $(this).addClass('foswikiSubmitDisabled');
- $(this).removeClass('foswikiSubmit');
- */
- } else {
- $(this).addClass('foswikiHidden');
- }
- });
- $(".showWhenNothingChanged").each(function() {
- showWhenNothingChangedElements.push(this);
- });
- $(".tabli a").each(function() {
+ $(".enableWhenSomethingChanged").each(function() {
+ enableWhenSomethingChangedElements.push(this);
+ if (this.tagName.toLowerCase() == 'input') {
+ /* disable the Save Changes button until a change has been made */
+ /* we won't use this until an AJAX call has been implemented to make
+ this fault proof
+ $(this).attr('disabled', 'disabled');
+ $(this).addClass('foswikiSubmitDisabled');
+ $(this).removeClass('foswikiSubmit');
+ */
+ } else {
+ $(this).addClass('foswikiHidden');
+ }
+ });
+ $(".showWhenNothingChanged").each(function() {
+ showWhenNothingChangedElements.push(this);
+ });
+ $(".tabli a").each(function() {
var sectionParts = getSectionParts(this.hash);
- this.sectionId = sectionParts.main;
- if (sectionParts.sub) {
- this.sectionId = sectionParts.sub;
- setDefaultSub(sectionParts.main, sectionParts.sub);
- }
- tabLinks[this.sectionId] = $(this).parent().get(0);
- });
- $(".tabli a").click(function() {
- return showSection(this.sectionId);
+ this.sectionId = sectionParts.main;
+ if (sectionParts.sub) {
+ this.sectionId = sectionParts.sub;
+ setDefaultSub(sectionParts.main, sectionParts.sub);
+ }
+ tabLinks[this.sectionId] = $(this).parent().get(0);
+ });
+ $(".tabli a").click(function() {
+ return showSection(this.sectionId);
+ });
+ $("a.configureExpert").click(function() {
+ toggleExpertsMode();
+ return false;
+ });
+ $("a.configureNotExpert").click(function() {
+ toggleExpertsMode();
+ return false;
+ });
+ $("a.configureInfoText").click(function() {
+ toggleInfoMode();
+ return false;
+ });
+ $("a.configureNotInfoText").click(function() {
+ toggleInfoMode();
+ return false;
+ });
+ $("a.configureDefaultValueLink").each(function() {
+ initDefaultLink(this);
+ });
+ $("a.configureDefaultValueLink", $("div.configureRootSection")).mouseover(function() {
+ showDefaultLinkToolTip(this);
+ });
+ $(".configureToggleSections a").click(function() {
+ toggleSections();
+ });
+ $("input.foswikiFocus").each(function() {
+ this.focus();
+ });
+ $(".configureRootSection table.configureSectionValues div.configureError").each(function() {
+ var row = $(this).parent().parent().get(0);
+ if (row) {
+ $(row).removeClass('configureExpert');
+ }
+ });
+ $(".configureRootSection table.configureSectionValues div.configureWarning").each(function() {
+ var row = $(this).parent().parent().get(0);
+ if (row) {
+ $(row).removeClass('configureExpert');
+ }
+ });
+ $("#closeMessages").click(function() {
+ $("#messages").hide();
+ return false;
+ });
+ var add_dependency = function($el, name, cb) {
+ var test = $el.attr("data-" + name);
+ //$el.attr("data-" + name, "");
+ // Add change handlers to all vars, identified by {\w+}{... syntax
+ test = test.replace(/((?:{\w+})+)/g, function(str, p1, offset) {
+ var selector = '[name="' + p1 + '"]';
+ $(selector).change(function() {
+ $el.triggerHandler(name + '_change');
+ });
+ return "valueOf($('" + selector + "'))";
});
- $("a.configureExpert").click(function() {
- toggleExpertsMode();
- return false;
+ // Bind a change event handler to this dependent, which will be fired if any of
+ // the things it depends on changes.
+ $el.bind(name + '_change', function(e) {
+ cb($el, eval('(' + test + ')') ? true : false);
});
- $("a.configureNotExpert").click(function() {
- toggleExpertsMode();
- return false;
+ // Set up initial conditions by triggering the handler
+ $el.triggerHandler(name + '_change');
+ };
+
+ $("[data-displayif]").each(function() {
+ add_dependency($(this), "displayif", function ($el, tf) {
+ $el.toggle(tf);
});
- $("a.configureInfoText").click(function() {
- toggleInfoMode();
- return false;
+ });
+ $("[data-enableif]").each(function() {
+ add_dependency($(this), "enableif", function ($el, tf) {
+ if (tf) {
+ $el.find("input,textarea").removeAttr('disabled')
+ .removeClass('foswikiSubmitDisabled');
+ } else {
+ $el.find("input,textarea").attr('disabled', 'disabled')
+ .addClass('foswikiSubmitDisabled');
+ }
});
- $("a.configureNotInfoText").click(function() {
- toggleInfoMode();
- return false;
- });
- $("a.configureDefaultValueLink").each(function() {
- initDefaultLink(this);
- });
- $("a.configureDefaultValueLink", $("div.configureRootSection")).mouseover(function() {
- showDefaultLinkToolTip(this);
- });
- $(".configureToggleSections a").click(function() {
- toggleSections();
- });
- $("input.foswikiFocus").each(function() {
- this.focus();
- });
- $(".configureRootSection table.configureSectionValues div.configureError").each(function() {
- var row = $(this).parent().parent().get(0);
- if (row) {
- $(row).removeClass('configureExpert');
- }
- });
- $(".configureRootSection table.configureSectionValues div.configureWarning").each(function() {
- var row = $(this).parent().parent().get(0);
- if (row) {
- $(row).removeClass('configureExpert');
- }
- });
- $("#closeMessages").click(function() {
- $("#messages").hide();
- return false;
- });
-
- toggleExpertsMode( getUrlParam('expert') );
- toggleInfoMode();
- initSection();
+ });
+ toggleExpertsMode( getUrlParam('expert') );
+ toggleInfoMode();
+ initSection();
$(window).scroll(function(){ imgOnDemand() });
imgOnDemand();
});
Index: data/System/DevelopingPlugins.txt
===================================================================
--- data/System/DevelopingPlugins.txt (revision 13816)
+++ data/System/DevelopingPlugins.txt (working copy)
@@ -291,11 +291,27 @@
| =M= | means the setting is mandatory (may not be empty) |
| =H= | means the option is not visible in =configure= |
| =5x80= | means "use a 5 row, 80 column textarea". Can be used with any text entry field type, such as STRING, COMMAND, PERL etc. |
-
+| =DISPLAY_IF= | means this option is conditionally displayed based on some Javascript expression (see below for more) |
+| =ENABLE_IF= | means this option is conditionally enabled based on some Javascript expression (see below for more) |
See =lib/Foswiki.spec= for many more examples.
=Config.spec= files are also used for other (non-plugin) extensions. in this case they are stored under the =Contrib= directory instead of the =Plugins= directory.
+---++++ DISPLAY_IF and ENABLE_IF
+These sopisticated options support the definition of a Javascript expression that will be evaluated in the browser to determine if an option should be visible or not. The general format is:
+
+# **BOOLEAN DISPLAY_IF {Other}{Option}=='RequiredValue'**
+
+You can use almost any Javascript condition; any string of the form ={Other}{Option}= will be expanded to the value of that option in the browser. =ENABLE_IF= works the same way, except it simply disables the option unless the condition is satisified. The Javascript condition can be terminated by =/DISPLAY_IF= / =/ENABLE_IF= if it is not the last option. For example,
+
+
+# **BOOLEAN DISPLAY_IF {An}{Option}=='RequiredValue' /DISPLAY_IF ENABLE_IF {Another}{Option}=='AnotherValue' **
+
+When testing BOOLEAN options, simply stating the name of the option is enough. For example,
+
+**STRING DISPLAY_IF {This}{BOOLEAN}{Option} **
+
+
#LinkingToConfigure
---+++ Linking to =configure=