Elgg
Version 4.3
|
Public Member Functions | |
getWidgets ($owner_guid, $context) | |
Get widgets for a particular context. More... | |
createWidget ($owner_guid, $handler, $context, $access_id=null) | |
Create a new widget instance. More... | |
canEditLayout ($context, $user_guid=0) | |
Can the user edit the widget layout. More... | |
registerType (WidgetDefinition $definition) | |
Register a widget type. More... | |
unregisterType ($id) | |
Remove a widget type. More... | |
validateType ($id, $context=null,\ElggEntity $container=null) | |
Checks if a widget type exists for a given id. More... | |
getAllTypes () | |
Get all widgets. More... | |
getNameById ($id, $context= '',\ElggEntity $container=null) | |
Returns widget name based on id. More... | |
getTypes (array $params=[]) | |
Returns the registered widget types. More... | |
Widgets service.
Definition at line 13 of file WidgetsService.php.
Elgg\WidgetsService::canEditLayout | ( | $context, | |
$user_guid = 0 |
|||
) |
Can the user edit the widget layout.
string | $context | The widget context |
int | $user_guid | The GUID of the user (0 for logged in user) |
Definition at line 146 of file WidgetsService.php.
Elgg\WidgetsService::createWidget | ( | $owner_guid, | |
$handler, | |||
$context, | |||
$access_id = null |
|||
) |
Create a new widget instance.
int | $owner_guid | GUID of entity that owns this widget |
string | $handler | The handler for this widget |
string | $context | The context for this widget |
int | $access_id | If not specified, it is set to the default access level |
Definition at line 107 of file WidgetsService.php.
Elgg\WidgetsService::getAllTypes | ( | ) |
Elgg\WidgetsService::getNameById | ( | $id, | |
$context = '' , |
|||
\ElggEntity | $container = null |
||
) |
Returns widget name based on id.
string | $id | Widget identifier |
string | $context | Context to check |
\ElggEntity | $container | Optional limit widget definitions to a container |
Definition at line 254 of file WidgetsService.php.
Elgg\WidgetsService::getTypes | ( | array | $params = [] | ) |
Returns the registered widget types.
Use params to limit the result: [ 'context' => string (defaults to elgg_get_context()), 'container' => (defaults to null) ]
array | $params | Associative array of params used to determine what to return |
Definition at line 278 of file WidgetsService.php.
Elgg\WidgetsService::getWidgets | ( | $owner_guid, | |
$context | |||
) |
Get widgets for a particular context.
The widgets are ordered for display and grouped in columns. $widgets = elgg_get_widgets(elgg_get_logged_in_user_guid(), 'dashboard'); $first_column_widgets = $widgets[1];
int | $owner_guid | The owner GUID of the layout |
string | $context | The context (profile, dashboard, etc) |
Definition at line 40 of file WidgetsService.php.
Elgg\WidgetsService::registerType | ( | WidgetDefinition | $definition | ) |
Register a widget type.
WidgetDefinition | $definition | Definition of the widget |
Definition at line 179 of file WidgetsService.php.
Elgg\WidgetsService::unregisterType | ( | $id | ) |
Remove a widget type.
string | $id | The identifier for the widget |
Definition at line 199 of file WidgetsService.php.
Elgg\WidgetsService::validateType | ( | $id, | |
$context = null , |
|||
\ElggEntity | $container = null |
||
) |
Checks if a widget type exists for a given id.
string | $id | Widget identifier |
string | $context | Optional context to check |
\ElggEntity | $container | Optional limit widget definitions to a container |
Definition at line 219 of file WidgetsService.php.