WidgetArea
in package
Stores information about an individual widget area, including the names of all widgets that are allowed to be in this area.
Table of Contents
Constants
- ORIENTATION_EMAIL : mixed = 3
- ORIENTATION_TALL : mixed = 1
- ORIENTATION_WIDE : mixed = 2
Properties
- $orientation_classes : mixed
- Class names which are output in the wrapper div
- $embed : mixed
- $index : mixed
- $name : mixed
- $nice_name : mixed
- $orientation : mixed
- $widgets : mixed
Methods
- __construct() : mixed
- Constructor
- addDefault() : mixed
- Adds a widget to the list of widgets allowed for this area
- addWidget() : mixed
- Adds a widget to the list of widgets allowed for this area
- findAreaByName() : static|null
- Returns the widget area which has the specified name.
- getIndex() : mixed
- Returns the index of this widget area
- getName() : mixed
- Returns the name of this widget area
- getNiceName() : mixed
- Returns the nice name of this widget area
- getOrientation() : mixed
- Gets the orientation of the widget area
- getWidgets() : mixed
- Gets the list of allowed widgets
- isEmbed() : mixed
- If the widget area is an embedding area
- parseOrientation() : int
- Normalize a constant or orientation name (tall|wide|email) into a constant.
- setEmbed() : mixed
- If true, the widget area is an 'embedding' area.
- setNiceName() : mixed
- Sets the nice name of this widget area
- setOrientation() : mixed
- Sets the orientation of the widget area
Constants
ORIENTATION_EMAIL
public
mixed
ORIENTATION_EMAIL
= 3
ORIENTATION_TALL
public
mixed
ORIENTATION_TALL
= 1
ORIENTATION_WIDE
public
mixed
ORIENTATION_WIDE
= 2
Properties
$orientation_classes
Class names which are output in the wrapper div
public
static mixed
$orientation_classes
= array(self::ORIENTATION_TALL => 'tall', self::ORIENTATION_WIDE => 'wide', self::ORIENTATION_EMAIL => 'email')
$embed
private
mixed
$embed
$index
private
mixed
$index
$name
private
mixed
$name
$nice_name
private
mixed
$nice_name
$orientation
private
mixed
$orientation
$widgets
private
mixed
$widgets
Methods
__construct()
Constructor
public
__construct(string $name, int $index) : mixed
Parameters
- $name : string
-
The name of the widget area
- $index : int
-
The numerical index of the widget area in the config file
addDefault()
Adds a widget to the list of widgets allowed for this area
public
addDefault(string $widget_name, mixed $settings) : mixed
Parameters
- $widget_name : string
-
The name of the widget to add
- $settings : mixed
addWidget()
Adds a widget to the list of widgets allowed for this area
public
addWidget(string $widget_name) : mixed
Parameters
- $widget_name : string
-
The name of the widget to add
findAreaByName()
Returns the widget area which has the specified name.
public
static findAreaByName(string $name) : static|null
Uses the widget areas defined in the sprout config.
Parameters
- $name : string
-
The name of the widget area to use.
Return values
static|nullgetIndex()
Returns the index of this widget area
public
getIndex() : mixed
getName()
Returns the name of this widget area
public
getName() : mixed
getNiceName()
Returns the nice name of this widget area
public
getNiceName() : mixed
getOrientation()
Gets the orientation of the widget area
public
getOrientation() : mixed
getWidgets()
Gets the list of allowed widgets
public
getWidgets() : mixed
isEmbed()
If the widget area is an embedding area
public
isEmbed() : mixed
parseOrientation()
Normalize a constant or orientation name (tall|wide|email) into a constant.
public
static parseOrientation(int|string $orientation) : int
Parameters
- $orientation : int|string
-
name or constant
Tags
Return values
int —an ORIENTATION constant
setEmbed()
If true, the widget area is an 'embedding' area.
public
setEmbed(mixed $embed) : mixed
Parameters
- $embed : mixed
setNiceName()
Sets the nice name of this widget area
public
setNiceName(string $name) : mixed
Parameters
- $name : string
-
The nice name of the widget
setOrientation()
Sets the orientation of the widget area
public
setOrientation(int $value) : mixed
Parameters
- $value : int
-
The new orientation