Elgg  Version 3.0
save.php
Go to the documentation of this file.
1 <?php
9 $widget = elgg_extract('widget', $vars);
10 if (!$widget instanceof ElggWidget) {
11  return;
12 }
13 
14 $show_access = elgg_extract('show_access', $vars, true);
15 
16 $custom_form_section = elgg_view("widgets/$widget->handler/edit", ['entity' => $widget]);
17 
18 $access = '';
19 if ($show_access) {
21  '#type' => 'access',
22  '#label' => elgg_echo('access'),
23  'name' => 'params[access_id]',
24  'value' => $widget->access_id,
25  'entity' => $widget,
26  ]);
27 }
28 
30  return true;
31 }
32 
35 
37  '#type' => 'hidden',
38  'name' => 'guid',
39  'value' => $widget->guid,
40 ]);
41 
42 if (elgg_in_context('default_widgets')) {
44  '#type' => 'hidden',
45  'name' => 'default_widgets',
46  'value' => 1,
47  ]);
48 }
49 
51  '#type' => 'submit',
52  'value' => elgg_echo('save'),
53 ]);
54 
$custom_form_section
Definition: save.php:16
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
Definition: views.php:1395
$widget
Definition: save.php:21
$footer
Definition: save.php:87
elgg_echo($message_key, array $args=[], $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
elgg_set_form_footer($footer= '')
Sets form footer and defers its rendering until the form view and extensions have been rendered...
Definition: views.php:1331
if(!$widget instanceof ElggWidget) $show_access
Definition: save.php:14
elgg_in_context($context)
Check if this context exists anywhere in the stack.
Definition: pageowner.php:238
elgg echo
Translates a string.
Definition: languages.js:43
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:1131
$vars['type']
Definition: save.php:11
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246
$access
Definition: save.php:18