Skip to content
Snippets Groups Projects
Commit c3d201c4 authored by John Voskuilen's avatar John Voskuilen
Browse files

Issue #3509428: Introduce php match expression in workflow.form.inc

parent 89dd62de
No related branches found
No related tags found
No related merge requests found
Pipeline #440495 passed with warnings
...@@ -40,22 +40,15 @@ function workflow_form_alter(&$form, FormStateInterface $form_state, $form_id) { ...@@ -40,22 +40,15 @@ function workflow_form_alter(&$form, FormStateInterface $form_state, $form_id) {
function _workflow_use_action_buttons($button_type = '') { function _workflow_use_action_buttons($button_type = '') {
global $_workflow_action_button_type; global $_workflow_action_button_type;
// Reset value if requested. $_workflow_action_button_type = match (TRUE) {
switch(true) {
case $button_type == '';
// Getting, not setting. // Getting, not setting.
break; $button_type == '' => $_workflow_action_button_type,
// Setting button type.
case $button_type == 'dropbutton'; $button_type == 'dropbutton' => $button_type,
case $button_type == 'buttons'; $button_type == 'buttons' => $button_type,
$_workflow_action_button_type = $button_type; // Setting any other (non-button) type.
break; default => '',
};
default:
// Any other non-button type.
$_workflow_action_button_type = '';
break;
}
return $_workflow_action_button_type; return $_workflow_action_button_type;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment