include/Dashlets/Dashlet.php

Show: inherited
Table of Contents

\Dashlet

Package: SugarCRM

Basic Dashlet

Children
\InvadersDashlet
\iFrameDashlet
\SugarNewsDashlet
\JotPadDashlet
\ChartsDashlet
\RSSDashlet
\TrackerDashlet
\MyClosedOpportunitiesDashlet
\TopCampaignsDashlet
\CalendarDashlet
\MyForecastsDashlet
\TeamNoticesDashlet
\DashletGenericChart
\DashletGeneric
Api
 

Properties

Propertypublicint  $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()

Default value"0"Details
Type
int
Propertypublicarray  $dashletStrings= ''

Language strings, must be loaded at the Dashlet level w/ loadLanguage

Details
Type
array
Propertypublicbool  $hasScript= 'false'

true if the Dashlet contains javascript

Default valuefalseDetails
Type
bool
Propertypublic\guid  $id= ''

Id of the Dashlet

Details
Type
\guid
Propertypublicbool  $isConfigPanelClearShown= 'true'

true if the Dashlet configuration options panel has the clear button

Default valuetrueDetails
Type
bool
Propertypublicbool  $isConfigurable= 'false'

true if the Dashlet has configuration options.

Default valuefalseDetails
Type
bool
Propertypublicbool  $isRefreshable= 'true'

true if the Dashlet is refreshable (ie charts that provide their own refresh)

Default valuetrueDetails
Type
bool
Propertypublicstring  $title= ''Generic Dashlet''

Title of the Dashlet

Default value'Generic Dashlet'Details
Type
string

Methods

methodpublicDashlet(  $id ) : void

Constructor

Parameters
Name Type Description
$id
methodpublicdisplay( string $text = '' ) : string

Called when Dashlet is displayed, override this

Parameters
Name Type Description
$text string

text after the title

Returns
Type Description
string title HTML
methodpublicdisplayOptions( ) : void

Called when Dashlets configuration options are called

methodprotectedgetAutoRefreshOptions( ) : array

Returns the available auto refresh settings you can set a dashlet to

Returns
Type Description
array options available
methodpublicgetFooter( ) : string

Called when Dashlet is displayed

Returns
Type Description
string footer HTML
methodpublicgetHeader( string $text = '' ) : string

Called when Dashlet is displayed

Parameters
Name Type Description
$text string

text after the title

Returns
Type Description
string Header html
methodpublicgetTitle( string $text = '' ) : string

Parameters
Name Type Description
$text string
Returns
Type Description
string HTML
Details
Deprecated
No longer needed, replaced with Dashlet::getHeader() and Dashlet::getFooter()  
methodpublichasAccess( ) : bool

Override this in the subclass. It is used to determine whether the dashlet can be displayed.

Returns
Type Description
bool indicating whether or not the current user has access to display this Dashlet.
methodprotectedisAutoRefreshable( ) : bool

Returns true if the dashlet is auto refreshable

Returns
Type Description
bool
methodpublicloadLanguage( string $dashletClassname, string $dashletDirectory = 'modules/Home/Dashlets/' ) : void

Sets the language strings

Parameters
Name Type Description
$dashletClassname string

classname of the dashlet

$dashletDirectory string

directory path of the dashlet

methodpublicloadOptions( ) : array

Generic way to retrieve options array from UserPreferences

Returns
Type Description
array options array stored in UserPreferences
methodpublicprocess( ) : void

Override if you need to do pre-processing before display is called

methodprotectedprocessAutoRefresh( int $dashletOffset = 0 ) : string

Processes and displays the auto refresh code for the dashlet

Parameters
Name Type Description
$dashletOffset int
Returns
Type Description
string HTML code
methodpublicsaveOptions( 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

Parameters
Name Type Description
$req array

the array to pull options from

Returns
Type Description
array options array
methodpublicsetConfigureIcon( ) : string

Returns the HTML for the configure icon

Returns
Type Description
string HTML
methodpublicsetDeleteIcon( ) : string

Returns the HTML for the delete icon

Returns
Type Description
string HTML
methodpublicsetRefreshIcon( ) : string

Returns the HTML for the refresh icon

Returns
Type Description
string HTML
methodpublicstoreOptions( array $optionsArray ) : void

Generic way to store an options array into UserPreferences

Parameters
Name Type Description
$optionsArray array

the array to save

Documentation was generated by DocBlox 0.18.1.