Elgg  Version 2.3
edit.php
Go to the documentation of this file.
1 <?php
6 $widget = elgg_extract('entity', $vars);
7 
8 // handle upgrade to 1.7.2 from previous versions
9 if ($widget->icon_size == 1) {
10  $widget->icon_size = 'small';
11 } elseif ($widget->icon_size == 2) {
12  $widget->icon_size = 'tiny';
13 }
14 
15 // set default value for icon size
16 if (!isset($widget->icon_size)) {
17  $widget->icon_size = 'small';
18 }
19 
20 echo elgg_view('object/widget/edit/num_display', [
21  'entity' => $widget,
22  'default' => 12,
23  'label' => elgg_echo('friends:num_display'),
24  'options' => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 15, 20, 30, 50, 100],
25 ]);
26 
28  '#type' => 'select',
29  'name' => 'params[icon_size]',
30  '#label' => elgg_echo('friends:icon_size'),
31  'value' => $widget->icon_size,
32  'options_values' => [
33  'small' => elgg_echo('friends:small'),
34  'tiny' => elgg_echo('friends:tiny'),
35  ],
36 ]);
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
Definition: views.php:1424
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$vars['entity']
$widget
Friend widget options.
Definition: edit.php:6
elgg echo
Translates a string.
Definition: languages.js:48
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:336
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