Elgg  Version master
entity.php
Go to the documentation of this file.
1 <?php
8 $entity = elgg_extract('entity', $vars);
9 if (!$entity instanceof \ElggEntity) {
10  return;
11 }
12 
13 $views = [
14  "trash/{$entity->getType()}/{$entity->getSubtype()}",
15  "trash/{$entity->getType()}/default",
16  'trash/entity/default',
17 ];
18 
19 foreach ($views as $view) {
20  if (!elgg_view_exists($view)) {
21  continue;
22  }
23 
24  echo elgg_view($view, $vars);
25  break;
26 }
$entity
Entity view of an item in the trash.
Definition: entity.php:8
if(!$entity instanceof\ElggEntity) $views
Definition: entity.php:13
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
if(!empty($avatar)&&!$avatar->isValid()) elseif(empty($avatar)) if(!$owner->saveIconFromUploadedFile('avatar')) if(!elgg_trigger_event('profileiconupdate', $owner->type, $owner)) $view
Definition: upload.php:39
$vars
Definition: theme.php:5
elgg_view_exists(string $view, string $viewtype= '', bool $recurse=true)
Returns whether the specified view exists.
Definition: views.php:131