24 private $widgetCache = [];
41 $widget_cache_key =
"{$context}-{$owner_guid}";
43 if (isset($this->widgetCache[$widget_cache_key])) {
44 return $this->widgetCache[$widget_cache_key];
49 'subtype' =>
'widget',
50 'owner_guid' => $owner_guid,
51 'metadata_name' =>
'context',
52 'metadata_value' => $context,
57 $this->widgetCache[$widget_cache_key] = [];
63 $widget_column = (int) $widget->column;
65 if (!isset($sorted_widgets[$widget_column])) {
66 $sorted_widgets[$widget_column] = [];
69 if (!isset($sorted_widgets[$widget_column][$widget->order])) {
70 $sorted_widgets[$widget_column][$widget->order] = [];
73 $sorted_widgets[$widget_column][$widget->order][] =
$widget;
76 foreach ($sorted_widgets as $col => $orders) {
81 foreach ($widgets as $widget) {
86 $sorted_widgets[$col] = $sorted_col;
89 $this->widgetCache[$widget_cache_key] = $sorted_widgets;
91 return $sorted_widgets;
107 if (empty($owner_guid) || empty($handler)) {
116 if (!$this->validateType($handler, $context,
$owner)) {
179 $this->widgets[$definition->id] = $definition;
192 unset($this->widgets[$id]);
207 $types = $this->getTypes([
211 $found = array_key_exists($id, $types);
213 if (!$found && (
$context === null)) {
215 $found = array_key_exists($id, $this->widgets);
242 $types = $this->getTypes([
246 if (isset($types[$id])) {
247 return $types[
$id]->name;
273 $available_widgets =
_elgg_services()->events->triggerResults(
'handlers',
'widgets',
$params, $this->widgets);
274 if (!is_array($available_widgets)) {
280 foreach ($available_widgets as $widget_definition) {
285 if (!in_array(
$context, $widget_definition->context)) {
289 if (!$widget_definition->isValid()) {
293 $widgets[$widget_definition->id] = $widget_definition;
elgg_get_default_access(\ElggUser $user=null, array $input_params=[])
Gets the default access permission.
$params
Saves global plugin settings.
if(parse_url(elgg_get_site_url(), PHP_URL_PATH)!== '/') if(file_exists(elgg_get_root_path(). 'robots.txt'))
Set robots.txt.
if(empty($page_owner)||$owner->guid!==$page_owner->guid) $widgets
c Accompany it with the information you received as to the offer to distribute corresponding source complete source code means all the source code for all modules it plus any associated interface definition plus the scripts used to control compilation and installation of the executable as a special the source code distributed need not include anything that is normally and so on of the operating system on which the executable unless that component itself accompanies the executable If distribution of executable or object code is made by offering access to copy from a designated then offering equivalent access to copy the source code from the same place counts as distribution of the source even though third parties are not compelled to copy the source along with the object code You may not or distribute the Program except as expressly provided under this License Any attempt otherwise to sublicense or distribute the Program is void
elgg_get_context()
Get the current context.
if($item instanceof\ElggEntity) elseif($item instanceof\ElggRiverItem) elseif($item instanceof\ElggRelationship) elseif(is_callable([$item, 'getType']))
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
get_entity(int $guid)
Loads and returns an entity object from a guid.
elgg_get_entities(array $options=[])
Fetches/counts entities or performs a calculation on their properties.
Exception indicating a user could not be looked up for a permissions check.
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
_elgg_services()
Get the global service provider.
$id
Generic annotation delete action.