Elgg  Version 4.3
save.php
Go to the documentation of this file.
1 <?php
6 $plugin = elgg_extract('entity', $vars);
7 $plugin_id = $plugin->getID();
9 
10 // Do we want to show admin settings or user settings
11 $type = elgg_extract('type', $vars, '');
12 if ($type != 'user') {
13  $type = '';
14 }
15 
16 $settings = '';
17 if (elgg_view_exists("plugins/{$plugin_id}/{$type}settings")) {
18  $settings = elgg_view("plugins/{$plugin_id}/{$type}settings", $vars);
19 }
20 
21 if (empty($settings)) {
22  return;
23 }
24 
26  '#type' => 'hidden',
27  'name' => 'plugin_id',
28  'value' => $plugin_id,
29 ]);
30 
32  '#type' => 'hidden',
33  'name' => 'user_guid',
34  'value' => $user_guid,
35 ]);
36 
38 
40  '#type' => 'submit',
41  'value' => elgg_echo('save'),
42 ]);
43 
$type
Definition: save.php:11
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:1143
$footer
Definition: save.php:88
if($type!= 'user') $settings
Definition: save.php:16
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:1077
if(empty($plugin_id)) $plugin
Definition: save.php:20
$plugin_id
Definition: save.php:15
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
$user_guid
Definition: save.php:15
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.
Definition: sessions.php:34