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

Class Concrete5_Library_BlockController

The parent object of all individual block type controllers. Responsible for installing the block, saving its data, rendering its various templates.

Concrete5_Library_Controller
Extended by Controller
Extended by Concrete5_Library_BlockController

Direct known subclasses

BlockController

Indirect known subclasses

AutonavBlockController, Concrete5_Controller_Block_Autonav, Concrete5_Controller_Block_DateArchive, Concrete5_Controller_Block_DateNav, Concrete5_Controller_Block_ExternalForm, Concrete5_Controller_Block_File, Concrete5_Controller_Block_FlashContent, Concrete5_Controller_Block_GoogleMap, Concrete5_Controller_Block_Guestbook, Concrete5_Controller_Block_Html, Concrete5_Controller_Block_Image, Concrete5_Controller_Block_NextPrevious, Concrete5_Controller_Block_Content, Concrete5_Controller_Block_PageList, Concrete5_Controller_Block_RssDisplayer, Concrete5_Controller_Block_Search, Concrete5_Controller_Block_Slideshow, Concrete5_Controller_Block_Survey, Concrete5_Controller_Block_Tags, Concrete5_Controller_Block_Video, Concrete5_Controller_Block_Youtube, ContentBlockController, CoreScrapbookDisplayBlockController, Concrete5_Controller_Block_CoreScrapbookDisplay, CoreStackDisplayBlockController, DashboardAppStatusBlockController, DashboardFeaturedAddonBlockController, DashboardFeaturedThemeBlockController, DashboardNewsflowLatestBlockController, DashboardSiteActivityBlockController, DateArchiveBlockController, DateNavBlockController, ExternalFormBlockController, FileBlockController, Concrete5_Controller_Block_CoreStackDisplay, FlashContentBlockController, GoogleMapBlockController, GuestbookBlockController, HtmlBlockController, ImageBlockController, NextPreviousBlockController, PageListBlockController, RssDisplayerBlockController, SearchBlockController, SlideshowBlockController, Concrete5_Controller_Block_DashboardAppStatus, SurveyBlockController, TagsBlockController, TestFormExternalFormBlockController, VideoBlockController, YoutubeBlockController, Concrete5_Controller_Block_DashboardFeaturedAddon, Concrete5_Controller_Block_DashboardFeaturedTheme, Concrete5_Controller_Block_DashboardNewsflowLatest, Concrete5_Controller_Block_DashboardSiteActivity

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

Methods summary

public
public
# set( string $key, string $value )

Sets a value used by a particular block. These variables will automatically be present in the corresponding views used by the block.

public mixed
# get( string $key, mixed $defaultValue = null )

If no arguments are passed, returns the GET array. If a key is passed, it returns the value as it exists in the GET array. Also checks the set array, because this function used to return the value of the $this->set() function If a default value is provided and the key does not exist in the GET array, the default value is returned

public
public array
# getSets( )
public mixed
# install( string $path )

Installs the current block's DB xml file. If a block needs to do more than this, this should be overridden.

public function install($path) {
    $this->doMySpecialInstallMethod();
    $this->doSecondSpecialInstallMethod();
    parent::install($path);
}
public
# render( string $view )

Renders a view in the block's folder.

public function view() { // The view() method is automatically run when a block is viewed
    $this->render("other_special_view"); // don't use .php
}
public
# validate( $args )
public
public
# save( array $args )

Run when a block is added or edited. Automatically saves block data against the block's database table. If a block needs to do more than this (save to multiple tables, upload files, etc... it should override this.

public
# getPermissionObject( )
public
# getPermissionsObject( )
public BlockRecord
# duplicate( integer $newBID )

Automatically run when a block is duplicated. This most likely happens when a block is edited: a block is first duplicated, and then presented to the user to make changes.

public
# __wakeup( )
public
public
# export( SimpleXMLElement $blockNode )
protected
# getImportData( $blockNode )
protected
# importAdditionalData( $b, $blockNode )
public
# import( $page, $arHandle, SimpleXMLElement $blockNode )
public
public
public
public
public
public Page
# getCollectionObject( )

Gets the current controller's page object.

public
# field( $fieldName )
public mixed
# post( string $field = false, mixed $defaultValue = null )

If no arguments are passed, returns the post array. If a key is passed, it returns the value as it exists in the post array. If a default value is provided and the key does not exist in the POST array, the default value is returned

public
# delete( )

Automatically run when a block is deleted. This removes the special data from the block's specific database table. If a block needs to do more than this this method should be overridden.

protected
# load( )

Loads the BlockRecord class based on its attribute names

public
# __construct( BlockType $obj = null )

Instantiates the block controller.

public
public
# addHeaderItem( string $file )

Adds an item to the view's header. This item will then be automatically printed out in the section of the page

public
# setupAndRun( $method )

Based on the current request, the Controller object is loaded with the parameters and task requested The requested method is then run on the active controller (if that method exists)

public Block
# getBlockObject( )

Gets the generic Block object attached to this controller's instance

public
# setBlockObject( $b )

Sets the block object for this controller

public
public string
# getBlockTypeName( )

Returns the name of the block type

public integer
# getInterfaceWidth( )

Returns the width of the block type's interface when presented in page.

public integer
# getInterfaceHeight( )

Returns the height of the block type's interface when presented in page.

public string
# getBlockTypeDescription( )

Returns the description of the block type

public
# getBlockTypeHelp( )

Returns HTML that will be shown when a user wants help for a given block type

public
public
public boolean
# includeAll( )

Returns whether this block type is included in all versions. Default is false - block types are typically versioned but sometimes it makes sense not to do so.

public boolean
# isBlockTypeInternal( )

Returns whether this block type is internal to Concrete. If it's internal it's not displayed in the front end interface. Examples include the LibraryFile block.

public
# getJavaScriptStrings( )

Returns a key/value array of strings that is used to translate items when used in javascript

Properties summary

protected $record
#
protected array $helpers
# array('form')
protected static $sets
#
protected $block
#
protected string $btDescription
# ""
protected string $btName
# ""
protected string $btHandle
# ""
protected integer $btIsInternal
# 0
protected integer $btActiveWhenAdded
# 1
protected integer $btCopyWhenPropagate
# 0
protected integer $btIncludeAll
# 0
protected string $dbFile
# 'db.xml'
protected string $btInterfaceWidth
# "400"
protected string $btInterfaceHeight
# "400"
protected boolean $btHasRendered
# false
protected boolean $btCacheBlockRecord
# false
protected boolean $btCacheBlockOutput
# false
protected integer $btCacheBlockOutputLifetime
# 0
protected boolean $btCacheBlockOutputOnPost
# false
protected boolean $btCacheBlockOutputForRegisteredUsers
# false
protected array $btExportPageColumns
# array()
protected array $btExportFileColumns
# array()
protected array $btExportPageTypeColumns
# array()
protected string $btWrapperClass
# ''
public array $headerItems
# array()
protected $identifier
#