Elgg  Version 2.3
content.php
Go to the documentation of this file.
1 <?php
6 $widget = elgg_extract('entity', $vars);
7 
8 $owner = $widget->getOwnerEntity();
9 if (!($owner instanceof \ElggUser)) {
10  return;
11 }
12 
13 $num_display = sanitize_int($widget->num_display, false);
14 // set default value for display number
15 if (!$num_display) {
16  $num_display = 12;
17 }
18 
20  'type' => 'user',
21  'relationship' => 'friend',
22  'relationship_guid' => $owner->guid,
23  'limit' => $num_display,
24  'size' => $widget->icon_size,
25  'list_type' => 'gallery',
26  'pagination' => false,
27  'no_results' => elgg_echo('friends:none'),
28 ]);
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
if(elgg_in_context('default_widgets')) $widget
Definition: content.php:8
$owner
Definition: content.php:8
elgg echo
Translates a string.
Definition: languages.js:48
$num_display
Definition: content.php:7
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_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