Elgg  Version 1.11
default.php
Go to the documentation of this file.
1 <?php
11 $icon = elgg_view_entity_icon($vars['entity'], 'small');
12 
13 $title = $vars['entity']->title;
14 if (!$title) {
15  $title = $vars['entity']->name;
16 }
17 if (!$title) {
18  $title = get_class($vars['entity']);
19 }
20 
21 if (elgg_instanceof($vars['entity'], 'object')) {
22  $metadata = elgg_view('navigation/menu/metadata', $vars);
23 }
24 
26 $owner = $vars['entity']->getOwnerEntity();
27 if ($owner) {
28  $owner_link = elgg_view('output/url', array(
29  'href' => $owner->getURL(),
30  'text' => $owner->name,
31  'is_trusted' => true,
32  ));
33 }
34 
35 $date = elgg_view_friendly_time($vars['entity']->getTimeCreated());
36 
37 $subtitle = "$owner_link $date";
38 
39 $params = array(
40  'entity' => $vars['entity'],
41  'title' => $title,
42  'metadata' => $metadata,
43  'subtitle' => $subtitle,
44 );
46 $body = elgg_view('object/elements/summary', $params);
47 
$owner_link
Definition: default.php:17
if(!$owner) $icon
Definition: default.php:16
$params
Definition: default.php:39
elgg_instanceof($entity, $type=null, $subtype=null, $class=null)
Checks if $entity is an and optionally for type and subtype.
Definition: entities.php:922
if($owner) $date
Definition: default.php:35
elgg_view_friendly_time($time)
Displays a UNIX timestamp in a friendly way.
Definition: views.php:1146
elgg_view_image_block($image, $body, $vars=array())
Wrapper function for the image block display pattern.
Definition: views.php:1196
elgg echo
Translates a string.
Definition: languages.js:43
if(!array_key_exists($size, $icon_sizes)) $vars['size']
Definition: default.php:23
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
if(!$title) $metadata
Definition: default.php:32
$subtitle
Definition: default.php:37
$title
Definition: default.php:32
$owner
Definition: default.php:12
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=array())
View the icon of an entity.
Definition: views.php:865
$body
Definition: default.php:29