5 require_once(
"./Services/Search/classes/class.ilRepositorySearchGUI.php");
16 $class = $this->callback[
'class'];
17 $method = $this->callback[
'method'];
21 $class->$method(
$_POST[
'user']);
37 $toolbar = $ilToolbar;
41 if(!isset($a_options[
'auto_complete_name']))
43 $a_options[
'auto_complete_name'] = $lng->txt(
'obj_user');
45 if(!isset($a_options[
'auto_complete_size']))
47 $a_options[
'auto_complete_size'] = 15;
49 if(!isset($a_options[
'submit_name']))
51 $a_options[
'submit_name'] = $lng->txt(
'btn_add');
54 $ajax_url = $ilCtrl->getLinkTargetByClass(array(get_class($parent_object),
'ilStudyProgrammeRepositorySearchGUI'),
55 'doUserAutoComplete',
'',
true,
false);
57 include_once(
"./Services/Form/classes/class.ilTextInputGUI.php");
58 $ul =
new ilTextInputGUI($a_options[
'auto_complete_name'],
'user_login');
59 $ul->setDataSource($ajax_url);
60 $ul->setSize($a_options[
'auto_complete_size']);
63 $toolbar->addInputItem($ul,
true);
67 $toolbar->addStickyItem($ul,
true);
70 if(count((array) $a_options[
'user_type']))
72 include_once
'./Services/Form/classes/class.ilSelectInputGUI.php';
74 $si->setOptions($a_options[
'user_type']);
77 $toolbar->addInputItem(
$si);
81 $toolbar->addStickyItem(
$si);
85 include_once
"Services/UIComponent/Button/classes/class.ilSubmitButton.php";
87 $button->setCaption($a_options[
'submit_name'],
false);
88 $button->setCommand(
'addUserFromAutoComplete');
91 $toolbar->addButtonInstance($button);
95 $toolbar->addStickyItem($button);
98 if((
bool)$a_options[
'add_search'] ||
99 is_numeric($a_options[
'add_from_container']))
101 $lng->loadLanguageModule(
"search");
103 $toolbar->addSeparator();
105 if((
bool)$a_options[
'add_search'])
107 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
109 $button->setCaption(
"search_users");
110 $button->setUrl($ilCtrl->getLinkTargetByClass(
'ilStudyProgrammeRepositorySearchGUI',
''));
111 $toolbar->addButtonInstance($button);
114 if(is_numeric($a_options[
'add_from_container']))
116 $parent_ref_id = (int)$a_options[
'add_from_container'];
117 $parent_container_ref_id = $tree->checkForParentType($parent_ref_id,
"grp");
118 $parent_container_type =
"grp";
119 if(!$parent_container_ref_id)
121 $parent_container_ref_id = $tree->checkForParentType($parent_ref_id,
"crs");
122 $parent_container_type =
"crs";
124 if($parent_container_ref_id)
126 if((
bool)$a_options[
'add_search'])
128 $toolbar->addSpacer();
131 $ilCtrl->setParameterByClass(
'ilStudyProgrammeRepositorySearchGUI',
"list_obj",
ilObject::_lookupObjId($parent_container_ref_id));
133 include_once
"Services/UIComponent/Button/classes/class.ilLinkButton.php";
135 $button->setCaption(
"search_add_members_from_container_".$parent_container_type);
136 $button->setUrl($ilCtrl->getLinkTargetByClass(array(get_class($parent_object),
'ilStudyProgrammeRepositorySearchGUI'),
'listUsers'));
137 $toolbar->addButtonInstance($button);
142 $toolbar->setFormAction(
143 $ilCtrl->getFormActionByClass(
145 get_class($parent_object),
146 'ilStudyProgrammeRepositorySearchGUI')
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.
static _lookupObjId($a_id)
This class represents a text property in a property form.
Custom repository search gui class for study programme to make it possible to get a handle on users s...