Elgg  Version 5.0
settings.php
Go to the documentation of this file.
1 <?php
8 $widget = elgg_extract('widget', $vars);
9 if (!$widget instanceof ElggWidget) {
10  return;
11 }
12 
13 $form = elgg_view_form('widgets/save', [
14  'class' => [
15  preg_replace('/[^a-z0-9-]/i', '-', "elgg-form-widgets-save-{$widget->handler}"),
16  ],
17  'prevent_double_submit' => false,
18 ], $vars);
19 
20 if (empty($form)) {
21  return;
22 }
23 
24 echo elgg_format_element('div', [
25  'class' => 'elgg-widget-edit',
26  'id' => "widget-edit-{$widget->guid}",
27 ], $form);
$vars['type']
Definition: settings.php:5
elgg_view_form(string $action, array $form_vars=[], array $body_vars=[])
Definition: views.php:1054
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
$widget
Elgg widget edit settings.
Definition: settings.php:8
if(!$widget instanceof ElggWidget) $form
Definition: settings.php:13
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145