From 5c8d17565203dd477b515f301421ad086ff3375f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jer=C3=B4me=20Bakker?= Date: Wed, 19 Jul 2023 09:58:16 +0200 Subject: [PATCH] chore: buttons have a discernible text --- actions/groups/edit.php | 2 +- actions/groups/invite.php | 4 +--- views/default/admin/groups/bulk_delete.php | 2 +- views/default/forms/groups/edit.php | 3 ++- views/default/forms/groups/invite.php | 6 ++++-- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/actions/groups/edit.php b/actions/groups/edit.php index e719a49..c1b0653 100644 --- a/actions/groups/edit.php +++ b/actions/groups/edit.php @@ -146,7 +146,7 @@ $admin_approve = ($admin_approve && !elgg_is_admin_logged_in()); // admins don't need to wait $concept_group = (bool) elgg_get_plugin_setting('concept_groups', 'group_tools'); -$concept_group = $concept_group && !empty(get_input('concept_group')); +$concept_group = $concept_group && (bool) get_input('concept_group'); // new groups get access private, so an admin can validate it $access_id = (int) $group->access_id; diff --git a/actions/groups/invite.php b/actions/groups/invite.php index dc2f559..399737d 100644 --- a/actions/groups/invite.php +++ b/actions/groups/invite.php @@ -30,9 +30,7 @@ } // add users directly? - if (get_input('submit') == elgg_echo('group_tools:add_users')) { - $adding = true; - } + $adding = (bool) get_input('submit'); } $group_guid = (int) get_input('group_guid'); diff --git a/views/default/admin/groups/bulk_delete.php b/views/default/admin/groups/bulk_delete.php index 320e1b9..d659ea9 100644 --- a/views/default/admin/groups/bulk_delete.php +++ b/views/default/admin/groups/bulk_delete.php @@ -31,7 +31,7 @@ $batch = new ElggBatch('elgg_get_entities', $options); $delete_button = elgg_view('input/submit', [ - 'value' => elgg_echo('group_tools:delete_selected'), + 'text' => elgg_echo('group_tools:delete_selected'), 'class' => 'elgg-button-submit float-alt mvs', 'data-confirm' => elgg_echo('deleteconfirm:plural'), ]); diff --git a/views/default/forms/groups/edit.php b/views/default/forms/groups/edit.php index 8bde173..604b3ec 100644 --- a/views/default/forms/groups/edit.php +++ b/views/default/forms/groups/edit.php @@ -126,7 +126,8 @@ $buttons[] = [ '#type' => 'submit', 'name' => 'concept_group', - 'value' => elgg_echo('group_tools:group:edit:save:concept'), + 'value' => 1, + 'text' => elgg_echo('group_tools:group:edit:save:concept'), ]; } diff --git a/views/default/forms/groups/invite.php b/views/default/forms/groups/invite.php index 648c580..38bf86d 100644 --- a/views/default/forms/groups/invite.php +++ b/views/default/forms/groups/invite.php @@ -80,14 +80,16 @@ [ '#type' => 'submit', 'name' => 'submit', - 'value' => elgg_echo('invite'), + 'value' => 0, + 'text' => elgg_echo('invite'), ], ]; if (elgg_is_admin_logged_in()) { $footer_fields[] = [ '#type' => 'submit', 'name' => 'submit', - 'value' => elgg_echo('group_tools:add_users'), + 'value' => 1, + 'text' => elgg_echo('group_tools:add_users'), 'data-confirm' => elgg_echo('group_tools:group:invite:add:confirm'), ]; }