Elgg  Version 4.3
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 
15 if (elgg_view_exists("widgets/{$widget->handler}/edit")) {
16  $custom_form_section = elgg_view("widgets/{$widget->handler}/edit", ['entity' => $widget]);
17 }
18 
19 $access = '';
20 if (elgg_extract('show_access', $vars, true)) {
22  '#type' => 'access',
23  '#label' => elgg_echo('access'),
24  'name' => 'params[access_id]',
25  'value' => $widget->access_id,
26  'entity' => $widget,
27  ]);
28 }
29 
31  return;
32 }
33 
36 
38  '#type' => 'hidden',
39  'name' => 'guid',
40  'value' => $widget->guid,
41 ]);
42 
43 if (elgg_in_context('default_widgets')) {
45  '#type' => 'hidden',
46  'name' => 'default_widgets',
47  'value' => 1,
48  ]);
49 }
50 
52  '#type' => 'submit',
53  'value' => elgg_echo('save'),
54 ]);
55 
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:152
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
Definition: views.php:1149
if(elgg_view_exists("widgets/{$widget->handler}/edit")) $access
Definition: save.php:19
$widget
Definition: save.php:18
$footer
Definition: save.php:88
elgg_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
Definition: languages.php:18
elgg_set_form_footer($footer= '')
Sets form footer and defers its rendering until the form view and extensions have been rendered...
Definition: views.php:1083
elgg_in_context($context)
Check if this context exists anywhere in the stack.
Definition: context.php:78
if(!$widget instanceof ElggWidget) $custom_form_section
Definition: save.php:14
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:547
$vars['type']
Plugin user settings.
Definition: save.php:8
elgg echo
Translates a string.
Definition: deprecated.js:530
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179