Skip to content

Commit

Permalink
fixed: usage of wrong button type in group edit notification settings
Browse files Browse the repository at this point in the history
  • Loading branch information
jeabakker committed Aug 12, 2024
1 parent 504f88b commit 3f23ca3
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 9 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import 'jquery';
import elgg from 'elgg';
import spinner from 'elgg/spinner';

$(document).on('click', '#group-tools-edit-notifications', function (event) {
var $form = $(this).closest('form');
$form.prop('action', elgg.normalize_url('action/group_tools/admin/notifications'));
spinner.start();
$form.submit();
});
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@
return;
}

elgg_import_esm('group_tools/extends/groups/edit/settings/notifications');

$content = '';

// notification settings
Expand Down Expand Up @@ -95,19 +97,18 @@ function(QueryBuilder $qb, $main_alias) use ($method) {
}

$buttons[] = [
'#type' => 'submit',
'#type' => 'button',
'id' => 'group-tools-edit-notifications',
'text' => elgg_echo('group_tools:notifications:enable'),
'title' => elgg_echo('group_tools:notifications:disclaimer'),
'confirm' => true,
'formaction' => elgg_generate_action_url('group_tools/admin/notifications', [], false),
'class' => 'elgg-button-action',
];

if (!empty($buttons)) {
$content .= elgg_view_field([
'#type' => 'fieldset',
'fields' => $buttons,
'align' => 'horizontal',
]);
}
$content .= elgg_view_field([
'#type' => 'fieldset',
'fields' => $buttons,
'align' => 'horizontal',
]);

echo elgg_view_module('info', elgg_echo('group_tools:notifications:title'), $content);

0 comments on commit 3f23ca3

Please sign in to comment.