Permalink
Browse files

fix(forms): empty plugin settings forms no longer wrapped in a form tag

Empty plugin settings forms result in only a submit button being visible to the user.
This prevents that from happening

Fixes #9704
  • Loading branch information...
hypeJunction committed Apr 18, 2016
1 parent dc68d04 commit 5f7dbcd0d8006f41c230e34fc96ed13e0cd5ad71
View
@@ -595,6 +595,7 @@
'plugins:settings:save:fail' => "There was a problem saving settings for the %s plugin.",
'plugins:usersettings:save:ok' => "User settings for the %s plugin were saved successfully.",
'plugins:usersettings:save:fail' => "There was a problem saving user settings for the %s plugin.",
'plugins:settings:empty' => 'At this time, no additional configuration is required',
'item:object:plugin' => 'Plugins',
'admin:plugins' => "Plugins",
View
@@ -36,6 +36,9 @@
}
$content = elgg_view_form('plugins/usersettings/save', array(), array('entity' => $plugin));
if (empty($content)) {
$content = elgg_format_element('p', ['class' => 'elgg-no-results'], elgg_echo('plugins:settings:empty'));
}
$params = array(
'content' => $content,
@@ -21,6 +21,8 @@
$params = array('id' => "$plugin_id-settings", 'class' => 'elgg-form-settings');
$body = elgg_view_form("plugins/settings/save", $params, $vars);
if (empty($body)) {
$body = elgg_format_element('p', ['class' => 'elgg-no-results'], elgg_echo('plugins:settings:empty'));
}
echo elgg_view_module('info', $title, $body);
}
@@ -18,11 +18,17 @@
}
if (elgg_view_exists("plugins/$plugin_id/{$type}settings")) {
echo elgg_view("plugins/$plugin_id/{$type}settings", $vars);
$body = elgg_view("plugins/$plugin_id/{$type}settings", $vars);
} else {
echo elgg_view_deprecated("{$type}settings/$plugin_id/edit", $vars, "Use the view plugins/$plugin_id/{$type}settings", 1.8);
$body = elgg_view_deprecated("{$type}settings/$plugin_id/edit", $vars, "Use the view plugins/$plugin_id/{$type}settings", 1.8);
}
if (empty($body)) {
return;
}
echo $body;
echo '<div class="elgg-foot">';
echo elgg_view('input/hidden', array('name' => 'plugin_id', 'value' => $plugin_id));
echo elgg_view('input/hidden', array('name' => 'user_guid', 'value' => $user_guid));

0 comments on commit 5f7dbcd

Please sign in to comment.