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