Elgg  Version master
summary.php
Go to the documentation of this file.
1 <?php
17 $annotation = elgg_extract('annotation', $vars);
18 if (!$annotation instanceof ElggAnnotation) {
19  return;
20 }
21 
22 $entity = $annotation->getEntity();
23 if (!$entity instanceof ElggEntity) {
24  return;
25 }
26 
27 $owner = $annotation->getOwnerEntity();
28 if (!$owner instanceof ElggEntity) {
29  return;
30 }
31 
32 // build image block content
33 $summary = '';
34 $summary .= elgg_view('annotation/elements/summary/metadata', $vars);
35 $summary .= elgg_view('annotation/elements/summary/title', $vars);
36 $summary .= elgg_view('annotation/elements/summary/subtitle', $vars);
37 $summary .= elgg_view('annotation/elements/summary/content', $vars);
38 
39 // image block image
40 $icon = elgg_view('annotation/elements/summary/icon', $vars);
41 
42 // image block params
43 $params = (array) elgg_extract('image_block_vars', $vars, []);
46 $params['class'] = $class;
47 $params['data-id'] = $annotation->id;
48 
if(!$entity instanceof ElggEntity) $owner
Definition: summary.php:27
$icon
Definition: summary.php:40
$params
Definition: summary.php:43
elgg_view_image_block(string $image, string $body, array $vars=[])
Wrapper function for the image block display pattern.
Definition: views.php:919
$annotation
Annotation summary Passing an &#39;icon&#39; with the variables will wrap the listing in an image block...
Definition: summary.php:17
elgg_extract_class(array $array, $existing=[], $extract_key= 'class')
Extract class names from an array, optionally merging into a preexisting set.
Definition: elgglib.php:276
$class
Definition: summary.php:44
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:177
$vars
Definition: theme.php:5
if(!$owner instanceof ElggEntity) $summary
Definition: summary.php:33
if(!$annotation instanceof ElggAnnotation) $entity
Definition: summary.php:22