Elgg  Version 2.3
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 if (elgg_get_context() == 'gallery') {
33  echo $icon;
34 } else {
35  $metadata = '';
36  if (!elgg_in_context('owner_block') && !elgg_in_context('widgets')) {
37  $metadata = elgg_view_menu('entity', array(
38  'entity' => $entity,
39  'sort_by' => 'priority',
40  'class' => 'elgg-menu-hz',
41  ));
42  }
43 
44  if ($entity->isBanned()) {
45  $banned = elgg_echo('banned');
46  $params = array(
47  'entity' => $entity,
48  'title' => $title,
49  'metadata' => $metadata,
50  );
51  } else {
52  $params = array(
53  'entity' => $entity,
54  'title' => $title,
55  'metadata' => $metadata,
56  'subtitle' => $entity->briefdescription,
57  'content' => elgg_view('user/status', array('entity' => $entity)),
58  );
59  }
60 
61  $list_body = elgg_view('user/elements/summary', $params);
62 
64 }
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$list_body
Definition: default.php:61
$metadata
Definition: entity.php:19
if(!$owner) $icon
Definition: default.php:16
$params
Definition: default.php:39
elgg_view_image_block($image, $body, $vars=array())
Wrapper function for the image block display pattern.
Definition: views.php:1229
elgg_in_context($context)
Check if this context exists anywhere in the stack.
Definition: pageowner.php:241
elgg echo
Translates a string.
Definition: languages.js:48
elgg_get_context()
Get the current context.
Definition: pageowner.php:204
check_entity_relationship($guid_one, $relationship, $guid_two)
Check if a relationship exists between two entities.
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:336
if(!array_key_exists($size, $icon_sizes)) $vars['size']
Definition: default.php:24
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_view_menu($menu, array $vars=array())
Render a menu.
Definition: views.php:775
$size
Definition: default.php:20
$entity
Definition: default.php:15
$title
Definition: default.php:33
elgg_view_entity_icon(\ElggEntity $entity, $size= 'medium', $vars=array())
View the icon of an entity.
Definition: views.php:936
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.
Definition: sessions.php:42