include/DashletContainer/Containers/DCAbstract.php
\DashletContainer
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
\SugarBean
$focus= 'null'
The focus bean that is utilized by dashlets
focusnull
Details- Type
- \SugarBean
\DCMetaDataParser
$metaDataParser= 'null'
Instance of the DCMetaDataParser
metaDataParsernull
Details- Type
- \DCMetaDataParser
Methods
__construct(
)
:
void
Constructor of DashletContainer. It will also instantiate the metaDataParser and layout
addDashlet(
\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)
Name | Type | Description |
---|---|---|
$dashletID | \GUID |
|
$group | \GUID |
|
$position | int |
|
$layoutParams | \Associative | Array $layoutParams - any layout params for the Dashlet Container Layout |
Type | Description |
---|---|
bool | - success or failure of add |
getAJAXResponse(
)
:
\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
)
)
Type | Description |
---|---|
\JSON | Data |
getLayout(
)
:
\Associative
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
Type | Description |
---|---|
\Associative | Array ('html'=>html code , 'jsfiles'=>array('js1', 'js2', ...)); |
moveDashlet(
\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
Name | Type | Description |
---|---|---|
$id | \GUID |
|
$group | \GUID |
|
$position | int |
|
$layoutParams | \Associative | Array $layoutParams - any layout params to be passed to the Dashely Container Layout |
Type | Description |
---|---|
bool | - success or failure of move |
removeDashlet(
\GUID $id, \Associative $layoutParams
=
null
)
:
bool
Removes a dashlet from a Dashlet Container and the respective Dashlet Container Layout.
Name | Type | Description |
---|---|---|
$id | \GUID |
|
$layoutParams | \Associative | Array $layoutParams - any layout params specific to this DashletContainer |
Type | Description |
---|---|
bool | - success or failure of remove |
setFocusBean(
\SugarBean $bean
)
:
void
Sets the focus bean for the container
Name | Type | Description |
---|---|---|
$bean | \SugarBean |
|