ILIAS  trunk Revision v13.0_alpha-62-g3b72d83f2e5
ilStudyProgrammeRepositorySearchGUI Class Reference

Custom repository search gui class for study programme to make it possible to get a handle on users selected in the repository search gui. More...

+ Inheritance diagram for ilStudyProgrammeRepositorySearchGUI:
+ Collaboration diagram for ilStudyProgrammeRepositorySearchGUI:

Public Member Functions

 addUser (int ... $users)
 
- Public Member Functions inherited from ilRepositorySearchGUI
 __construct ()
 
 addUserAccessFilterCallable (callable $user_filter)
 Closure for filtering users e.g $rep_search_gui->addUserAccessFilterCallable(function($user_ids) use($ref_id,$rbac_perm,$pos_perm)) { // filter users return $filtered_users }. More...
 
 setTitle (string $a_title)
 
 getTitle ()
 
 enableSearchableCheck (bool $a_status)
 
 isSearchableCheckEnabled ()
 
 setPrivacyMode (int $privacy_mode)
 
 getPrivacyMode ()
 
 getSearchType ()
 
 getRoleCallback ()
 
 setString (string $a_str)
 
 getString ()
 
 executeCommand ()
 
 __clearSession ()
 
 cancel ()
 
 start ()
 
 addRole (int ... $obj_ids)
 
 addUser (int ... $users)
 
 setCallback (object $class, string $method, array $a_add_options=[], string $default_option='')
 
 setRoleCallback (object $class, string $method, array $a_add_options=[], string $default_option='')
 
 setPermissionQueryCallback (object $class, string $method)
 
 showSearch ()
 
 showSearchSelected ()
 
 initFormSearch (?ilObjUser $user=null)
 
 show ()
 
 appendSearch ()
 
 performSearch ()
 
 __performUserSearch ()
 
 __performGroupSearch ()
 
 __performRoleSearch ()
 
 __parseQueryString (string $a_string, bool $a_combination_or=true, bool $a_ignore_length=false)
 
 __loadQueries ()
 
 __setSearchType ()
 
 __updateResults ()
 
 __appendToStoredResults (array $a_usr_ids)
 
 __storeEntries (ilSearchResult $new_res)
 
 showSearchResults ()
 
 searchResultFilterListener (int $a_ref_id, array $a_data)
 Listener called from ilSearchResult Id is obj_id for role, usr Id is ref_id for crs grp. More...
 
 setUserLimitations (bool $a_limitations)
 allow user limitations like inactive and access limitations More...
 
 getUserLimitations ()
 allow user limitations like inactive and access limitations More...
 

Static Public Member Functions

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. More...
 
- Static Public Member Functions inherited from ilRepositorySearchGUI
static fillAutoCompleteToolbar (object $parent_object, ?ilToolbarGUI $toolbar=null, array $a_options=[], bool $a_sticky=false)
 array( auto_complete_name = $lng->txt('user'), auto_complete_size = 15, user_type = array(ilCourseParticipants::CRS_MEMBER,ilCourseParticpants::CRS_TUTOR), submit_name = $lng->txt('add') ) More...
 

Additional Inherited Members

- Protected Member Functions inherited from ilRepositorySearchGUI
 initUserTypeFromQuery ()
 
 initUserTypeFromPost ()
 
 getTableActionURLBuilder ()
 
 handleTableAction ()
 
 doUserAutoComplete ()
 
 addUserFromAutoComplete ()
 
 showClipboard ()
 
 addFromClipboard ()
 
 removeFromClipboard ()
 
 emptyClipboard ()
 
 handleActionFromOption (string $option, int ... $users)
 
 __performCourseSearch ()
 
 addNewSearchButton ()
 
 showSearchUserTable (array $a_usr_ids, string $a_parent_cmd)
 
 showSearchRoleTable (array $a_obj_ids)
 
 showSearchGroupTable (array $a_obj_ids)
 
 showSearchCourseTable (array $a_obj_ids)
 
 listUsers (array $selected_entries=[])
 
 storedUserList ()
 
 selectObject ()
 Return selection of course/group/roles to calling script. More...
 
- Protected Attributes inherited from ilRepositorySearchGUI
array $add_options = []
 
string $default_option = ''
 
bool $searchable_check = true
 
string $search_title = ''
 
bool $user_limitations = true
 
bool $stored = false
 
array $callback = []
 
array $role_callback = []
 
ilSearchResult $result_obj
 
ilSearchSettings $settings
 
ilPropertyFormGUI $form = null
 
 $user_filter = null
 
ilTree $tree
 
Renderer $ui_renderer
 
Factory $ui_factory
 
ilCtrl $ctrl
 
ilGlobalTemplateInterface $tpl
 
ilObjUser $user = null
 
ilRbacReview $rbacreview
 
ilTabsGUI $tabs
 
ilLanguage $lng
 
DataFactory $data_factory
 
Profile $user_profile
 

Detailed Description

Custom repository search gui class for study programme to make it possible to get a handle on users selected in the repository search gui.

@ilCtrl_Calls ilStudyProgrammeRepositorySearchGUI: ilPropertyFormGUI

Definition at line 27 of file class.ilStudyProgrammeRepositorySearchGUI.php.

Member Function Documentation

◆ addUser()

ilStudyProgrammeRepositorySearchGUI::addUser ( int ...  $users)

Reimplemented from ilRepositorySearchGUI.

Definition at line 29 of file class.ilStudyProgrammeRepositorySearchGUI.php.

29 : void
30 {
31 $class = $this->callback['class'];
32 $method = $this->callback['method'];
33
34 // call callback if that function does give a return value => show error message
35 // listener redirects if everything is ok.
36 $class->$method($users);
37 // Removed this from overwritten class, as we do not want to show the
38 // results again...
39 //$this->showSearchResults();
40 }

◆ fillAutoCompleteToolbar()

static ilStudyProgrammeRepositorySearchGUI::fillAutoCompleteToolbar (   $parent_object,
?ilToolbarGUI  $toolbar = null,
  $a_options = array(),
  $a_sticky = false 
)
static

This is just the same as in the parent class, except for the hardcoded class name.

Definition at line 45 of file class.ilStudyProgrammeRepositorySearchGUI.php.

50 : ilToolbarGUI {
51 global $DIC;
52 $ilToolbar = $DIC['ilToolbar'];
53 $lng = $DIC['lng'];
54 $ilCtrl = $DIC['ilCtrl'];
55 $tree = $DIC['tree'];
56 $ui_factory = $DIC['ui.factory'];
57
58 if (!$toolbar instanceof ilToolbarGUI) {
59 $toolbar = $ilToolbar;
60 }
61
62 // Fill default options
63 if (!isset($a_options['auto_complete_name'])) {
64 $a_options['auto_complete_name'] = $lng->txt('obj_user');
65 }
66 if (!isset($a_options['auto_complete_size'])) {
67 $a_options['auto_complete_size'] = 15;
68 }
69 if (!isset($a_options['submit_name'])) {
70 $a_options['submit_name'] = $lng->txt('btn_add');
71 }
72
73 $ajax_url = $ilCtrl->getLinkTargetByClass(
74 array(get_class($parent_object),'ilStudyProgrammeRepositorySearchGUI'),
75 'doUserAutoComplete',
76 '',
77 true,
78 false
79 );
80
81 $ul = new ilTextInputGUI($a_options['auto_complete_name'], 'user_login');
82 $ul->setDataSource($ajax_url);
83 $ul->setSize($a_options['auto_complete_size']);
84 if (!$a_sticky) {
85 $toolbar->addInputItem($ul, true);
86 } else {
87 $toolbar->addStickyItem($ul, true);
88 }
89
90 if (count($a_options['user_type'] ?? [])) {
91 $si = new ilSelectInputGUI("", "user_type");
92 $si->setOptions($a_options['user_type']);
93 if (!$a_sticky) {
94 $toolbar->addInputItem($si);
95 } else {
96 $toolbar->addStickyItem($si);
97 }
98 }
99
100 $button = $ui_factory->button()->standard($a_options['submit_name'], '#')
101 ->withOnLoadCode(
102 fn($id) => "
103 document.getElementById('$id').addEventListener('click',
104 function() {
105 let frm = this.closest('form');
106 frm.action = frm.action + '&cmd=addUserFromAutoComplete';
107 frm.submit();
108 return false;
109 });
110 "
111 );
112 $toolbar->addComponent($button);
113
114 if ((bool) $a_options['add_search'] ||
115 is_numeric($a_options['add_from_container'])) {
116 $lng->loadLanguageModule("search");
117
118 $toolbar->addSeparator();
119
120 if ((bool) $a_options['add_search']) {
121 $link = $ui_factory->link()->standard(
122 $lng->txt('search_users'),
123 $ilCtrl->getLinkTargetByClass('ilStudyProgrammeRepositorySearchGUI', '')
124 );
125 $toolbar->addComponent($link);
126 }
127
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'];
130 $parent_container_ref_id = $tree->checkForParentType($parent_ref_id, "grp");
131 $parent_container_type = "grp";
132 if (!$parent_container_ref_id) {
133 $parent_container_ref_id = $tree->checkForParentType($parent_ref_id, "crs");
134 $parent_container_type = "crs";
135 }
136 if ($parent_container_ref_id) {
137 if ((bool) $a_options['add_search']) {
138 $toolbar->addSpacer();
139 }
140
141 $ilCtrl->setParameterByClass(
142 'ilStudyProgrammeRepositorySearchGUI',
143 "list_obj",
144 ilObject::_lookupObjId($parent_container_ref_id)
145 );
146
147 $link = $ui_factory->link()->standard(
148 $lng->txt('search_add_members_from_container_' . $parent_container_type),
149 $ilCtrl->getLinkTargetByClass(
150 [get_class($parent_object),'ilStudyProgrammeRepositorySearchGUI'],
151 'listUsers'
152 )
153 );
154 $toolbar->addComponent($link);
155 }
156 }
157 }
158
159 $toolbar->setFormAction(
160 $ilCtrl->getFormActionByClass(
161 array(
162 get_class($parent_object),
163 'ilStudyProgrammeRepositorySearchGUI')
164 )
165 );
166 return $toolbar;
167 }
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
Definition: plugin.php:23
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)
This class represents a selection list property in a property form.
This class represents a text property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
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...
global $DIC
Definition: shib_login.php:26

Referenced by ilObjStudyProgrammeMembersGUI\initSearchGUI().

+ Here is the caller graph for this function:

The documentation for this class was generated from the following file: