include/DashletContainer/Containers/DCAbstract.php

Show: inherited
Table of Contents

\DashletContainer

Package: SugarCRM

This class provides the base implementation of the DashletContainer. It handles the passing of data to the DCMetaDataParser. The DCMetaDataParser loads and stores meta-data shared between all Dashlet Container Layouts.

This information includes which Dashlets are avaialble and basic grouping and positioning. This allows for switching between Dashlet Container Layouts and a basic preservation of the Layouts. Each DashletContainer may also store their own custom meta-data specifying DashletContainer specific layout information

Children
\DCMenu
Author
mitani  

Properties

Propertyprivate\SugarBean  $focus= 'null'

The focus bean that is utilized by dashlets

focus
Default valuenullDetails
Type
\SugarBean
Propertyprivate\GUID  $id= 'null'

Id of the current container

ID
Default valuenullDetails
Type
\GUID
Propertyprotected\DCMetaDataParser  $metaDataParser= 'null'

Instance of the DCMetaDataParser

metaDataParser
Default valuenullDetails
Type
\DCMetaDataParser

Methods

methodpublic__construct( ) : void

Constructor of DashletContainer. It will also instantiate the metaDataParser and layout

methodpublicaddDashlet( \GUID $dashletID, \GUID $group, int $position, \Associative $layoutParams = null ) : bool

This function allows for adding a dashlet to a layout.

It calls on DCMetaDataParser for adding the dashlet to the DashletContainer meta-data (allowing for the same dashlets to be rendered between different DashletContainers)

Parameters
Name Type Description
$dashletID \GUID
  • id of the dashlet (not the instance id of the dashlet)
$group \GUID
  • id of the group to add the dashlet to
$position int
  • position in the group to add the dashlet to
$layoutParams \Associative

Array $layoutParams - any layout params for the Dashlet Container Layout

Returns
Type Description
bool - success or failure of add
methodpublicgetAJAXResponse( ) : \JSON

Responds to any AJAX response made by JSDCManager.

It expects requests in the following format

array( 'dashlets'=>array( 'dashlet1-id'=>array('method'=>function to call on, 'data'=>data to pass into the function), 'dashlet2-id'=>array('method'=>function to call on, 'data'=>data to pass into the function), ... ) )

It will return the data in the following format

array( 'dashlets'=> array( 'dashlet1-id'=> response 'dashlet2-id'=>response ... ) 'DCM'=>array( 'status'=>200 - uses sames responses as HTML status response 'response'=> string or array of data for Dashlet Container Manager to process on the JS side

)

)

Returns
Type Description
\JSON Data
methodpublicgetID( ) : \GUID

Returns the containers ID

Returns
Type Description
\GUID id
methodpublicgetLayout( ) : \Associative
abstract

Returns an associative array containing the HTML code as well as any JS files that need to be loaded in order to render the container. If there is a function to call onload it should be handled inside one of the JS files using the YUI Event Handler

Returns
Type Description
\Associative Array ('html'=>html code , 'jsfiles'=>array('js1', 'js2', ...));
methodpublicmoveDashlet( \GUID $id, \GUID $group, int $position, \Associative $layoutParams = null ) : bool

Moves a dashlet from one position to another in a Dashlet Contianer and it's respective Dashlet Container Layout

Parameters
Name Type Description
$id \GUID
  • id of the Dashlet instance to move
$group \GUID
  • group to move it to
$position int
  • position in the group to move it to
$layoutParams \Associative

Array $layoutParams - any layout params to be passed to the Dashely Container Layout

Returns
Type Description
bool - success or failure of move
methodpublicremoveDashlet( \GUID $id, \Associative $layoutParams = null ) : bool

Removes a dashlet from a Dashlet Container and the respective Dashlet Container Layout.

Parameters
Name Type Description
$id \GUID
  • id of the Dashlet instance to remove
$layoutParams \Associative

Array $layoutParams - any layout params specific to this DashletContainer

Returns
Type Description
bool - success or failure of remove
methodpublicsetFocusBean( \SugarBean $bean ) : void

Sets the focus bean for the container

Parameters
Name Type Description
$bean \SugarBean
  • the primary focus bean to be used in the Dashlet Container
Documentation was generated by DocBlox 0.18.1.