widget helper class. More...
Public Member Functions | |
__construct ($widget_model) | |
Create new widget instance from a given widget model. | |
get_arguments () | |
Returns the populated argument array. | |
view_path ($view=false) | |
Find path of widget viewer. | |
options () | |
Return the list of options to use in this widget. | |
add_css_class ($class) | |
Hook to force additional CSS classes to the rendering. | |
render ($method='index', $with_chrome=true) | |
Method to render a widget. | |
index () | |
Print the widget contents here. | |
resources ($in_files=false, $type='js') | |
Weird little method that returns all the resources referenced in this instance. | |
add_path ($rel_path) | |
Set correct paths. | |
Static Public Member Functions | |
static | get_current_status () |
DEPRECATED: Do not use. | |
Data Fields | |
$result = false | |
widget content result | |
$js = false | |
required js resources? | |
$css = false | |
additional css? | |
$inline_js = false | |
additional inline javascript, as a string | |
$widget_base_path = false | |
path to widget main directory | |
$widget_full_path = false | |
path to this widget's directory | |
$model = false | |
The widget model instance this widget represents. | |
$extra_data_attributes = array() | |
array Key-value to attach to widget-container (for example ["hello"] => "bye" which renders as <div data-hello="bye" />, good for javascript-hooks | |
$arguments = array() | |
The arguments for this instance, constructed from the option objects. | |
Protected Attributes | |
$editable = TRUE | |
An editable widget has settings that can be changed. | |
$movable = TRUE | |
A movable widget can be dragged around. | |
$collapsable = TRUE | |
A collapsable widget can be collapsed, so only the title bar is visible. | |
$removable = TRUE | |
A removable widget can be deleted. | |
$closeconfirm = TRUE | |
Whether to ask the user to confirm widget deletion. | |
$duplicatable = FALSE | |
Whether the widget can be copied. |
widget helper class.
widget_Base::add_path | ( | $ | rel_path | ) |
Set correct paths.
$rel_path | string: Relative path |
static widget_Base::get_current_status | ( | ) | [static] |
DEPRECATED: Do not use.
For legacy reasons, this provides a shortcut to a populated Current_status_Model instance. There once were significant performance advantages to use this wrapper, but there isn't anymore. Just call Current_status_Model::instance() instead.
widget_Base::index | ( | ) |
Print the widget contents here.
Concrete widgets typically want to override this.
Reimplemented in gridstat_Widget, Listview_Widget, tablestat_Widget, Error_Widget, Monitoring_performance_Widget, Nagvis_Widget, Netw_health_Widget, Netw_outages_Widget, Tac_acknowledged_Widget, Tac_disabled_Widget, Tac_monfeat_Widget, and Tac_scheduled_Widget.
widget_Base::options | ( | ) |
Return the list of options to use in this widget.
This should be an array of option instances, or - if you want to do more manual work - strings.
Actual widgets typically want to extend this method.
Reimplemented in gridstat_Widget, Listview_Widget, tablestat_Widget, Nagvis_Widget, and Netw_health_Widget.
widget_Base::render | ( | $ | method = 'index' , |
|
$ | with_chrome = true | |||
) |
Method to render a widget.
$method | Name of method | |
$with_chrome | True to generate widget with the menus and everything, false otherwise |
widget_Base::view_path | ( | $ | view = false |
) |
Find path of widget viewer.
$view | Template object |
widget_Base::$duplicatable = FALSE [protected] |
Whether the widget can be copied.
Setting this to true requires testing, so default to the more backwards compatible mode
Reimplemented in gridstat_Widget, Listview_Widget, tablestat_Widget, Monitoring_performance_Widget, Nagvis_Widget, Netw_health_Widget, Netw_outages_Widget, Tac_acknowledged_Widget, Tac_disabled_Widget, Tac_monfeat_Widget, and Tac_scheduled_Widget.