SilverWare\Masonry\Components\MasonryComponent
An extension of the base component class for a masonry component.
- Author: Colin Tucker <colin@praxis.net.au>
- Copyright: 2017 Praxis Interactive
- License: https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
Synopsis
class MasonryComponent
extends BaseListComponent
{
- // constants
- const UNIT_PERCENT = 'percent';
- const UNIT_PIXEL = 'pixel';
- // members
- private static string $singular_name = 'Masonry Component';
- private static string $plural_name = 'Masonry Components';
- private static string $description = 'A component which shows a masonry layout of images';
- private static string $icon = 'silverware/masonry: admin/client/dist/images/icons/MasonryComponent.png';
- private static string $table_name = 'SilverWare_MasonryComponent';
- private static string $hide_ancestor = BaseListComponent::class;
- private static array|string $allowed_children = 'none';
- private static array $db = ;
- private static array $defaults = ;
- // methods
- public FieldList getListStyleFields()
- public FieldList getListOptionFields()
- public array fieldLabels()
- public array getMasonryConfig()
- public string getMasonryConfigJSON()
- public array getWrapperClassNames()
- public ArrayList getColumnWidths()
- public string getColumnUnitCSS()
- public DBViewports getColumnWidthData()
- public boolean isPercentPosition()
- public boolean isHorizontalOrder()
- public void updateListItemClassNames()
Hierarchy
Extends
- SilverWare\Components\BaseListComponent
Constants
Name | Value |
---|---|
UNIT_PERCENT | 'percent' |
UNIT_PIXEL | 'pixel' |
Members
private
- $allowed_children
—
SilverWare\Masonry\Components\array|string
Defines the allowed children for this object. - $db
—
array
Maps field names to field types for this object. - $defaults
—
array
Defines the default values for the fields of this object. - $description
—
string
Description of 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.
Methods
public
- fieldLabels() — Answers the labels for the fields of the receiver.
- getColumnUnitCSS() — Answers the column unit for the custom CSS template.
- getColumnWidthData() — Answers the appropriate viewports database field for the column unit.
- getColumnWidths() — Answers a list of column width data for the custom CSS template.
- getListOptionFields() — Answers the list option fields for the receiver.
- getListStyleFields() — Answers the list style fields for the receiver.
- getMasonryConfig() — Answers the configuration for Masonry as an array.
- getMasonryConfigJSON() — Answers the configuration for Masonry as a JSON-encoded string.
- getWrapperClassNames() — Answers an array of wrapper class names for the HTML template.
- isHorizontalOrder() — Answers true if the items are ordered horizontally.
- isPercentPosition() — Answers true if the column unit is a percentage.
- updateListItemClassNames() — Updates the given array of list item class names.