SilverWare\Navigation\Components\BarNavigation
An extension of the base component class for bar navigation.
- Author: Colin Tucker <colin@praxis.net.au>
- Copyright: 2017 Praxis Interactive
- License: https://opensource.org/licenses/BSD-3-Clause BSD-3-Clause
Synopsis
class BarNavigation
extends BaseComponent
{
- // constants
- const BUTTON_ALIGN_LEFT = 'left';
- const BUTTON_ALIGN_RIGHT = 'right';
- const ITEM_ALIGN_START = 'start';
- const ITEM_ALIGN_CENTER = 'center';
- const ITEM_ALIGN_END = 'end';
- const ITEM_ALIGN_BETWEEN = 'between';
- const ITEM_ALIGN_AROUND = 'around';
- const ITEM_ALIGN_BASELINE = 'baseline';
- const ITEM_ALIGN_STRETCH = 'stretch';
- const POSITION_FIXED_TOP = 'fixed-top';
- const POSITION_FIXED_BOTTOM = 'fixed-bottom';
- const BG_PRIMARY = 'primary';
- const BG_LIGHT = 'light';
- const BG_DARK = 'dark';
- const FG_LIGHT = 'light';
- const FG_DARK = 'dark';
- // members
- private static string $singular_name = 'Bar Navigation';
- private static string $plural_name = 'Bar Navigation';
- private static string $description = 'A customisable navigation bar component';
- private static string $icon = 'silverware/navigation: admin/client/dist/images/icons/BarNavigation.png';
- private static string $table_name = 'SilverWare_BarNavigation';
- private static string $hide_ancestor = BaseComponent::class;
- private static array $db = ;
- private static array $has_one = ;
- private static array $owns = ;
- private static array $defaults = ;
- private static array|string $allowed_children = ;
- private static array $casting = ;
- private static string $asset_folder = 'Logos';
- // methods
- public FieldList getCMSFields()
- public array fieldLabels()
- public string getAssetFolder()
- public void populateDefaults()
- public array getWrapperClassNames()
- public array getButtonClassNames()
- public array getButtonAttributes()
- public string getButtonAttributesHTML()
- public array getButtonIconClassNames()
- public array getBrandClassNames()
- public array getBrandLogoClassNames()
- public boolean hasBrandLink()
- public string getBrandLink()
- public string getBrandURL()
- public array getCollapseClassNames()
- public string getCollapseID()
- public string getCollapseCSSID()
- public DataList getItems()
- public ArrayList getEnabledItems()
- public BarItem getEnabledItemByClass()
- public boolean hasRows()
- public boolean hasBrandLogo()
- public boolean isButtonLeftAligned()
- public boolean isButtonRightAligned()
- public ArrayList getLogoDimensions()
- public array getBackgroundOptions()
- public array getForegroundOptions()
- public array getButtonAlignmentOptions()
- public array getItemAlignOptions()
- public array getItemJustifyOptions()
- public array getPositionOptions()
Hierarchy
Extends
- SilverWare\Components\BaseComponent
Constants
Name | Value |
---|---|
BUTTON_ALIGN_LEFT | 'left' |
BUTTON_ALIGN_RIGHT | 'right' |
ITEM_ALIGN_START | 'start' |
ITEM_ALIGN_CENTER | 'center' |
ITEM_ALIGN_END | 'end' |
ITEM_ALIGN_BETWEEN | 'between' |
ITEM_ALIGN_AROUND | 'around' |
ITEM_ALIGN_BASELINE | 'baseline' |
ITEM_ALIGN_STRETCH | 'stretch' |
POSITION_FIXED_TOP | 'fixed-top' |
POSITION_FIXED_BOTTOM | 'fixed-bottom' |
BG_PRIMARY | 'primary' |
BG_LIGHT | 'light' |
BG_DARK | 'dark' |
FG_LIGHT | 'light' |
FG_DARK | 'dark' |
Members
private
- $allowed_children
—
SilverWare\Navigation\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. - $defaults
—
array
Defines the default values for the fields of this object. - $description
—
string
Description of this object. - $has_one
—
array
Defines the has-one associations for this object. - $hide_ancestor
—
string
Defines an ancestor class to hide from the admin interface. - $icon
—
string
Icon file for this object. - $owns
—
array
Defines the ownership of associations 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.
- getAssetFolder() — Answers the asset folder used by the receiver.
- getBackgroundOptions() — Answers an array of options for the background field.
- getBrandClassNames() — Answers an array of brand class names for the HTML template.
- getBrandLink() — Answers the brand link for the receiver.
- getBrandLogoClassNames() — Answers an array of brand logo class names for the HTML template.
- getBrandURL() — Answers the brand URL for the HTML template.
- getButtonAlignmentOptions() — Answers an array of options for the button alignment field.
- getButtonAttributes() — Answers an array of HTML tag attributes for the button.
- getButtonAttributesHTML() — Answers the HTML tag attributes for the button as a string.
- getButtonClassNames() — Answers an array of button class names for the HTML template.
- getButtonIconClassNames() — Answers an array of button icon class names for the HTML template.
- getCMSFields() — Answers a list of field objects for the CMS interface.
- getCollapseCSSID() — Answers a unique CSS ID for the collapse element.
- getCollapseClassNames() — Answers an array of collapse class names for the HTML template.
- getCollapseID() — Answers a unique ID for the collapse element.
- getEnabledItemByClass() — Answers the first enabled item found matching the given class name.
- getEnabledItems() — Answers a list of the enabled items within the receiver.
- getForegroundOptions() — Answers an array of options for the foreground field.
- getItemAlignOptions() — Answers an array of options for the item align field.
- getItemJustifyOptions() — Answers an array of options for the item justify field.
- getItems() — Answers a list of all items within the receiver.
- getLogoDimensions() — Answers a list of logo dimensions for the custom CSS template.
- getPositionOptions() — Answers an array of options for the position field.
- getWrapperClassNames() — Answers an array of wrapper class names for the HTML template.
- hasBrandLink() — Answers true if the receiver has an brand link.
- hasBrandLogo() — Answers true if a brand logo exists.
- hasRows() — Answers true if the receiver contains a row item.
- isButtonLeftAligned() — Answers true if the button is left-aligned.
- isButtonRightAligned() — Answers true if the button is right-aligned.
- populateDefaults() — Populates the default values for the fields of the receiver.