Elgg  Version 2.3
summary.php
Go to the documentation of this file.
1 <?php
2 
18 $entity = elgg_extract('entity', $vars);
19 if (!$entity instanceof ElggEntity) {
20  elgg_log("object/elements/summary expects an ElggEntity in \$vars['entity']", 'ERROR');
21 }
22 
23 $title = elgg_extract('title', $vars, '');
24 if ($title === '' && $entity instanceof ElggEntity) {
25  $vars['title'] = elgg_view('output/url', [
26  'text' => elgg_get_excerpt($entity->getDisplayName(), 100),
27  'href' => $entity->getURL(),
28  ]);
29 }
30 
31 $tags = elgg_extract('tags', $vars, '');
32 if ($tags === '') {
33  $tags = elgg_view('output/tags', [
34  'entity' => $entity,
35  ]);
36 }
37 
38 $metadata = elgg_view('object/elements/summary/metadata', $vars);
39 $title = elgg_view('object/elements/summary/title', $vars);
40 $subtitle = elgg_view('object/elements/summary/subtitle', $vars);
41 $extensions = elgg_view('object/summary/extend', $vars);
42 $content = elgg_view('object/elements/summary/content', $vars);
43 
45 
47 if (isset($icon)) {
48  $params = (array) elgg_extract('image_block_vars', $vars, []);
51  $params['class'] = $class;
52  $params['data-guid'] = $entity->guid;
53 
55 } else {
56  echo $summary;
57 }
$extensions
Definition: summary.php:41
if($tags=== '') $metadata
Definition: summary.php:38
$icon
Definition: summary.php:46
if($title=== ''&&$entity instanceof ElggEntity) $tags
Definition: summary.php:31
$summary
Definition: summary.php:44
$class
Definition: field.php:20
elgg_extract_class(array $array, $existing=[])
Extract class names from an array with key "class", optionally merging into a preexisting set...
Definition: elgglib.php:1396
$vars['entity']
$params
Definition: login.php:72
elgg_view_image_block($image, $body, $vars=array())
Wrapper function for the image block display pattern.
Definition: views.php:1229
if(!$entity instanceof ElggEntity) $title
Definition: summary.php:23
elgg echo
Translates a string.
Definition: languages.js:48
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:336
$content
Definition: summary.php:42
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1375
elgg_log($message, $level= 'NOTICE')
Display or log a message.
Definition: elgglib.php:1028
$subtitle
Definition: summary.php:40
elgg_get_excerpt($text, $num_chars=250)
Returns an excerpt.
Definition: output.php:62
$entity
Object summary Passing an &#39;icon&#39; with the variables will wrap the listing in an image block...
Definition: summary.php:18