Move comment to the right place.

This commit is contained in:
Guo Xiang Tan 2016-06-29 15:23:29 +08:00
parent 8db3ab5f2a
commit 918b015bdb
No known key found for this signature in database
GPG key ID: 19C321C8952B0F72
2 changed files with 13 additions and 12 deletions

View file

@ -1,14 +1,18 @@
# Available options: # Available options:
# #
# default - The default value of the setting. # default - The default value of the setting.
# client - Set to true if the javascript should have access to this setting's value. # client - Set to true if the javascript should have access to this setting's value.
# refresh - Set to true if clients should refresh when the setting is changed. # refresh - Set to true if clients should refresh when the setting is changed.
# min - For a string setting, the minimum length. For an integer setting, the minimum value. # min - For a string setting, the minimum length. For an integer setting, the minimum value.
# max - For a string setting, the maximum length. For an integer setting, the maximum value. # max - For a string setting, the maximum length. For an integer setting, the maximum value.
# regex - A regex that the value must match. # regex - A regex that the value must match.
# validator - The name of the class that will be use to validate the value of the setting. # validator - The name of the class that will be use to validate the value of the setting.
# enum - The setting has a fixed set of allowed values, and only one can be chosen. # enum - The setting has a fixed set of allowed values, and only one can be chosen.
# Set to the class name that defines the set. # Set to the class name that defines the set.
# shadowed_by_global - "Shadow" a site setting with a GlobalSetting. If the GlobalSetting
# exists it will be used instead of the setting and the setting will be hidden.
# Useful for things like API keys on multisite.
#
# type: email - Must be a valid email address. # type: email - Must be a valid email address.
# type: username - Must match the username of an existing user. # type: username - Must match the username of an existing user.
# type: list - A list of values, chosen from a set of valid values defined in the choices option. # type: list - A list of values, chosen from a set of valid values defined in the choices option.

View file

@ -117,9 +117,6 @@ module SiteSettingExtension
hidden_settings << name hidden_settings << name
end end
# You can "shadow" a site setting with a GlobalSetting. If the GlobalSetting
# exists it will be used instead of the setting and the setting will be hidden.
# Useful for things like API keys on multisite.
if opts[:shadowed_by_global] && GlobalSetting.respond_to?(name) if opts[:shadowed_by_global] && GlobalSetting.respond_to?(name)
val = GlobalSetting.send(name) val = GlobalSetting.send(name)
unless val.nil? || (val == ''.freeze) unless val.nil? || (val == ''.freeze)