From 39879f3a3882b2662ed9d5ab77064602d5b9ab04 Mon Sep 17 00:00:00 2001 From: Tim Schmitz Date: Fri, 13 Dec 2024 17:10:59 +0100 Subject: [PATCH] Search: replace split button (43226) --- .../classes/class.ilRepositorySearchGUI.php | 28 +++++++------------ 1 file changed, 10 insertions(+), 18 deletions(-) diff --git a/components/ILIAS/Search/classes/class.ilRepositorySearchGUI.php b/components/ILIAS/Search/classes/class.ilRepositorySearchGUI.php index 4feebea8aefe..320e2ad6de01 100755 --- a/components/ILIAS/Search/classes/class.ilRepositorySearchGUI.php +++ b/components/ILIAS/Search/classes/class.ilRepositorySearchGUI.php @@ -262,33 +262,25 @@ public static function fillAutoCompleteToolbar( } $clip = ilUserClipboard::getInstance($user->getId()); - if ($clip->hasContent()) { - $action_button = ilSplitButtonGUI::getInstance(); - $add_button = ilSubmitButton::getInstance(); - $add_button->setCaption($a_options['submit_name'], false); - $add_button->setCommand('addUserFromAutoComplete'); + $add_button = ilSubmitButton::getInstance(); + $add_button->setCaption($a_options['submit_name'], false); + $add_button->setCommand('addUserFromAutoComplete'); - $action_button->setDefaultButton($add_button); + if (!$a_sticky || $clip->hasContent()) { + $toolbar->addButtonInstance($add_button); + } else { + $toolbar->addStickyItem($add_button); + } + if ($clip->hasContent()) { $clip_button = ilSubmitButton::getInstance(); $clip_button->addCSSClass('btn btndefault'); $lng->loadLanguageModule('user'); $clip_button->setCaption($lng->txt('clipboard_add_from_btn'), false); $clip_button->setCommand('showClipboard'); - $action_button->addMenuItem(new ilButtonToSplitButtonMenuItemAdapter($clip_button)); - - $toolbar->addButtonInstance($action_button); - } else { - $button = ilSubmitButton::getInstance(); - $button->setCaption($a_options['submit_name'], false); - $button->setCommand('addUserFromAutoComplete'); - if (!$a_sticky) { - $toolbar->addButtonInstance($button); - } else { - $toolbar->addStickyItem($button); - } + $toolbar->addButtonInstance($clip_button); } if ($a_options['add_search'] ||