Jellygnite\ElementalStyle\Extensions\DynamicStyleExtension
Synopsis
class DynamicStyleExtension
extends DataExtension
{
- // members
- private boolean $is_duplicate = false;
- private static string $default_location = 'default';
- private static string $default_tab_name = 'Settings';
- private static string $default_tab_title = 'Appearance';
- private static string $default_css_class = '';
- private static boolean $disable_chosen = false;
- private static array $db = ;
- // methods
- public void updateCMSFields()
- public void getFrontEndFormFields()
- protected array getEmptyString()
- protected array getExtraStyles()
- public array updateConfigStyles()
- protected array getConfigStyles()
- protected array getConfigStyleObjects()
- protected array getExtraStyleObjects()
- protected static array[$index array_to_styleobjects()
- protected static string getStyleFieldName()
- public boolean hasCustomCSSClass()
- public string getBaseClassName()
- public string getDefaultCssClass()
- public void getStyleByID()
- private string getStyleByLocation()
- public string StyleByLocation()
- public string updateStyleVariant()
- public void onBeforeDuplicate()
Hierarchy
Extends
- SilverStripe\ORM\DataExtension
Members
private
- $db
- $default_css_class
- $default_location
- $default_tab_name
- $default_tab_title
- $disable_chosen
- $is_duplicate
Methods
private
- getStyleByLocation() — Get a user defined style variant for this element, if available
protected
- array_to_styleobjects() — Take an array of styles and convert them to StyleObject class
- getConfigStyleObjects() — Get all styles from config as array of StyleObject::class
- getConfigStyles() — Get all styles from config
- getEmptyString() — search fieldstyles array for empty value and use key as label.
- getExtraStyleObjects() — Get all styles from config as array of StyleObject::class
- getExtraStyles() — Get all styles saved to ExtraStyle data field
- getStyleFieldName() — Get unique title for a style dropdown
public
- StyleByLocation() — Get a user defined style variant for this element, if available
- getBaseClassName() — Return the last node of a class name
- getDefaultCssClass() — Return the default css class if exists
- getFrontEndFormFields()
- getStyleByID()
- hasCustomCSSClass() — Check if this element contains a CSS class, can pass a location if needed
- onBeforeDuplicate()
- updateCMSFields()
- updateConfigStyles() — Extension point to allow element or object to update styles programatically
- updateStyleVariant() — Get all the CSS classes from everywhere and update the StyleVariant. Do not include styles that use Location field as these are for elsewhere in the template