Elgg  Version 3.0
save.php
Go to the documentation of this file.
1 <?php
9 $plugin = elgg_extract('entity', $vars);
10 $plugin_id = $plugin->getID();
12 
13 // Do we want to show admin settings or user settings
14 $type = elgg_extract('type', $vars, '');
15 
16 if ($type != 'user') {
17  $type = '';
18 }
19 
20 if (elgg_view_exists("plugins/$plugin_id/{$type}settings")) {
21  echo elgg_view("plugins/$plugin_id/{$type}settings", $vars);
22 }
23 
25  '#type' => 'hidden',
26  'name' => 'plugin_id',
27  'value' => $plugin_id,
28 ]);
29 
31  '#type' => 'hidden',
32  'name' => 'user_guid',
33  'value' => $user_guid,
34 ]);
35 
37  '#type' => 'submit',
38  'value' => elgg_echo('save'),
39 ]);
40 
$type
Definition: save.php:14
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:205
elgg_view_field(array $params=[])
Renders a form field, usually with a wrapper element, a label, help text, etc.
Definition: views.php:1395
$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
$plugin_id
Definition: save.php:15
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
$plugin
Definition: save.php:16
$user_guid
Definition: save.php:15
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.
Definition: sessions.php:39