ILIAS  trunk Revision v11.0_alpha-1713-gd8962da2f67
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
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 ()
 
- 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 ()
 
 addUser ()
 
 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...
 
 allowObjectSelection (bool $a_value=false)
 
 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 ()
 
 doUserAutoComplete ()
 
 addUserFromAutoComplete ()
 
 showClipboard ()
 
 addFromClipboard ()
 
 removeFromClipboard ()
 
 emptyClipboard ()
 
 handleMultiCommand ()
 
 __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 $object_selection = false
 
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
 

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.

ilStudyProgrammeRepositorySearchGUI: ilPropertyFormGUI

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

Member Function Documentation

◆ addUser()

ilStudyProgrammeRepositorySearchGUI::addUser ( )

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

References $DIC, and ilRepositorySearchGUI\$refinery.

29  : void
30  {
31  global $DIC;
32  $post_wrapper = $DIC->http()->wrapper()->post();
33  $refinery = $DIC->refinery();
34  $class = $this->callback['class'];
35  $method = $this->callback['method'];
36 
37  // call callback if that function does give a return value => show error message
38  // listener redirects if everything is ok.
39  $class->$method($post_wrapper->retrieve('user', $refinery->kindlyTo()->listOf($refinery->kindlyTo()->string())));
40  // Removed this from overwritten class, as we do not want to show the
41  // results again...
42  //$this->showSearchResults();
43  }
global $DIC
Definition: shib_login.php:22

◆ 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 48 of file class.ilStudyProgrammeRepositorySearchGUI.php.

References $DIC, $id, ilRepositorySearchGUI\$lng, ilRepositorySearchGUI\$tree, ilRepositorySearchGUI\$ui_factory, ilObject\_lookupObjId(), ilTree\checkForParentType(), ILIAS\Repository\int(), ilLanguage\loadLanguageModule(), and ilLanguage\txt().

Referenced by ilObjStudyProgrammeMembersGUI\initSearchGUI().

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

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