This is the API documentation for concrete5 version 5.6 and earlier. View Current API Documentation

Class Concrete5_Model_Area

An area object is used within templates to mark certain portions of pages as editable and containers of dynamic content

Concrete5_Library_Object
Extended by Object
Extended by Concrete5_Model_Area

Direct known subclasses

Area

Indirect known subclasses

Concrete5_Model_GlobalArea, GlobalArea

Package: Pages
Category: Concrete
Copyright: Copyright (c) 2003-2008 Concrete5. (http://www.concrete5.org)
License: MIT License
Author: Andrew Embler andrew@concrete5.org
Located at core/models/area.php

Methods summary

public
# __construct( string $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

public
public integer
# getCollectionID( )

returns the Collection's cID

public Collection
# getAreaCollectionObject( )

returns the Collection object for the current Area

public boolean
# isGlobalArea( )

whether or not it's a global area

public integer
# getAreaID( )

returns the arID of the current area

public string
# getAreaHandle( )

returns the handle for the current area

public array
# getCustomTemplates( )

returns an array of custom templates

public
# setCustomTemplate( string $btHandle, string $view )

sets a custom block template for blocks of a type specified by the btHandle

public
# getTotalBlocksInArea( Page $c = false )

Returns the total number of blocks in an area.

public boolean
# overrideCollectionPermissions( )

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

public integer
# getAreaCollectionInheritID( )
public
# setBlockLimit( integer $num )

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

public
# setAttribute( $attr, $val )
public
# getAttribute( $attr )
public
# disableControls( )

disables controls for the current area

public boolean
# areaAcceptsBlocks( )

determines if the current Area can accept additonal Blocks

public integer
# getMaximumBlocks( )

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

public string
# getAreaUpdateAction( $task = 'update', $alternateHandler = null )
public static Area
# get( Page|Collection & $c, string $arHandle, integer|null $arIsGlobal = null )

Gets the Area object for the given page and area handle

public static Area
# getOrCreate( Page|Collection & $c, string $arHandle, boolean $arIsGlobal = 0 )

Gets or creates if necessary an Area for the given Page, Handle

public static
public Block[]
# getAreaBlocksArray( Page|Collection $c )

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

public boolean|BlockTypeList
# getAddBlockTypes( Page|Collection & $c, AreaPermissions & $ap )

determins based on permissions what types of blocks, if any can be added to this area

public array
# getHandleList( )

gets a list of all areas - no relation to the current page or area object possibly could be set as a static method??

public
# revertToPagePermissions( )

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

public
public
# rescanAreaPermissionsChain( )

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

public
# rescanSubAreaPermissions( $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.

public
# rescanSubAreaPermissionsMasterCollection( $masterCollection )

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

public
# display( Page|Collection & $c, Block[] $alternateBlockArray = null )

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

protected
# outputBlockWrapper( $isStart, & $block, $blockPositionInArea )

outputs the block wrapers for each block Internal helper function for display()

public Layout[]
# getAreaLayouts( Page|Collection $c )

Gets all layout grid objects for a collection

public
# export( $p, $page )

Exports the area to content format

public
# setBlockWrapperStart( string $html, boolean $hasReplacements = false )

Specify HTML to automatically print before blocks contained within the area Pass true for $hasReplacements if the $html contains sprintf replacements tokens. Available tokens: %1$s -> Block ID %2$s -> Block Type Handle %3$s -> Block/Stack Name %4$s -> Block position in area (first block is 1, second block is 2, etc.) %5$s -> 'odd' or 'even' (useful for "zebra stripes" CSS classes)

public
# setBlockWrapperEnd( string $html, boolean $hasReplacements = false )

Set HTML that automatically prints after any blocks contained within the area Pass true for $hasReplacements if the $html contains sprintf replacements tokens. See setBlockWrapperStart() comments for available tokens.

public

Properties summary

public $cID
#
public $arID
#
public $arHandle
#
public $c
#
public integer $maximumBlocks

limits the number of blocks in the area

# -1
public array $customTemplateArray

sets a custom template for all blocks in the area

# array()
public string $firstRunBlockTypeHandle

block type handle for the block to automatically activate on first_run

#
public integer $ratingThreshold

if set higher, any blocks that aren't rated high enough aren't seen (unless you have sufficient privs)

# 0
public boolean $showControls
# true
public array $attributes
# array()
public string $enclosingStart
# ''
public boolean $enclosingStartHasReplacements

Denotes if we should run sprintf() on blockWrapperStart

# false
public string $enclosingEnd
# ''
public boolean $enclosingEndHasReplacements

Denotes if we should run sprintf() on blockWrapperStartEnd

# false
public integer $totalBlocks

the number of blocks currently rendered in the area

# 0
public Block[] $areaBlocksArray

Array of Blocks within the current area not an array actually until it's set

#

Properties inherited from Concrete5_Library_Object

$error