Elgg  Version master
plugin_settings.php
Go to the documentation of this file.
1 <?php
9 $plugin = elgg_extract('entity', $vars);
10 $plugin_id = $plugin->getID();
11 
12 if (!elgg_view_exists("plugins/{$plugin_id}/settings")) {
13  return;
14 }
15 
17  'id' => "{$plugin_id}-settings",
18  'class' => 'elgg-form-settings',
19 ];
20 
21 if (elgg_action_exists("{$plugin_id}/settings/save")) {
22  $form_vars['action'] = "action/{$plugin_id}/settings/save";
23 }
24 
25 echo elgg_view_form('plugins/settings/save', $form_vars, $vars);
if(!elgg_view_exists("plugins/{$plugin_id}/settings")) $form_vars
elgg_view_form(string $action, array $form_vars=[], array $body_vars=[])
Definition: views.php:1033
$plugin_id
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
elgg_action_exists(string $action)
Check if an action is registered and its script exists.
Definition: actions.php:68
$plugin
Elgg plugin settings.
$vars
Definition: theme.php:5
elgg_view_exists(string $view, string $viewtype= '', bool $recurse=true)
Returns whether the specified view exists.
Definition: views.php:131