Elgg  Version 4.3
tools.php
Go to the documentation of this file.
1 <?php
7 
9 
10 $plugin_id = elgg_extract('plugin_id', $vars);
11 
13 if (!$plugin instanceof \ElggPlugin) {
14  throw new PageNotFoundException(elgg_echo('PluginException:InvalidID', [$plugin_id]));
15 }
16 
17 if (elgg_language_key_exists($plugin_id . ':usersettings:title')) {
18  $title = elgg_echo($plugin_id . ':usersettings:title');
19 } else {
20  $title = $plugin->getDisplayName();
21 }
22 
23 elgg_push_breadcrumb(elgg_echo('settings'), elgg_generate_url('settings:account', ['username' => $user->username]));
24 
26 if (elgg_action_exists("{$plugin_id}/usersettings/save")) {
27  $form_vars['action'] = "action/{$plugin_id}/usersettings/save";
28 }
29 
30 $content = elgg_view_form('plugins/usersettings/save', $form_vars, ['entity' => $plugin]);
31 
33  'content' => $content,
34  'show_owner_block_menu' => false,
35  'filter_id' => 'settings',
36  'filter_value' => 'plugin_settings',
37 ]);
elgg_language_key_exists($key, $language= 'en')
Check if a given language key exists.
Definition: languages.php:46
$plugin
Definition: tools.php:12
elgg_get_plugin_from_id(string $plugin_id)
Elgg plugins library Contains functions for managing plugins.
Definition: plugins.php:15
$title
Definition: generic.php:50
$user
Definition: tools.php:8
elgg_echo($message_key, array $args=[], $language="")
Elgg language module Functions to manage language and translations.
Definition: languages.php:18
elgg_view_page($title, $body, $page_shell= 'default', $vars=[])
Assembles and outputs a full page.
Definition: views.php:262
Thrown when page is not accessible.
elgg_action_exists(string $action)
Check if an action is registered and its script exists.
Definition: actions.php:66
$form_vars
Definition: tools.php:25
elgg_view_form($action, $form_vars=[], $body_vars=[])
Definition: views.php:1064
elgg_generate_url($name, array $parameters=[])
Generate a URL for named route.
$plugin_id
Definition: tools.php:10
elgg_get_page_owner_entity()
Gets the owner entity for the current page.
Definition: pageowner.php:23
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
if(elgg_action_exists("{$plugin_id}/usersettings/save")) $content
Definition: tools.php:30
elgg echo
Translates a string.
Definition: deprecated.js:530
$vars['head']
Definition: html.php:24
elgg_push_breadcrumb($text, $href=false)
Breadcrumbs Elgg uses a breadcrumb stack.
Definition: breadcrumbs.php:21