include/Dashlets/Dashlet.php
\Dashlet
Basic Dashlet
- Children
- \InvadersDashlet
- \iFrameDashlet
- \SugarNewsDashlet
- \JotPadDashlet
- \ChartsDashlet
- \RSSDashlet
- \TrackerDashlet
- \MyClosedOpportunitiesDashlet
- \TopCampaignsDashlet
- \CalendarDashlet
- \MyForecastsDashlet
- \TeamNoticesDashlet
- \DashletGenericChart
- \DashletGeneric
- Api
Properties
int
$autoRefresh= '"0"'
Time period in minutes to refresh the dashlet (0 for never) Do not refresh if $isRefreshable is set to false
To support auto refresh all refreshable dashlets that override process() must call processAutoRefresh()
"0"
Details- Type
- int
array
$dashletStrings= ''
Language strings, must be loaded at the Dashlet level w/ loadLanguage
- Type
- array
bool
$hasScript= 'false'
true if the Dashlet contains javascript
false
Details- Type
- bool
bool
$isConfigPanelClearShown= 'true'
true if the Dashlet configuration options panel has the clear button
true
Details- Type
- bool
bool
$isConfigurable= 'false'
true if the Dashlet has configuration options.
false
Details- Type
- bool
bool
$isRefreshable= 'true'
true if the Dashlet is refreshable (ie charts that provide their own refresh)
true
Details- Type
- bool
Methods
display(
string $text
=
''
)
:
string
Called when Dashlet is displayed, override this
Name | Type | Description |
---|---|---|
$text | string | text after the title |
Type | Description |
---|---|
string | title HTML |
getAutoRefreshOptions(
)
:
array
Returns the available auto refresh settings you can set a dashlet to
Type | Description |
---|---|
array | options available |
getHeader(
string $text
=
''
)
:
string
Called when Dashlet is displayed
Name | Type | Description |
---|---|---|
$text | string | text after the title |
Type | Description |
---|---|
string | Header html |
getTitle(
string $text
=
''
)
:
string
Name | Type | Description |
---|---|---|
$text | string |
Type | Description |
---|---|
string | HTML |
- Deprecated
- No longer needed, replaced with Dashlet::getHeader() and Dashlet::getFooter()
hasAccess(
)
:
bool
Override this in the subclass. It is used to determine whether the dashlet can be displayed.
Type | Description |
---|---|
bool | indicating whether or not the current user has access to display this Dashlet. |
isAutoRefreshable(
)
:
bool
Returns true if the dashlet is auto refreshable
Type | Description |
---|---|
bool |
loadLanguage(
string $dashletClassname, string $dashletDirectory
=
'modules/Home/Dashlets/'
)
:
void
Sets the language strings
Name | Type | Description |
---|---|---|
$dashletClassname | string | classname of the dashlet |
$dashletDirectory | string | directory path of the dashlet |
loadOptions(
)
:
array
Generic way to retrieve options array from UserPreferences
Type | Description |
---|---|
array | options array stored in UserPreferences |
processAutoRefresh(
int $dashletOffset
=
0
)
:
string
Processes and displays the auto refresh code for the dashlet
Name | Type | Description |
---|---|---|
$dashletOffset | int |
Type | Description |
---|---|
string | HTML code |
saveOptions(
array $req
)
:
array
Override this if your dashlet is configurable (this is called when the the configureDashlet form is shown) Filters the array for only the parameters it needs to save
Name | Type | Description |
---|---|---|
$req | array | the array to pull options from |
Type | Description |
---|---|
array | options array |
setConfigureIcon(
)
:
string
Returns the HTML for the configure icon
Type | Description |
---|---|
string | HTML |
setRefreshIcon(
)
:
string
Returns the HTML for the refresh icon
Type | Description |
---|---|
string | HTML |