Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
content.php
Go to the documentation of this file.
1 <?php
7 // owner of the widget
8 $owner = $vars['entity']->getOwnerEntity();
9 
10 $num_display = sanitize_int($vars['entity']->num_display, false);
11 // set default value for display number
12 if (!$num_display) {
13  $num_display = 12;
14 }
15 
16 // get the correct size
17 $size = $vars['entity']->icon_size;
18 
19 if (elgg_instanceof($owner, 'user')) {
21  'type' => 'user',
22  'relationship' => 'friend',
23  'relationship_guid' => $owner->guid,
24  'limit' => $num_display,
25  'size' => $size,
26  'list_type' => 'gallery',
27  'pagination' => false,
28  'no_results' => elgg_echo('friends:none'),
29  ));
30  if ($html) {
31  echo $html;
32  }
33 }
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
if(!$num_display) $size
Definition: content.php:17
elgg_instanceof($entity, $type=null, $subtype=null, $class=null)
Checks if $entity is an and optionally for type and subtype.
Definition: entities.php:716
$owner
Friend widget display view.
Definition: content.php:8
foreach($emails as $email) $html
Definition: exceptions.php:34
$num_display
Banned users admin widget.
Definition: content.php:6
elgg_list_entities_from_relationship(array $options=array())
Returns a viewable list of entities by relationship.
$vars['title']
Definition: content.php:19
sanitize_int($int, $signed=true)
Sanitizes an integer for database use.
Definition: database.php:180