CRM_Admin_Form_SettingTrait
trait CRM_Admin_Form_SettingTrait
This trait allows us to consolidate Preferences & Settings forms.
It is intended mostly as part of a refactoring process to get rid of having 2.
Properties
protected array | $settingsMetadata |
Methods
Get default entity.
Get the metadata relating to the settings on the form, ordered by the keys in $this->_settings.
Get the settings which can be stored based on metadata.
No description
Get the metadata for a particular field.
Get the metadata for a particular field for a particular item.
This is public so we can retrieve the filter name via hooks etc. and apply conditional logic (eg. loading javascript conditionals).
Returns a re-keyed copy of the settings, ordered by weight.
Add fields in the metadata to the template.
Get the quickform type for the given html type.
Get the defaults for all fields defined in the metadata.
Save any fields which have been defined via metadata.
Display options in correct order on the form
Details
at line 58
string
getDefaultEntity()
Get default entity.
at line 67
protected array
getSettingsMetaData()
Get the metadata relating to the settings on the form, ordered by the keys in $this->_settings.
at line 82
protected array
getSettingsToSetByMetadata(array $params)
Get the settings which can be stored based on metadata.
at line 98
protected
filterParamsSetByMetadata($params)
at line 111
protected mixed
getSettingMetadata($setting)
Get the metadata for a particular field.
at line 124
protected mixed
getSettingMetadataItem($setting, $item)
Get the metadata for a particular field for a particular item.
e.g get 'serialize' key, if exists, for a field.
at line 133
string
getSettingPageFilter()
This is public so we can retrieve the filter name via hooks etc. and apply conditional logic (eg. loading javascript conditionals).
at line 147
protected array
getSettingsOrderedByWeight()
Returns a re-keyed copy of the settings, ordered by weight.
at line 171
protected
addFieldsDefinedInSettingsMetadata()
Add fields in the metadata to the template.
at line 279
protected string
getQuickFormType(array $spec)
Get the quickform type for the given html type.
at line 313
protected
setDefaultsForMetadataDefinedFields()
Get the defaults for all fields defined in the metadata.
All others are pending conversion.
at line 340
protected
saveMetadataDefinedSettings(array $params)
Save any fields which have been defined via metadata.
(Other fields are hack-handled... sadly.
at line 365
static array
reorderSortableOptions($setting, $options)
Display options in correct order on the form