22 static $processed_events = [];
24 if (isset($processed_events[
"{$event->getName()}.{$event->getType()}"])) {
28 $processed_events[
"{$event->getName()}.{$event->getType()}"] =
true;
36 if (empty($default_widget_info)) {
43 foreach ($default_widget_info as
$info) {
44 if (
elgg_extract(
'event_name', $info) !== $event->getName()) {
48 if (
elgg_extract(
'event_type', $info) !== $event->getType()) {
73 'subtype' =>
'widget',
75 'private_setting_name' =>
'context',
85 'subtype' =>
'widget',
87 'private_setting_name' =>
'context',
97 $new_widget->container_guid =
$entity->guid;
98 $new_widget->owner_guid =
$entity->guid;
101 $settings = $widget->getAllPrivateSettings();
104 $new_widget->$name =
$value;
elgg_call(int $flags, Closure $closure)
Calls a callable autowiring the arguments using public DI services and applying logic based on flags...
elgg_push_context($context)
Push a context onto the top of the stack.
if(!$user||!$user->canDelete()) $name
elgg_pop_context()
Removes and returns the top context string from the stack.
const ELGG_IGNORE_ACCESS
elgg_call() flags
elgg_get_entities(array $options=[])
Fetches/counts entities or performs a calculation on their properties.
elgg_count_entities(array $options=[])
Returns a count of entities.
elgg_trigger_plugin_hook($hook, $type, $params=null, $returnvalue=null)
Models an event passed to event handlers.
const ELGG_ENTITIES_ANY_VALUE
elgg_get_site_entity()
Get the current site entity.
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.