class Area extends ConcreteObject implements ObjectInterface (View source)

Properties

$error from  ConcreteObject
int $cID
int $arID
string $arHandle
Page $c
int $maximumBlocks

limits the number of blocks in the area.

protected bool $showControls
string $enclosingStart
string $enclosingEnd
Block[] $areaBlocksArray

Array of Blocks within the current area.

protected bool $arIsLoaded
protected bool $arUseGridContainer
protected string $arDisplayName
protected int $arGridMaximumColumns
protected bool $arOverrideCollectionPermissions
protected int $arInheritPermissionsFromAreaOnCID
protected array $arCustomTemplates

Methods

loadError($error)

No description

isError()

No description

getError()

No description

setPropertiesFromArray($arr)

No description

static 
camelcase($file)

No description

static 
uncamelcase($string)

No description

setAreaDisplayName(string $arDisplayName)

No description

bool
showControls()

Returns whether or not controls are to be displayed.

forceControlsToDisplay()

Force enables controls to show.

setAreaGridMaximumColumns(int $cspan)

No description

int|null
getAreaGridMaximumColumns()

No description

enableGridContainer()

Enable Grid containers.

bool
isGridContainerEnabled()

No description

string
getAreaDisplayName()

No description

__construct($arHandle)

The constructor is used primarily on page templates to create areas of content that are editable within the cms.

int
getCollectionID()

returns the Collection's cID.

Page
getAreaCollectionObject()

returns the Collection object for the current Area.

bool
isGlobalArea()

whether or not it's a global area.

int
getAreaID()

returns the arID of the current area.

string
getAreaHandle()

returns the handle for the current area.

int
getTotalBlocksInArea(Page $c = false)

Returns the total number of blocks in an area.

int
getTotalBlocksInAreaEditMode()

Returns the amount of actual blocks in the area, does not exclude core blocks or layouts, does not recurse.

bool
overrideCollectionPermissions()

check if the area has permissions that override the page's permissions.

int
getAreaCollectionInheritID()

No description

setBlockLimit(int $num)

Sets the total number of blocks an area allows. Does not limit by type.

disableControls()

disables controls for the current area.

int
getMaximumBlocks()

gets the maximum allowed number of blocks, -1 if unlimited.

refreshCache(Page $c)

No description

static Area
get(Page $c, string $arHandle)

Gets the Area object for the given page and area handle.

create(Page $c, string $arHandle)

Creates an area in the database. I would like to make this static but PHP pre 5.3 sucks at this stuff.

static string
getAreaHandleFromID($arID)

No description

Block[]
getAreaBlocksArray(Page|bool $c = false)

Get all of the blocks within the current area for a given page.

static array
getHandleList()

Gets a list of all areas.

static Area[]
getListOnPage(Page $c)

No description

revertToPagePermissions()

This function removes all permissions records for the current Area and sets it to inherit from the Page permissions.

__destruct()

No description

bool
rescanAreaPermissionsChain()

Rescans the current Area's permissions ensuring that it's inheriting permissions properly up the chain.

rescanSubAreaPermissions(int $cIDToCheck = null)

works a lot like rescanAreaPermissionsChain() but it works down. This is typically only called when we update an area to have specific permissions, and all areas that are on pagesbelow it with the same handle, etc... should now inherit from it.

bool
rescanSubAreaPermissionsMasterCollection(Page $masterCollection)

similar to rescanSubAreaPermissions, but for those who have setup their pages to inherit master collection permissions.

static Area
getOrCreate(Page $c, string $arHandle)

No description

load(Page $c)

No description

Block[]
getAreaBlocks()

No description

bool
display(Page|bool $c = false, Block[] $alternateBlockArray = null)

displays the Area in the page ex: $a = new Area('Main'); $a->display($c);.

export(SimpleXMLElement $p, Page $page)

Exports the area to content format.

setBlockWrapperStart(string $html)

Specify HTML to automatically print before blocks contained within the area.

setBlockWrapperEnd(string $html)

Set HTML that automatically prints after any blocks contained within the area.

overridePagePermissions()

No description

setCustomTemplate(string $btHandle, string $view)

Sets a custom block template for blocks of a type specified by the btHandle Note, these can be stacked. For example $a->setCustomTemplate('image', 'banner'); $a->setCustomTemplate('content', 'masthead_content');.

array
getAreaCustomTemplates()

returns an array of custom templates defined for this Area object.

Details

loadError($error)

No description

Parameters

$error

isError()

No description

getError()

No description

setPropertiesFromArray($arr)

No description

Parameters

$arr

static camelcase($file)

No description

Parameters

$file

static uncamelcase($string)

No description

Parameters

$string

setAreaDisplayName(string $arDisplayName)

No description

Parameters

string $arDisplayName

bool showControls()

Returns whether or not controls are to be displayed.

Return Value

bool

forceControlsToDisplay()

Force enables controls to show.

setAreaGridMaximumColumns(int $cspan)

No description

Parameters

int $cspan

