CWP\AgencyExtensions\Extensions\CWPSiteConfigExtension
Class CWPCleanupSiteConfigExtension
Synopsis
class CWPSiteConfigExtension
extends DataExtension
{
- // members
- private static array $db = ;
- private static array $has_one = ;
- private static array $owns = ;
- private static boolean $enable_theme_color_picker = false;
- private static array $theme_fonts = ;
- private static array $theme_colors = ;
- // methods
- public void updateCMSFields()
- protected $this addLogosAndIcons()
- protected $this addSearchOptions()
- protected $this addThemeColorPicker()
- public array getThemeOptionsExcluding()
- public void onAfterWrite()
- public void onBeforeWrite()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Members
private
- $db
- $enable_theme_color_picker
—
boolean
Defines if the theme colour picker is enabled in the CMS - $has_one
- $owns
- $theme_colors
—
array
Defines the theme colours that can be selected via the CMS - $theme_fonts
—
array
Defines the theme fonts that can be selected via the CMS
Methods
protected
- addLogosAndIcons() — Add fields for logo and icon uploads
- addSearchOptions() — Add user configurable search field labels
- addThemeColorPicker() — Add fields for selecting the font theme colour for different areas of the site.
public
- getThemeOptionsExcluding() — Returns theme_colors used for ColorPickerField.
- onAfterWrite() — Auto-publish any images attached to the SiteConfig object if it's not versioned. Versioned objects will handle their related objects via the "owns" API by default.
- onBeforeWrite() — If HeaderBackground is not set, assume no theme colours exist and populate some defaults if the colour picker is enabled. We don't use populateDefaults() because we don't want SiteConfig to re-populate its own defaults.
- updateCMSFields()