Elgg  Version 1.11
save.php
Go to the documentation of this file.
1 <?php
9 $plugin = $vars['entity'];
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 } else {
23  echo elgg_view_deprecated("{$type}settings/$plugin_id/edit", $vars, "Use the view plugins/$plugin_id/{$type}settings", 1.8);
24 }
25 
26 echo '<div class="elgg-foot">';
27 echo elgg_view('input/hidden', array('name' => 'plugin_id', 'value' => $plugin_id));
28 echo elgg_view('input/hidden', array('name' => 'user_guid', 'value' => $user_guid));
29 echo elgg_view('input/submit', array('value' => elgg_echo('save')));
30 echo '</div>';
$type
Definition: save.php:14
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:318
elgg_extract($key, array $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1246
elgg_echo($message_key, $args=array(), $language="")
Given a message key, returns an appropriately translated full-text string.
Definition: languages.php:21
$plugin_id
Definition: save.php:16
elgg_view_deprecated($view, array $vars, $suggestion, $version)
Display a view with a deprecation notice.
Definition: views.php:371
elgg echo
Translates a string.
Definition: languages.js:43
elgg_view($view, $vars=array(), $bypass=false, $ignored=false, $viewtype= '')
Return a parsed view.
Definition: views.php:354
$vars['type']
Definition: save.php:11
$plugin
Definition: save.php:17
$user_guid
Definition: save.php:18
elgg_get_logged_in_user_guid()
Return the current logged in user by guid.
Definition: sessions.php:42