int|null getAreaGridMaximumColumns()

No description

Return Value

int|null

Exceptions

Exception

final enableGridContainer()

Enable Grid containers.

bool isGridContainerEnabled()

No description

Return Value

bool

string getAreaDisplayName()

No description

Return Value

string

__construct($arHandle)

The constructor is used primarily on page templates to create areas of content that are editable within the cms.

ex: $a = new Area('Main'); $a->display($c) We actually use Collection::getArea() when we want to interact with a fully qualified Area object when dealing with a Page/Collection object.

Parameters

$arHandle

getPermissionObjectIdentifier()

No description

getPermissionResponseClassName()

No description

getPermissionAssignmentClassName()

No description

getPermissionObjectKeyCategoryHandle()

No description

int getCollectionID()

returns the Collection's cID.

Return Value

int

Page getAreaCollectionObject()

returns the Collection object for the current Area.

Return Value

Page

bool isGlobalArea()

whether or not it's a global area.

Return Value

bool

int getAreaID()

returns the arID of the current area.

Return Value

int

string getAreaHandle()

returns the handle for the current area.

Return Value

string

int getTotalBlocksInArea(Page $c = false)

Returns the total number of blocks in an area.

Parameters

Page $c

must be passed if the display() method has not been run on the area object yet.

Return Value

int

int getTotalBlocksInAreaEditMode()

Returns the amount of actual blocks in the area, does not exclude core blocks or layouts, does not recurse.

Return Value

int

bool overrideCollectionPermissions()

check if the area has permissions that override the page's permissions.

Return Value

bool

int getAreaCollectionInheritID()

No description

Return Value

int

setBlockLimit(int $num)

Sets the total number of blocks an area allows. Does not limit by type.

Parameters

int $num

disableControls()

disables controls for the current area.

int getMaximumBlocks()

gets the maximum allowed number of blocks, -1 if unlimited.

Return Value

int

refreshCache(Page $c)

No description

Parameters

Page $c

final static Area get(Page $c, string $arHandle)

Gets the Area object for the given page and area handle.

Parameters

Page $c
string $arHandle

Return Value

Area

Area create(Page $c, string $arHandle)

Creates an area in the database. I would like to make this static but PHP pre 5.3 sucks at this stuff.

Parameters

Page $c
string $arHandle

Return Value

Area

static string getAreaHandleFromID($arID)

No description

Parameters

$arID

Return Value

string

Block[] getAreaBlocksArray(Page|bool $c = false)

Get all of the blocks within the current area for a given page.

Parameters

Page|bool $c

Return Value

Block[]

static array getHandleList()

Gets a list of all areas.

Return Value

array

static Area[] getListOnPage(Page $c)

No description

Parameters

Page $c

Return Value

Area[]

revertToPagePermissions()

This function removes all permissions records for the current Area and sets it to inherit from the Page permissions.

__destruct()

No description

bool rescanAreaPermissionsChain()

Rescans the current Area's permissions ensuring that it's inheriting permissions properly up the chain.

Return Value

bool

rescanSubAreaPermissions(int $cIDToCheck = null)

works a lot like rescanAreaPermissionsChain() but it works down. This is typically only called when we update an area to have specific permissions, and all areas that are on pagesbelow it with the same handle, etc... should now inherit from it.

Parameters

int $cIDToCheck

bool rescanSubAreaPermissionsMasterCollection(Page $masterCollection)

similar to rescanSubAreaPermissions, but for those who have setup their pages to inherit master collection permissions.

Parameters

Page $masterCollection

Return Value

bool

See also

Area::rescanSubAreaPermissions

static Area getOrCreate(Page $c, string $arHandle)

No description

Parameters

Page $c
string $arHandle

Return Value

Area

load(Page $c)

No description

Parameters

Page $c

protected Block[] getAreaBlocks()

No description

Return Value

Block[]

bool display(Page|bool $c = false, Block[] $alternateBlockArray = null)

displays the Area in the page ex: $a = new Area('Main'); $a->display($c);.

Parameters

Page|bool $c
Block[] $alternateBlockArray

optional array of blocks to render instead of default behavior

Return Value

bool

export(SimpleXMLElement $p, Page $page)

Exports the area to content format.

Parameters

SimpleXMLElement $p
Page $page

setBlockWrapperStart(string $html)

Specify HTML to automatically print before blocks contained within the area.

Parameters

string $html

setBlockWrapperEnd(string $html)

Set HTML that automatically prints after any blocks contained within the area.

Parameters

string $html

overridePagePermissions()

No description

setCustomTemplate(string $btHandle, string $view)

Sets a custom block template for blocks of a type specified by the btHandle Note, these can be stacked. For example $a->setCustomTemplate('image', 'banner'); $a->setCustomTemplate('content', 'masthead_content');.

Parameters

string $btHandle

handle for the block type

string $view

string identifying the block template ex: 'templates/breadcrumb.php'

array getAreaCustomTemplates()

returns an array of custom templates defined for this Area object.

Return Value

array