19declare(strict_types=1);
29 public function addUser(
int ...$users): void
31 $class = $this->callback[
'class'];
32 $method = $this->callback[
'method'];
36 $class->$method($users);
52 $ilToolbar =
$DIC[
'ilToolbar'];
54 $ilCtrl =
$DIC[
'ilCtrl'];
59 $toolbar = $ilToolbar;
63 if (!isset($a_options[
'auto_complete_name'])) {
64 $a_options[
'auto_complete_name'] =
$lng->
txt(
'obj_user');
66 if (!isset($a_options[
'auto_complete_size'])) {
67 $a_options[
'auto_complete_size'] = 15;
69 if (!isset($a_options[
'submit_name'])) {
70 $a_options[
'submit_name'] =
$lng->
txt(
'btn_add');
73 $ajax_url = $ilCtrl->getLinkTargetByClass(
74 array(get_class($parent_object),
'ilStudyProgrammeRepositorySearchGUI'),
81 $ul =
new ilTextInputGUI($a_options[
'auto_complete_name'],
'user_login');
82 $ul->setDataSource($ajax_url);
83 $ul->setSize($a_options[
'auto_complete_size']);
85 $toolbar->addInputItem($ul,
true);
87 $toolbar->addStickyItem($ul,
true);
90 if (count($a_options[
'user_type'] ?? [])) {
92 $si->setOptions($a_options[
'user_type']);
94 $toolbar->addInputItem($si);
96 $toolbar->addStickyItem($si);
100 $button =
$ui_factory->button()->standard($a_options[
'submit_name'],
'#')
103 document.getElementById('$id').addEventListener('click',
105 let frm = this.closest('form');
106 frm.action = frm.action + '&cmd=addUserFromAutoComplete';
112 $toolbar->addComponent($button);
114 if ((
bool) $a_options[
'add_search'] ||
115 is_numeric($a_options[
'add_from_container'])) {
118 $toolbar->addSeparator();
120 if ((
bool) $a_options[
'add_search']) {
123 $ilCtrl->getLinkTargetByClass(
'ilStudyProgrammeRepositorySearchGUI',
'')
125 $toolbar->addComponent($link);
128 if (isset($a_options[
'add_from_container']) && is_numeric($a_options[
'add_from_container'])) {
129 $parent_ref_id = (
int) $a_options[
'add_from_container'];
131 $parent_container_type =
"grp";
132 if (!$parent_container_ref_id) {
134 $parent_container_type =
"crs";
136 if ($parent_container_ref_id) {
137 if ((
bool) $a_options[
'add_search']) {
138 $toolbar->addSpacer();
141 $ilCtrl->setParameterByClass(
142 'ilStudyProgrammeRepositorySearchGUI',
148 $lng->
txt(
'search_add_members_from_container_' . $parent_container_type),
149 $ilCtrl->getLinkTargetByClass(
150 [get_class($parent_object),
'ilStudyProgrammeRepositorySearchGUI'],
154 $toolbar->addComponent($link);
159 $toolbar->setFormAction(
160 $ilCtrl->getFormActionByClass(
162 get_class($parent_object),
163 'ilStudyProgrammeRepositorySearchGUI')
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
loadLanguageModule(string $a_module)
Load language module.
txt(string|LanguageIdentifier $a_topic, ?int $n=null)
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
static _lookupObjId(int $ref_id)
Custom repository search gui class for study programme to make it possible to get a handle on users s...
static fillAutoCompleteToolbar( $parent_object, ?ilToolbarGUI $toolbar=null, $a_options=array(), $a_sticky=false)
This is just the same as in the parent class, except for the hardcoded class name.
This class represents a text property in a property form.
checkForParentType(int $a_ref_id, string $a_type, bool $a_exclude_source_check=false)
Check for parent type e.g check if a folder (ref_id 3) is in a parent course obj => checkForParentTyp...