SilverWare\Banner\Components\BannerComponent
An extension of the base component for a banner component.
- Author: Colin Tucker <colin@praxis.net.au>
- Copyright: 2018 Praxis Interactive
- License: https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
Synopsis
class BannerComponent
extends BaseComponent
{
- // constants
- const SORT_ORDER = 'order';
- const SORT_RANDOM = 'random';
- const ANIM_SCROLL_LEFT = 'scroll-left';
- const ANIM_SCROLL_RIGHT = 'scroll-right';
- // members
- private static string $singular_name = 'Banner Component';
- private static string $plural_name = 'Banner Components';
- private static string $description = 'A component which shows a banner of images';
- private static string $icon = 'silverware/banner: admin/client/dist/images/icons/BannerComponent.png';
- private static string $table_name = 'SilverWare_BannerComponent';
- private static string $hide_ancestor = BaseComponent::class;
- private static string $default_child = Slide::class;
- private static array $db = ;
- private static array $defaults = ;
- private static array|string $allowed_children = ;
- private static array $casting = ;
- private static array $extensions = ;
- private static string $asset_folder = 'Slides/Banner';
- protected SS_List $slides;
- // methods
- public FieldList getCMSFields()
- public array fieldLabels()
- public string getAssetFolder()
- public array getClassNames()
- public array getWrapperAttributes()
- public string getWrapperAttributesHTML()
- public array getWrapperClassNames()
- public string getWrapperID()
- public string getWrapperCSSID()
- public $this setSlides()
- public DataList getSlides()
- public boolean hasSlides()
- public ArrayList getEnabledSlides()
- public string getAnimationTypeClass()
- public array getAnimationTypeOptions()
- public array getSortByOptions()
- protected SS_List sort()
Hierarchy
Extends
- SilverWare\Components\BaseComponent
Constants
Name | Value |
---|---|
SORT_ORDER | 'order' |
SORT_RANDOM | 'random' |
ANIM_SCROLL_LEFT | 'scroll-left' |
ANIM_SCROLL_RIGHT | 'scroll-right' |
Members
private
- $allowed_children
—
SilverWare\Banner\Components\array|string
Defines the allowed children for this object. - $asset_folder
—
string
Defines the asset folder for uploading images. - $casting
—
array
Maps field and method names to the class names of casting objects. - $db
—
array
Maps field names to field types for this object. - $default_child
—
string
Defines the default child class for this object. - $defaults
—
array
Defines the default values for the fields of this object. - $description
—
string
Description of this object. - $extensions
—
array
Defines the extension classes to apply to this object. - $hide_ancestor
—
string
Defines an ancestor class to hide from the admin interface. - $icon
—
string
Icon file for this object. - $plural_name
—
string
Human-readable plural name. - $singular_name
—
string
Human-readable singular name. - $table_name
—
string
Defines the table name to use for this object.
protected
- $slides
—
SilverStripe\ORM\SS_List
Holds a list of slides which override the child slides.
Methods
protected
- sort() — Sorts the given list of slides.
public
- fieldLabels() — Answers the labels for the fields of the receiver.
- getAnimationTypeClass() — Answers the CSS class for the selected animation type.
- getAnimationTypeOptions() — Answers an array of options for the animation type field.
- getAssetFolder() — Answers the asset folder used by the receiver.
- getCMSFields() — Answers a list of field objects for the CMS interface.
- getClassNames() — Answers an array of class names for the HTML template.
- getEnabledSlides() — Answers a list of the enabled slides within the receiver.
- getSlides() — Answers a list of all slides within the receiver.
- getSortByOptions() — Answers an array of options for the sort by field.
- getWrapperAttributes() — Answers an array of HTML tag attributes for the wrapper.
- getWrapperAttributesHTML() — Answers the HTML tag attributes for the wrapper as a string.
- getWrapperCSSID() — Answers a unique CSS ID for the wrapper element.
- getWrapperClassNames() — Answers an array of wrapper class names for the HTML template.
- getWrapperID() — Answers a unique ID for the wrapper element.
- hasSlides() — Answers true if the receiver has at least one slide.
- setSlides() — Defines the slides property for the receiver.