Elgg  Version master
summary.php
Go to the documentation of this file.
1 <?php
17 $relationship = elgg_extract('relationship', $vars);
18 if (!$relationship instanceof ElggRelationship) {
19  return;
20 }
21 
24 if (empty($entity_one) || empty($entity_two)) {
25  return;
26 }
27 
28 // build image block content
29 $summary = '';
30 $summary .= elgg_view('relationship/elements/summary/metadata', $vars);
31 $summary .= elgg_view('relationship/elements/summary/title', $vars);
32 $summary .= elgg_view('relationship/elements/summary/subtitle', $vars);
33 $summary .= elgg_view('relationship/elements/summary/content', $vars);
34 
35 // image block image
36 $icon = elgg_view('relationship/elements/summary/icon', $vars);
37 
38 // image block params
39 $params = (array) elgg_extract('image_block_vars', $vars, []);
42 $params['class'] = $class;
43 $params['data-id'] = $relationship->id;
44 
$vars
Definition: theme.php:5
$class
Definition: summary.php:44
$icon
Definition: summary.php:40
if(! $owner instanceof ElggEntity) $summary
Definition: summary.php:33
$params
Definition: summary.php:43
elgg_extract_class(array $array, array|string $existing=[], string $extract_key='class')
Extract class names from an array, optionally merging into a preexisting set.
Definition: elgglib.php:279
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:256
get_entity(int $guid)
Loads and returns an entity object from a guid.
Definition: entities.php:70
elgg_view_image_block(string $image, string $body, array $vars=[])
Wrapper function for the image block display pattern.
Definition: views.php:898
elgg_view(string $view, array $vars=[], string $viewtype='')
Return a parsed view.
Definition: views.php:156
$relationship
Relationship summary Passing an 'icon' with the variables will wrap the listing in an image block.
Definition: summary.php:17
if(! $relationship instanceof ElggRelationship) $entity_one
Definition: summary.php:22
$entity_two
Definition: summary.php:23