Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
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 
48 echo elgg_view_image_block($icon, $body, $vars);
$metadata
Definition: entity.php:19
$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:716
elgg_view_image_block($image, $body, $vars=array())
Wrapper function for the image block display pattern.
Definition: views.php:1186
if($owner) $date
Definition: default.php:35
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:342
if(!array_key_exists($size, $icon_sizes)) $vars['size']
Definition: default.php:24
$subtitle
Definition: default.php:37
$title
Definition: default.php:33
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=array())
View the icon of an entity.
Definition: views.php:895
$owner
Definition: default.php:12
$body
Definition: default.php:29
elgg_view_friendly_time($time)
Displays a UNIX timestamp in a friendly way.
Definition: views.php:1133