include/DashletContainer/Containers/DCMenu.php
\DCMenu
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
- Parent(s)
- \DashletContainer
- Author
- mitani
Properties
\SugarBean
$focus= 'null'
null
Details- Type
- \SugarBean
- Inherited_from
- \DashletContainer::$$focus
\DCMetaDataParser
$metaDataParser= 'null'
Instance of the DCMetaDataParser
metaDataParserInherited from: \DashletContainer::$$metaDataParsernull
Details- Type
- \DCMetaDataParser
- Inherited_from
- \DashletContainer::$$metaDataParser
Methods
__construct(
)
:
void
Constructor of DashletContainer. It will also instantiate the metaDataParser and layout
Inherited from: \DashletContainer::__construct()addDashlet(
\GUID $dashletID, \GUID $group, int $position, \Associative $layoutParams
=
null
)
:
bool
This function allows for adding a dashlet to a layout.
Inherited from: \DashletContainer::addDashlet()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.
Inherited from: \DashletContainer::getAJAXResponse()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', ...)); |
getPartnerIconMenus(
)
:
array
Get the partner icon menus that are displayed in the bottom right footer.
Type | Description |
---|---|
array |
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
Inherited from: \DashletContainer::moveDashlet()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.
Inherited from: \DashletContainer::removeDashlet()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
Name | Type | Description |
---|---|---|
$bean | \SugarBean |
|