28 private $widgetCache = array();
36 $widget_cache_key =
"$context-$owner_guid";
38 if (isset($this->widgetCache[$widget_cache_key])) {
39 return $this->widgetCache[$widget_cache_key];
44 'subtype' =>
'widget',
46 'private_setting_name' =>
'context',
55 $sorted_widgets = array();
57 if (!isset($sorted_widgets[(
int)$widget->column])) {
58 $sorted_widgets[(int)$widget->column] = array();
60 $sorted_widgets[(int)$widget->column][$widget->order] = $widget;
63 foreach ($sorted_widgets as $col =>
$widgets) {
64 ksort($sorted_widgets[$col]);
67 $this->widgetCache[$widget_cache_key] = $sorted_widgets;
69 return $sorted_widgets;
93 if (isset($access_id)) {
94 $widget->access_id = $access_id;
150 $id = $definition->id;
187 $types = $this->getTypes([
191 $found = array_key_exists(
$id, $types);
193 if (!$found && (
$context === null)) {
195 $found = array_key_exists(
$id, $this->
widgets);
222 $types = $this->getTypes([
226 if (isset($types[
$id])) {
227 return $types[
$id]->name;
255 if (!is_array($available_widgets)) {
260 foreach ($available_widgets as $widget_definition) {
266 if (in_array(
$context, $widget_definition->context)) {
267 $widgets[$widget_definition->id] = $widget_definition;
270 if (in_array(
'all', $widget_definition->context) || in_array(
$context, $widget_definition->context)) {
271 $widgets[$widget_definition->id] = $widget_definition;
elgg_get_entities_from_private_settings(array $options=array())
Returns entities based upon private settings.
elgg layout widgets elgg widgets
get_default_access(ElggUser $user=null, array $input_params=array())
Gets the default access permission.
Exception indicating a user could not be looked up for a permissions check.
elgg_get_context()
Get the current context.
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
_elgg_services(\Elgg\Di\ServiceProvider $services=null)
Get the global service provider.
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
$user_guid
Avatar remove action.
if(!$collection_name) $id
http free of to any person obtaining a copy of this software and associated documentation to deal in the Software without including without limitation the rights to use
elgg_get_page_owner_guid($guid=0)
Gets the guid of the entity that owns the current page.
get_entity($guid)
Loads and returns an entity object from a guid.