Elgg  Version 1.11
default.php
Go to the documentation of this file.
1 <?php
10 $entity = $vars['entity'];
11 $size = elgg_extract('size', $vars, 'tiny');
12 
14 
16 if (!$title) {
17  $link_params = array(
18  'href' => $entity->getUrl(),
19  'text' => $entity->name,
20  );
21 
22  // Simple XFN, see http://gmpg.org/xfn/
23  if (elgg_get_logged_in_user_guid() == $entity->guid) {
24  $link_params['rel'] = 'me';
25  } elseif (check_entity_relationship(elgg_get_logged_in_user_guid(), 'friend', $entity->guid)) {
26  $link_params['rel'] = 'friend';
27  }
28 
29  $title = elgg_view('output/url', $link_params);
30 }
31 
32 $metadata = elgg_view_menu('entity', array(
33  'entity' => $entity,
34  'sort_by' => 'priority',
35  'class' => 'elgg-menu-hz',
36 ));
37 
38 if (elgg_in_context('owner_block') || elgg_in_context('widgets')) {
39  $metadata = '';
40 }
41 
42 if (elgg_get_context() == 'gallery') {
43  echo $icon;
44 } else {
45  if ($entity->isBanned()) {
46  $banned = elgg_echo('banned');
47  $params = array(
48  'entity' => $entity,
49  'title' => $title,
50  'metadata' => $metadata,
51  );
52  } else {
53  $params = array(
54  'entity' => $entity,
55  'title' => $title,
56  'metadata' => $metadata,
57  'subtitle' => $entity->briefdescription,
58  'content' => elgg_view('user/status', array('entity' => $entity)),
59  );
60  }
61 
62  $list_body = elgg_view('user/elements/summary', $params);
63 
64  echo elgg_view_image_block($icon, $list_body, $vars);
65 }
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1246
if(!$owner) $icon
Definition: default.php:16
elgg_view_menu($menu_name, array $vars=array())
Render a menu.
Definition: views.php:692
$params
Definition: default.php:39
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_view_image_block($image, $body, $vars=array())
Wrapper function for the image block display pattern.
Definition: views.php:1196
elgg_in_context($context)
Check if this context exists anywhere in the stack.
Definition: pageowner.php:250
elgg echo
Translates a string.
Definition: languages.js:43
elgg_get_context()
Get the current context.
Definition: pageowner.php:213
check_entity_relationship($guid_one, $relationship, $guid_two)
Check if a relationship exists between two entities.
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
$size
Definition: default.php:19
$entity
Definition: default.php:15
if(!$title) $metadata
Definition: default.php:32
$title
Definition: default.php:32
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=array())
View the icon of an entity.
Definition: views.php:865
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.
Definition: sessions.php:42