Elgg
Version 4.3
Main Page
Related Pages
Namespaces
Classes
Files
Examples
File List
File Members
engine
lib
widgets.php
Go to the documentation of this file.
1
<?php
20
function
elgg_get_widgets
(
$owner_guid
,
$context
) {
21
return
_elgg_services
()->widgets->getWidgets(
$owner_guid
,
$context
);
22
}
23
35
function
elgg_create_widget
(
$owner_guid
,
$handler
,
$context
,
$access_id
= null) {
36
return
_elgg_services
()->widgets->createWidget(
$owner_guid
,
$handler
,
$context
,
$access_id
);
37
}
38
50
function
elgg_can_edit_widget_layout
(
$context
,
$user_guid
= 0) {
51
return
_elgg_services
()->widgets->canEditLayout(
$context
,
$user_guid
);
52
}
53
69
function
elgg_register_widget_type
(
$handler
,
$name
= null,
$description
= null,
$context
= [], $multiple =
false
) {
70
if
(is_array(
$handler
)) {
71
$definition =
\Elgg\WidgetDefinition::factory
(
$handler
);
72
}
else
{
73
$definition =
\Elgg\WidgetDefinition::factory
([
74
'id'
=>
$handler
,
75
'name'
=>
$name
,
76
'description'
=>
$description
,
77
'context'
=>
$context
,
78
'multiple'
=> $multiple,
79
]);
80
}
81
82
return
_elgg_services
()->widgets->registerType($definition);
83
}
84
93
function
elgg_unregister_widget_type
(
$handler
) {
94
return
_elgg_services
()->widgets->unregisterType(
$handler
);
95
}
96
107
function
elgg_is_widget_type
(
$handler
,
$context
= null, \
ElggEntity
$container
= null) {
108
return
_elgg_services
()->widgets->validateType(
$handler
,
$context
,
$container
);
109
}
110
127
function
elgg_get_widget_types
(
$context
=
""
) {
128
if
(is_array(
$context
)) {
129
$params
=
$context
;
130
}
else
{
131
$params
= [
132
'context'
=>
$context
,
133
'container'
=> null,
134
];
135
}
136
return
_elgg_services
()->widgets->getTypes(
$params
);
137
}
$user_guid
$user_guid
Definition:
login_as.php:10
$params
$params
Saves global plugin settings.
Definition:
save.php:13
$name
if(!$user||!$user->canDelete()) $name
Definition:
delete.php:22
elgg_is_widget_type
elgg_is_widget_type($handler, $context=null,\ElggEntity $container=null)
Has a widget type with the specified handler been registered.
Definition:
widgets.php:107
elgg_register_widget_type
elgg_register_widget_type($handler, $name=null, $description=null, $context=[], $multiple=false)
Register a widget type.
Definition:
widgets.php:69
ElggEntity
elgg_get_widget_types
elgg_get_widget_types($context="")
Get the widget types for a context.
Definition:
widgets.php:127
elgg_get_widgets
elgg_get_widgets($owner_guid, $context)
Elgg widgets library.
Definition:
widgets.php:20
Elgg\WidgetDefinition\factory
static factory(array $options)
Create an WidgetDefinition from an associative array.
Definition:
WidgetDefinition.php:71
elgg_can_edit_widget_layout
elgg_can_edit_widget_layout($context, $user_guid=0)
Can the user edit the widget layout.
Definition:
widgets.php:50
$container
$container
Definition:
delete.php:23
$description
$description
Definition:
record.php:15
$context
if($owner->guid!=$page_owner->guid) $context
Definition:
widgets.php:35
$owner_guid
$owner_guid
Definition:
widgets.php:15
_elgg_services
_elgg_services()
Get the global service provider.
Definition:
elgglib.php:638
$access_id
$access_id
Definition:
access.php:11
$handler
$handler
Definition:
add.php:7
elgg_unregister_widget_type
elgg_unregister_widget_type($handler)
Remove a widget type.
Definition:
widgets.php:93
elgg_create_widget
elgg_create_widget($owner_guid, $handler, $context, $access_id=null)
Create a new widget instance.
Definition:
widgets.php:35
Generated on Tue May 30 2023 00:00:26 for Elgg by
1.8.11