Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Search: replace split button (43226) #8726

Open
wants to merge 1 commit into
base: release_10
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 10 additions & 18 deletions components/ILIAS/Search/classes/class.ilRepositorySearchGUI.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'] ||
Expand Down
Loading