ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilRepositorySearchGUI Class Reference
+ Inheritance diagram for ilRepositorySearchGUI:
+ Collaboration diagram for ilRepositorySearchGUI:

Public Member Functions

 __construct ()
 Constructor @access public. More...
 
 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 ($a_title)
 Set form title. More...
 
 getTitle ()
 Get search form title. More...
 
 enableSearchableCheck ($a_status)
 En/disable the validation of the searchable flag. More...
 
 isSearchableCheckEnabled ()
 
 setPrivacyMode ($privacy_mode)
 
 getPrivacyMode ()
 
 setString ($a_str)
 Set/get search string @access public. More...
 
 getString ()
 
 executeCommand ()
 Control @access public. More...
 
 __clearSession ()
 
 cancel ()
 
 start ()
 
 addUser ()
 
 setCallback (&$class, $method, $a_add_options=array())
 
 setPermissionQueryCallback ($class, $method)
 Set callback method for user permission access queries. More...
 
 showSearch ()
 
 showSearchSelected ()
 submit from autocomplete More...
 
 initFormSearch (ilObjUser $user=null)
 
 show ()
 
 appendSearch ()
 
 performSearch ()
 Perform a search. More...
 
 __performUserSearch ()
 
 __performGroupSearch ()
 Search groups. More...
 
 __performRoleSearch ()
 Search roles. More...
 
__parseQueryString ($a_string, $a_combination_or=true, $a_ignore_length=false)
 parse query string, using query parser instance More...
 
 __loadQueries ()
 
 __setSearchType ()
 
 __updateResults ()
 
 __appendToStoredResults ($a_usr_ids)
 
 __storeEntries (&$new_res)
 
 showSearchResults ()
 
 searchResultFilterListener ($a_ref_id, $a_data)
 Listener called from ilSearchResult Id is obj_id for role, usr Id is ref_id for crs grp. More...
 
 allowObjectSelection ($a_value=false)
 Toggle object selection status. More...
 
 setUserLimitations ($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)
 fill toolbar with More...
 

Data Fields

 $search_type = 'usr'
 

Protected Member Functions

 doUserAutoComplete ()
 Do auto completion. More...
 
 addUserFromAutoComplete ()
 Add user from auto complete input. More...
 
 showClipboard ()
 
 addFromClipboard ()
 add users from clipboard More...
 
 removeFromClipboard ()
 Remove from clipboard. More...
 
 emptyClipboard ()
 Remove from clipboard. More...
 
 handleMultiCommand ()
 Handle multi command. More...
 
 __performCourseSearch ()
 Search courses. More...
 
 addNewSearchButton ()
 Add new search button. More...
 
 showSearchUserTable ($a_usr_ids, $a_parent_cmd)
 Show usr table. More...
 
 showSearchRoleTable ($a_obj_ids)
 Show usr table. More...
 
 showSearchGroupTable ($a_obj_ids)
 
 showSearchCourseTable ($a_obj_ids)
 
 listUsers ()
 List users of course/group/roles. More...
 
 storedUserList ()
 Called from table sort. More...
 
 selectObject ()
 Return selection of course/group/roles to calling script. More...
 

Protected Attributes

 $add_options = array()
 
 $object_selection = false
 
 $searchable_check = true
 
 $search_title = ''
 
 $user_limitations = true
 
 $user_filter = null
 

Private Attributes

 $search_results = array()
 
 $privacy_mode = ilUserAutoComplete::PRIVACY_MODE_IGNORE_USER_SETTING
 

Detailed Description

Definition at line 42 of file class.ilRepositorySearchGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilRepositorySearchGUI::__construct ( )

Constructor @access public.

Definition at line 70 of file class.ilRepositorySearchGUI.php.

71 {
72 global $DIC;
73
74 $ilCtrl = $DIC['ilCtrl'];
75 $tpl = $DIC['tpl'];
76 $lng = $DIC['lng'];
77
78 $this->ctrl = $ilCtrl;
79 $this->tpl = $tpl;
80 $this->lng = $lng;
81 $this->lng->loadLanguageModule('search');
82 $this->lng->loadLanguageModule('crs');
83
84 $this->setTitle($this->lng->txt('add_members_header'));
85
86 $this->__setSearchType();
87 $this->__loadQueries();
88
89 $this->result_obj = new ilSearchResult();
90 $this->result_obj->setMaxHits(1000000);
91 $this->settings = new ilSearchSettings();
92 }
$tpl
Definition: ilias.php:10
setTitle($a_title)
Set form title.
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7
$lng
settings()
Definition: settings.php:2

References $DIC, $ilCtrl, $lng, $tpl, __loadQueries(), __setSearchType(), settings(), and setTitle().

+ Here is the call graph for this function:

Member Function Documentation

◆ __appendToStoredResults()

ilRepositorySearchGUI::__appendToStoredResults (   $a_usr_ids)

Definition at line 1009 of file class.ilRepositorySearchGUI.php.

1010 {
1011 if (!$_SESSION['search_append']) {
1012 return $_SESSION['rep_search']['usr'] = $a_usr_ids;
1013 }
1014 $_SESSION['rep_search']['usr'] = array();
1015 foreach ($a_usr_ids as $usr_id) {
1016 $_SESSION['rep_search']['usr'][] = $usr_id;
1017 }
1018 return $_SESSION['rep_search']['usr'] ? array_unique($_SESSION['rep_search']['usr']) : array();
1019 }
$_SESSION["AccountId"]

References $_SESSION.

Referenced by listUsers().

+ Here is the caller graph for this function:

◆ __clearSession()

ilRepositorySearchGUI::__clearSession ( )

Definition at line 397 of file class.ilRepositorySearchGUI.php.

398 {
399 unset($_SESSION['rep_search']);
400 unset($_SESSION['append_results']);
401 unset($_SESSION['rep_query']);
402 unset($_SESSION['rep_search_type']);
403 }

References $_SESSION.

Referenced by start().

+ Here is the caller graph for this function:

◆ __loadQueries()

ilRepositorySearchGUI::__loadQueries ( )

Definition at line 965 of file class.ilRepositorySearchGUI.php.

966 {
967 if (is_array($_POST['rep_query'])) {
968 $_SESSION['rep_query'] = $_POST['rep_query'];
969 }
970 }
$_POST["username"]

References $_POST, and $_SESSION.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ __parseQueryString()

& ilRepositorySearchGUI::__parseQueryString (   $a_string,
  $a_combination_or = true,
  $a_ignore_length = false 
)

parse query string, using query parser instance

Returns
object of query parser or error message if an error occured @access public

Definition at line 945 of file class.ilRepositorySearchGUI.php.

946 {
947 $query_parser = new ilQueryParser(ilUtil::stripSlashes($a_string));
948 $query_parser->setCombination($a_combination_or ? QP_COMBINATION_OR : QP_COMBINATION_AND);
949 $query_parser->setMinWordLength(1);
950
951 // #17502
952 if (!(bool) $a_ignore_length) {
953 $query_parser->setGlobalMinLength(3); // #14768
954 }
955
956 $query_parser->parse();
957
958 if (!$query_parser->validate()) {
959 return $query_parser->getMessage();
960 }
961 return $query_parser;
962 }
const QP_COMBINATION_OR
const QP_COMBINATION_AND
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled

References QP_COMBINATION_AND, QP_COMBINATION_OR, and ilUtil\stripSlashes().

Referenced by __performCourseSearch(), __performGroupSearch(), __performRoleSearch(), and __performUserSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performCourseSearch()

ilRepositorySearchGUI::__performCourseSearch ( )
protected

Search courses.

Returns

Definition at line 899 of file class.ilRepositorySearchGUI.php.

900 {
901 include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
902
903 $query_string = $_SESSION['rep_query']['crs']['title'];
904 if (!is_object($query_parser = $this->__parseQueryString($query_string))) {
905 ilUtil::sendInfo($query_parser, true);
906 return false;
907 }
908
909 include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
910 $object_search = new ilLikeObjectSearch($query_parser);
911 $object_search->setFilter(array('crs'));
912 $this->__storeEntries($object_search->performSearch());
913
914 return true;
915 }
& __parseQueryString($a_string, $a_combination_or=true, $a_ignore_length=false)
parse query string, using query parser instance
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.

References $_SESSION, __parseQueryString(), __storeEntries(), and ilUtil\sendInfo().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performGroupSearch()

ilRepositorySearchGUI::__performGroupSearch ( )

Search groups.

Returns

Definition at line 877 of file class.ilRepositorySearchGUI.php.

878 {
879 include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
880
881 $query_string = $_SESSION['rep_query']['grp']['title'];
882 if (!is_object($query_parser = $this->__parseQueryString($query_string))) {
883 ilUtil::sendInfo($query_parser, true);
884 return false;
885 }
886
887 include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
888 $object_search = new ilLikeObjectSearch($query_parser);
889 $object_search->setFilter(array('grp'));
890 $this->__storeEntries($object_search->performSearch());
891
892 return true;
893 }

References $_SESSION, __parseQueryString(), __storeEntries(), and ilUtil\sendInfo().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performRoleSearch()

ilRepositorySearchGUI::__performRoleSearch ( )

Search roles.

Returns

Definition at line 921 of file class.ilRepositorySearchGUI.php.

922 {
923 include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
924
925 $query_string = $_SESSION['rep_query']['role']['title'];
926 if (!is_object($query_parser = $this->__parseQueryString($query_string))) {
927 ilUtil::sendInfo($query_parser, true);
928 return false;
929 }
930
931 // Perform like search
932 include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
933 $object_search = new ilLikeObjectSearch($query_parser);
934 $object_search->setFilter(array('role'));
935 $this->__storeEntries($object_search->performSearch());
936
937 return true;
938 }

References $_SESSION, __parseQueryString(), __storeEntries(), and ilUtil\sendInfo().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performUserSearch()

ilRepositorySearchGUI::__performUserSearch ( )

Definition at line 807 of file class.ilRepositorySearchGUI.php.

808 {
809 include_once 'Services/Search/classes/class.ilUserSearchOptions.php';
810 include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
811
813 $name = $info['db'];
814 $query_string = $_SESSION['rep_query']['usr'][$name];
815
816 // continue if no query string is given
817 if (!$query_string) {
818 continue;
819 }
820
821 if (!is_object($query_parser = $this->__parseQueryString($query_string, true, ($info['type'] == FIELD_TYPE_SELECT)))) {
822 ilUtil::sendInfo($query_parser);
823 return false;
824 }
825 switch ($info['type']) {
827 // Do a phrase query for select fields
828 $query_parser = $this->__parseQueryString('"' . $query_string . '"');
829
830 // no break
833 $udf_search->setFields(array($name));
834 $result_obj = $udf_search->performSearch();
835
836 // Store entries
837 $this->__storeEntries($result_obj);
838 break;
839
841
842 if ($info['db'] == 'org_units') {
844 $result_obj = $user_search->performSearch();
845 $this->__storeEntries($result_obj);
846 break;
847 }
848
849 // Do a phrase query for select fields
850 $query_parser = $this->__parseQueryString('"' . $query_string . '"', true, true);
851
852 // no break
853 case FIELD_TYPE_TEXT:
854 $user_search = &ilObjectSearchFactory::_getUserSearchInstance($query_parser);
855 $user_search->setFields(array($name));
856 $result_obj = $user_search->performSearch();
857
858 // store entries
859 $this->__storeEntries($result_obj);
860 break;
861
862 case FIELD_TYPE_MULTI:
863 $multi_search = ilObjectSearchFactory::getUserMultiFieldSearchInstance($query_parser);
864 $multi_search->setFields(array($name));
865 $result_obj = $multi_search->performSearch();
866 $this->__storeEntries($result_obj);
867 break;
868
869 }
870 }
871 }
const FIELD_TYPE_TEXT
const FIELD_TYPE_MULTI
const FIELD_TYPE_SELECT
const FIELD_TYPE_UDF_SELECT
Class ilUserSearchOptions.
const FIELD_TYPE_UDF_TEXT
static _getUserDefinedFieldSearchInstance($query_parser)
get reference of ilLikeUserDefinedFieldSearch
static getUserMultiFieldSearchInstance($query_parser)
static getUserOrgUnitAssignmentInstance($query_parser)
get orgunit search instance
static _getUserSearchInstance($query_parser)
get reference of ilLikeUserSearch
static _getSearchableFieldsInfo($a_admin=false)
$info
Definition: index.php:5

References $_SESSION, $info, $name, __parseQueryString(), __storeEntries(), ilUserSearchOptions\_getSearchableFieldsInfo(), ilObjectSearchFactory\_getUserDefinedFieldSearchInstance(), ilObjectSearchFactory\_getUserSearchInstance(), FIELD_TYPE_MULTI, FIELD_TYPE_SELECT, FIELD_TYPE_TEXT, FIELD_TYPE_UDF_SELECT, FIELD_TYPE_UDF_TEXT, ilObjectSearchFactory\getUserMultiFieldSearchInstance(), ilObjectSearchFactory\getUserOrgUnitAssignmentInstance(), isSearchableCheckEnabled(), and ilUtil\sendInfo().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __setSearchType()

ilRepositorySearchGUI::__setSearchType ( )

Definition at line 973 of file class.ilRepositorySearchGUI.php.

974 {
975 // Update search type. Default to user search
976 if ($_POST['search_for']) {
977 #echo 1;
978 $_SESSION['rep_search_type'] = $_POST['search_for'];
979 }
980 if (!$_POST['search_for'] and !$_SESSION['rep_search_type']) {
981 #echo 2;
982 $_SESSION['rep_search_type'] = 'usr';
983 }
984
985 $this->search_type = $_SESSION['rep_search_type'];
986 #echo $this->search_type;
987
988 return true;
989 }

References $_POST, and $_SESSION.

Referenced by __construct().

+ Here is the caller graph for this function:

◆ __storeEntries()

ilRepositorySearchGUI::__storeEntries ( $new_res)

Definition at line 1021 of file class.ilRepositorySearchGUI.php.

1022 {
1023 if ($this->stored == false) {
1024 $this->result_obj->mergeEntries($new_res);
1025 $this->stored = true;
1026 return true;
1027 } else {
1028 $this->result_obj->intersectEntries($new_res);
1029 return true;
1030 }
1031 }

Referenced by __performCourseSearch(), __performGroupSearch(), __performRoleSearch(), and __performUserSearch().

+ Here is the caller graph for this function:

◆ __updateResults()

ilRepositorySearchGUI::__updateResults ( )

Definition at line 992 of file class.ilRepositorySearchGUI.php.

993 {
994 if (!$_SESSION['search_append']) {
995 $_SESSION['rep_search'] = array();
996 }
997 foreach ($this->search_results as $result) {
998 $_SESSION['rep_search'][$this->search_type][] = $result;
999 }
1000 if (!$_SESSION['rep_search'][$this->search_type]) {
1001 $_SESSION['rep_search'][$this->search_type] = array();
1002 } else {
1003 // remove duplicate entries
1004 $_SESSION['rep_search'][$this->search_type] = array_unique($_SESSION['rep_search'][$this->search_type]);
1005 }
1006 return true;
1007 }
$result

References $_SESSION, $result, and $search_type.

Referenced by performSearch().

+ Here is the caller graph for this function:

◆ addFromClipboard()

ilRepositorySearchGUI::addFromClipboard ( )
protected

add users from clipboard

Definition at line 480 of file class.ilRepositorySearchGUI.php.

481 {
482 $GLOBALS['DIC']['ilCtrl']->setParameter($this, 'user_type', (int) $_REQUEST['user_type']);
483 $users = (array) $_POST['uids'];
484 if (!count($users)) {
485 ilUtil::sendFailure($this->lng->txt('select_one'), true);
486 $GLOBALS['DIC']['ilCtrl']->redirect($this, 'showClipboard');
487 }
488 $class = $this->callback['class'];
489 $method = $this->callback['method'];
490 $user_type = isset($_REQUEST['user_type']) ? $_REQUEST['user_type'] : 0;
491
492 if (!$class->$method($users, $user_type)) {
493 $GLOBALS['DIC']['ilCtrl']->returnToParent($this);
494 }
495 }
$users
Definition: authpage.php:44
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.

References $_POST, $GLOBALS, $users, and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ addNewSearchButton()

ilRepositorySearchGUI::addNewSearchButton ( )
protected

Add new search button.

Returns

Definition at line 1037 of file class.ilRepositorySearchGUI.php.

1038 {
1039 include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1040 $toolbar = new ilToolbarGUI();
1041 $toolbar->addButton(
1042 $this->lng->txt('search_new'),
1043 $this->ctrl->getLinkTarget($this, 'showSearch')
1044 );
1045 $this->tpl->setVariable('ACTION_BUTTONS', $toolbar->getHTML());
1046 }

Referenced by listUsers(), showSearchResults(), and showSearchSelected().

+ Here is the caller graph for this function:

◆ addUser()

ilRepositorySearchGUI::addUser ( )

Reimplemented in ilStudyProgrammeRepositorySearchGUI.

Definition at line 420 of file class.ilRepositorySearchGUI.php.

421 {
422 $class = $this->callback['class'];
423 $method = $this->callback['method'];
424
425 // call callback if that function does give a return value => show error message
426 // listener redirects if everything is ok.
427 $class->$method((array) $_POST['user']);
428
429 $this->showSearchResults();
430 }

References $_POST, and showSearchResults().

+ Here is the call graph for this function:

◆ addUserAccessFilterCallable()

ilRepositorySearchGUI::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 }.

Parameters
callable$user_filter

Definition at line 103 of file class.ilRepositorySearchGUI.php.

104 {
105 $this->user_filter = $user_filter;
106 }

References $user_filter.

◆ addUserFromAutoComplete()

ilRepositorySearchGUI::addUserFromAutoComplete ( )
protected

Add user from auto complete input.

Definition at line 435 of file class.ilRepositorySearchGUI.php.

436 {
437 $class = $this->callback['class'];
438 $method = $this->callback['method'];
439
440 $users = explode(',', $_POST['user_login']);
441 $user_ids = array();
442 foreach ($users as $user) {
443 $user_id = ilObjUser::_lookupId($user);
444 if ($user_id) {
445 $user_ids[] = $user_id;
446 }
447 }
448
449 $user_type = isset($_REQUEST['user_type']) ? $_REQUEST['user_type'] : 0;
450
451 if (!$class->$method($user_ids, $user_type)) {
452 $GLOBALS['DIC']['ilCtrl']->returnToParent($this);
453 }
454 }
static _lookupId($a_user_str)
Lookup id by login.
$user
Definition: migrateto20.php:57

References $_POST, $GLOBALS, $user, $users, and ilObjUser\_lookupId().

+ Here is the call graph for this function:

◆ allowObjectSelection()

ilRepositorySearchGUI::allowObjectSelection (   $a_value = false)

Toggle object selection status.

Parameters
bool$a_value

Definition at line 1262 of file class.ilRepositorySearchGUI.php.

1263 {
1264 $this->object_selection = (bool) $a_value;
1265 }

◆ appendSearch()

ilRepositorySearchGUI::appendSearch ( )

Definition at line 710 of file class.ilRepositorySearchGUI.php.

711 {
712 $_SESSION['search_append'] = true;
713 $this->performSearch();
714 }

References $_SESSION, and performSearch().

+ Here is the call graph for this function:

◆ cancel()

ilRepositorySearchGUI::cancel ( )

Definition at line 405 of file class.ilRepositorySearchGUI.php.

406 {
407 $this->ctrl->returnToParent($this);
408 }

◆ doUserAutoComplete()

ilRepositorySearchGUI::doUserAutoComplete ( )
protected

Do auto completion.

Returns
void

Definition at line 318 of file class.ilRepositorySearchGUI.php.

319 {
320 // hide anonymout request
321 if ($GLOBALS['DIC']['ilUser']->getId() == ANONYMOUS_USER_ID) {
322 include_once './Services/JSON/classes/class.ilJsonUtil.php';
323 return ilJsonUtil::encode(new stdClass());
324 exit;
325 }
326
327
328 if (!isset($_GET['autoCompleteField'])) {
329 $a_fields = array('login','firstname','lastname','email');
330 $result_field = 'login';
331 } else {
332 $a_fields = array((string) $_GET['autoCompleteField']);
333 $result_field = (string) $_GET['autoCompleteField'];
334 }
335
336 include_once './Services/User/classes/class.ilUserAutoComplete.php';
337 $auto = new ilUserAutoComplete();
338 $auto->setPrivacyMode($this->getPrivacyMode());
339
340 if (($_REQUEST['fetchall'])) {
341 $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
342 }
343
344 $auto->setMoreLinkAvailable(true);
345 $auto->setSearchFields($a_fields);
346 $auto->setResultField($result_field);
347 $auto->enableFieldSearchableCheck(true);
348 $auto->setUserLimitations($this->getUserLimitations());
349 if (is_callable($this->user_filter)) { // #0024249
350 $auto->addUserAccessFilterCallable($this->user_filter);
351 }
352
353 echo $auto->getList($_REQUEST['term']);
354 exit();
355 }
exit
Definition: backend.php:16
$_GET["client_id"]
static encode($mixed, $suppress_native=false)
getUserLimitations()
allow user limitations like inactive and access limitations
Auto completion class for user lists.

References $_GET, $GLOBALS, ilJsonUtil\encode(), exit, getPrivacyMode(), getUserLimitations(), and ilUserAutoComplete\MAX_ENTRIES.

+ Here is the call graph for this function:

◆ emptyClipboard()

ilRepositorySearchGUI::emptyClipboard ( )
protected

Remove from clipboard.

Definition at line 521 of file class.ilRepositorySearchGUI.php.

522 {
523 include_once './Services/User/classes/class.ilUserClipboard.php';
524 $clip = ilUserClipboard::getInstance($GLOBALS['DIC']['ilUser']->getId());
525 $clip->clear();
526 $clip->save();
527
528 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
529 $this->ctrl->returnToParent($this);
530 }
static getInstance($a_usr_id)
Get singelton instance.

References $GLOBALS, and ilUserClipboard\getInstance().

+ Here is the call graph for this function:

◆ enableSearchableCheck()

ilRepositorySearchGUI::enableSearchableCheck (   $a_status)

En/disable the validation of the searchable flag.

Parameters
bool$a_status

Definition at line 130 of file class.ilRepositorySearchGUI.php.

131 {
132 $this->searchable_check = $a_status;
133 }

◆ executeCommand()

ilRepositorySearchGUI::executeCommand ( )

Control @access public.

Definition at line 375 of file class.ilRepositorySearchGUI.php.

376 {
377 global $DIC;
378
379 $rbacsystem = $DIC['rbacsystem'];
380
381 $next_class = $this->ctrl->getNextClass($this);
382 $cmd = $this->ctrl->getCmd();
383
384 $this->ctrl->setReturn($this, '');
385
386 switch ($next_class) {
387 default:
388 if (!$cmd) {
389 $cmd = "showSearch";
390 }
391 $this->$cmd();
392 break;
393 }
394 return true;
395 }

References $DIC.

◆ fillAutoCompleteToolbar()

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

fill toolbar with

Parameters
ilToolbarGUI$toolbar
arrayoptions: all are optional e.g. 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') )
Returns
ilToolbarGUI

Reimplemented in ilStudyProgrammeRepositorySearchGUI.

Definition at line 174 of file class.ilRepositorySearchGUI.php.

175 {
176 global $DIC;
177
178 $ilToolbar = $DIC['ilToolbar'];
179 $lng = $DIC['lng'];
180 $ilCtrl = $DIC['ilCtrl'];
181 $tree = $DIC['tree'];
182
183 if (!$toolbar instanceof ilToolbarGUI) {
184 $toolbar = $ilToolbar;
185 }
186
187 // Fill default options
188 if (!isset($a_options['auto_complete_name'])) {
189 $a_options['auto_complete_name'] = $lng->txt('obj_user');
190 }
191 if (!isset($a_options['auto_complete_size'])) {
192 $a_options['auto_complete_size'] = 15;
193 }
194 if (!isset($a_options['submit_name'])) {
195 $a_options['submit_name'] = $lng->txt('btn_add');
196 }
197 if (!isset($a_options['user_type_default'])) {
198 $a_options['user_type_default'] = null;
199 }
200
201 $ajax_url = $ilCtrl->getLinkTargetByClass(
202 array(get_class($parent_object),'ilRepositorySearchGUI'),
203 'doUserAutoComplete',
204 '',
205 true,
206 false
207 );
208
209 include_once("./Services/Form/classes/class.ilTextInputGUI.php");
210 $ul = new ilTextInputGUI($a_options['auto_complete_name'], 'user_login');
211 $ul->setDataSource($ajax_url);
212 $ul->setSize($a_options['auto_complete_size']);
213 if (!$a_sticky) {
214 $toolbar->addInputItem($ul, true);
215 } else {
216 $toolbar->addStickyItem($ul, true);
217 }
218
219 if (count((array) $a_options['user_type'])) {
220 include_once './Services/Form/classes/class.ilSelectInputGUI.php';
221 $si = new ilSelectInputGUI("", "user_type");
222 $si->setOptions($a_options['user_type']);
223 $si->setValue($a_options['user_type_default']);
224 if (!$a_sticky) {
225 $toolbar->addInputItem($si);
226 } else {
227 $toolbar->addStickyItem($si);
228 }
229 }
230
231 include_once './Services/User/classes/class.ilUserClipboard.php';
232 $clip = ilUserClipboard::getInstance($GLOBALS['DIC']['ilUser']->getId());
233 if ($clip->hasContent()) {
234 include_once './Services/UIComponent/SplitButton/classes/class.ilSplitButtonGUI.php';
235 $action_button = ilSplitButtonGUI::getInstance();
236
237 include_once './Services/UIComponent/Button/classes/class.ilLinkButton.php';
238 $add_button = ilSubmitButton::getInstance();
239 $add_button->setCaption($a_options['submit_name'], false);
240 $add_button->setCommand('addUserFromAutoComplete');
241
242 $action_button->setDefaultButton($add_button);
243
244 include_once './Services/UIComponent/Button/classes/class.ilLinkButton.php';
245 $clip_button = ilSubmitButton::getInstance();
246 $clip_button->addCSSClass('btn btndefault');
247 $GLOBALS['DIC']->language()->loadLanguageModule('user');
248 $clip_button->setCaption($GLOBALS['DIC']->language()->txt('clipboard_add_from_btn'), false);
249 $clip_button->setCommand('showClipboard');
250
251 $action_button->addMenuItem(new ilButtonToSplitButtonMenuItemAdapter($clip_button));
252
253 $toolbar->addButtonInstance($action_button);
254 } else {
255 include_once "Services/UIComponent/Button/classes/class.ilSubmitButton.php";
256 $button = ilSubmitButton::getInstance();
257 $button->setCaption($a_options['submit_name'], false);
258 $button->setCommand('addUserFromAutoComplete');
259 if (!$a_sticky) {
260 $toolbar->addButtonInstance($button);
261 } else {
262 $toolbar->addStickyItem($button);
263 }
264 }
265
266 if ((bool) $a_options['add_search'] ||
267 is_numeric($a_options['add_from_container'])) {
268 $lng->loadLanguageModule("search");
269
270 $toolbar->addSeparator();
271
272 if ((bool) $a_options['add_search']) {
273 include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
274 $button = ilLinkButton::getInstance();
275 $button->setCaption("search_users");
276 $button->setUrl($ilCtrl->getLinkTargetByClass('ilRepositorySearchGUI', ''));
277 $toolbar->addButtonInstance($button);
278 }
279
280 if (is_numeric($a_options['add_from_container'])) {
281 $parent_ref_id = (int) $a_options['add_from_container'];
282 $parent_container_ref_id = $tree->checkForParentType($parent_ref_id, "grp");
283 $parent_container_type = "grp";
284 if (!$parent_container_ref_id) {
285 $parent_container_ref_id = $tree->checkForParentType($parent_ref_id, "crs");
286 $parent_container_type = "crs";
287 }
288 if ($parent_container_ref_id) {
289 if ((bool) $a_options['add_search']) {
290 $toolbar->addSpacer();
291 }
292
293 $ilCtrl->setParameterByClass('ilRepositorySearchGUI', "list_obj", ilObject::_lookupObjId($parent_container_ref_id));
294
295 include_once "Services/UIComponent/Button/classes/class.ilLinkButton.php";
296 $button = ilLinkButton::getInstance();
297 $button->setCaption("search_add_members_from_container_" . $parent_container_type);
298 $button->setUrl($ilCtrl->getLinkTargetByClass(array(get_class($parent_object),'ilRepositorySearchGUI'), 'listUsers'));
299 $toolbar->addButtonInstance($button);
300 }
301 }
302 }
303
304 $toolbar->setFormAction(
305 $ilCtrl->getFormActionByClass(
306 array(
307 get_class($parent_object),
308 'ilRepositorySearchGUI')
309 )
310 );
311 return $toolbar;
312 }
static getInstance()
Factory.
static _lookupObjId($a_id)
This class represents a selection list property in a property form.
static getInstance()
Factory.
This class represents a text property in a property form.
addButtonInstance(ilButtonBase $a_button)
Add button instance.
setFormAction($a_val, $a_multipart=false, $a_target="")
Set form action (if form action is set, toolbar is wrapped into form tags)
addStickyItem($a_item, $a_output_label=false)
Add a sticky item.
addInputItem(ilToolbarItem $a_item, $a_output_label=false)
Add input item.
addSpacer($a_width=null)
Add spacer.
addSeparator()
Add separator.

References $DIC, $GLOBALS, $ilCtrl, $lng, $si, $tree, ilObject\_lookupObjId(), ilUserClipboard\getInstance(), ilLinkButton\getInstance(), ilSubmitButton\getInstance(), and ilSplitButtonGUI\getInstance().

Referenced by ilOrgUnitStaffGUI\addOtherRolesToolbar(), ilOrgUnitStaffGUI\addStaffToolbar(), ilTestParticipantsGUI\addUserSearchControls(), ilObjBlogGUI\contributors(), ilSurveyParticipantsGUI\editRatersObject(), ilOrgUnitUserAssignmentGUI\index(), ilSurveyParticipantsGUI\inviteObject(), ilSurveyParticipantsGUI\listAppraiseesObject(), ilExerciseManagementGUI\membersObject(), ilBookingParticipantGUI\render(), ilLearningSequenceMembershipGUI\showParticipantsToolbar(), ilMembershipGUI\showParticipantsToolbar(), ilSkillProfileGUI\showUsers(), ilExSubmissionTeamGUI\submissionScreenTeamObject(), ilObjRoleGUI\userassignmentObject(), and ilIndividualAssessmentMembersGUI\view().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPrivacyMode()

ilRepositorySearchGUI::getPrivacyMode ( )
Returns
int

Definition at line 155 of file class.ilRepositorySearchGUI.php.

References $privacy_mode.

Referenced by doUserAutoComplete(), performSearch(), and showSearch().

+ Here is the caller graph for this function:

◆ getString()

ilRepositorySearchGUI::getString ( )

Definition at line 366 of file class.ilRepositorySearchGUI.php.

367 {
368 return $this->string;
369 }

◆ getTitle()

ilRepositorySearchGUI::getTitle ( )

Get search form title.

Returns
string

Definition at line 121 of file class.ilRepositorySearchGUI.php.

References $search_title.

Referenced by initFormSearch().

+ Here is the caller graph for this function:

◆ getUserLimitations()

ilRepositorySearchGUI::getUserLimitations ( )

allow user limitations like inactive and access limitations

Returns
bool

Definition at line 1301 of file class.ilRepositorySearchGUI.php.

References $user_limitations.

Referenced by doUserAutoComplete(), and showSearchUserTable().

+ Here is the caller graph for this function:

◆ handleMultiCommand()

ilRepositorySearchGUI::handleMultiCommand ( )
protected

Handle multi command.

Definition at line 535 of file class.ilRepositorySearchGUI.php.

536 {
537 $class = $this->callback['class'];
538 $method = $this->callback['method'];
539
540 // Redirects if everything is ok
541 if (!$class->$method((array) $_POST['user'], $_POST['selectedCommand'])) {
542 $this->showSearchResults();
543 }
544 }

References $_POST, and showSearchResults().

+ Here is the call graph for this function:

◆ initFormSearch()

ilRepositorySearchGUI::initFormSearch ( ilObjUser  $user = null)

Definition at line 589 of file class.ilRepositorySearchGUI.php.

590 {
591 global $DIC;
592
593 $ilCtrl = $DIC['ilCtrl'];
594
595 include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
596
597 $this->form = new ilPropertyFormGUI();
598 $this->form->setFormAction($this->ctrl->getFormAction($this, 'showSearch'));
599 $this->form->setTitle($this->getTitle());
600 $this->form->addCommandButton('performSearch', $this->lng->txt('search'));
601 $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
602
603
604 $kind = new ilRadioGroupInputGUI($this->lng->txt('search_type'), 'search_for');
605 $kind->setValue($this->search_type);
606 $this->form->addItem($kind);
607
608 // Users
609 $users = new ilRadioOption($this->lng->txt('search_for_users'), 'usr');
610
611 // UDF
612 include_once 'Services/Search/classes/class.ilUserSearchOptions.php';
614 switch ($info['type']) {
617
618 $sel = new ilSelectInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
619 $sel->setOptions($info['values']);
620 $users->addSubItem($sel);
621 break;
622
623 case FIELD_TYPE_MULTI:
625 case FIELD_TYPE_TEXT:
626
627 if (isset($info['autoComplete']) and $info['autoComplete']) {
628 $ilCtrl->setParameterByClass(get_class($this), 'autoCompleteField', $info['db']);
629 $ul = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
630 $ul->setDataSourceSubmitOnSelection(true);
631 $ul->setDataSourceSubmitUrl(
632 $this->ctrl->getLinkTarget(
633 $this,
634 'showSearchSelected',
635 '',
636 false,
637 false
638 )
639 );
640 $ul->setDataSource($ilCtrl->getLinkTarget(
641 $this,
642 "doUserAutoComplete",
643 "",
644 true
645 ));
646 $ul->setSize(30);
647 $ul->setMaxLength(120);
648
649 if ($user instanceof ilObjUser) {
650 switch ($info['db']) {
651 case 'firstname':
652 $ul->setValue($user->getFirstname());
653 break;
654 case 'lastname':
655 $ul->setValue($user->getLastname());
656 break;
657 case 'login':
658 $ul->setValue($user->getLogin());
659 break;
660 }
661 }
662
663
664
665 $users->addSubItem($ul);
666 } else {
667 $txt = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
668 $txt->setSize(30);
669 $txt->setMaxLength(120);
670 $users->addSubItem($txt);
671 }
672 break;
673 }
674 }
675 $kind->addOption($users);
676
677
678
679 // Role
680 $roles = new ilRadioOption($this->lng->txt('search_for_role_members'), 'role');
681 $role = new ilTextInputGUI($this->lng->txt('search_role_title'), 'rep_query[role][title]');
682 $role->setSize(30);
683 $role->setMaxLength(120);
684 $roles->addSubItem($role);
685 $kind->addOption($roles);
686
687 // Course
688 $groups = new ilRadioOption($this->lng->txt('search_for_crs_members'), 'crs');
689 $group = new ilTextInputGUI($this->lng->txt('search_crs_title'), 'rep_query[crs][title]');
690 $group->setSize(30);
691 $group->setMaxLength(120);
692 $groups->addSubItem($group);
693 $kind->addOption($groups);
694
695 // Group
696 $groups = new ilRadioOption($this->lng->txt('search_for_grp_members'), 'grp');
697 $group = new ilTextInputGUI($this->lng->txt('search_grp_title'), 'rep_query[grp][title]');
698 $group->setSize(30);
699 $group->setMaxLength(120);
700 $groups->addSubItem($group);
701 $kind->addOption($groups);
702 }
This class represents a property form user interface.
This class represents a property in a property form.
This class represents an option in a radio group.
getTitle()
Get search form title.
$txt
Definition: error.php:11

References $DIC, $ilCtrl, $info, $txt, $user, $users, ilUserSearchOptions\_getSearchableFieldsInfo(), FIELD_TYPE_MULTI, FIELD_TYPE_SELECT, FIELD_TYPE_TEXT, FIELD_TYPE_UDF_SELECT, FIELD_TYPE_UDF_TEXT, getTitle(), and isSearchableCheckEnabled().

Referenced by showSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSearchableCheckEnabled()

ilRepositorySearchGUI::isSearchableCheckEnabled ( )
Returns
bool

Definition at line 139 of file class.ilRepositorySearchGUI.php.

References $searchable_check.

Referenced by __performUserSearch(), and initFormSearch().

+ Here is the caller graph for this function:

◆ listUsers()

ilRepositorySearchGUI::listUsers ( )
protected

List users of course/group/roles.

Returns

Definition at line 1156 of file class.ilRepositorySearchGUI.php.

1157 {
1158 // get parameter is used e.g. in exercises to provide
1159 // "add members of course" link
1160 if ($_GET["list_obj"] != "" && !is_array($_POST['obj'])) {
1161 $_POST['obj'][0] = $_GET["list_obj"];
1162 }
1163 if (!is_array($_POST['obj']) or !$_POST['obj']) {
1164 ilUtil::sendFailure($this->lng->txt('select_one'));
1165 $this->showSearchResults();
1166 return false;
1167 }
1168
1169 $_SESSION['rep_search']['objs'] = $_POST['obj'];
1170
1171 // Get all members
1172 $members = array();
1173 foreach ($_POST['obj'] as $obj_id) {
1174 $type = ilObject::_lookupType($obj_id);
1175 switch ($type) {
1176 case 'crs':
1177 case 'grp':
1178
1179 include_once './Services/Membership/classes/class.ilParticipants.php';
1181 $part = [];
1182 if (is_callable($this->user_filter)) {
1183 $part = call_user_func_array(
1184 $this->user_filter,
1185 [
1186 ilParticipants::getInstanceByObjId($obj_id)->getParticipants()
1187 ]
1188 );
1189 } else {
1190 $part = ilParticipants::getInstanceByObjId($obj_id)->getParticipants();
1191 }
1192
1193 $members = array_merge((array) $members, $part);
1194 }
1195 break;
1196
1197 case 'role':
1198 global $DIC;
1199
1200 $rbacreview = $DIC['rbacreview'];
1201
1202 $assigned = [];
1203 if (is_callable($this->user_filter)) {
1204 $assigned = call_user_func_array(
1205 $this->user_filter,
1206 [
1207 $rbacreview->assignedUsers($obj_id)
1208 ]
1209 );
1210 } else {
1211 $assigned = $rbacreview->assignedUsers($obj_id);
1212 }
1213
1214 $members = array_merge($members, ilUserFilter::getInstance()->filter($assigned));
1215 break;
1216 }
1217 }
1218 $members = array_unique((array) $members);
1219 $this->__appendToStoredResults($members);
1220
1221 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.rep_search_result.html', 'Services/Search');
1222
1223 $this->addNewSearchButton();
1224 $this->showSearchUserTable($_SESSION['rep_search']['usr'], 'storedUserList');
1225 return true;
1226 }
static _lookupType($a_id, $a_reference=false)
lookup object type
static hasParticipantListAccess($a_obj_id, $a_usr_id=null)
Check if (current) user has access to the participant list.
static getInstanceByObjId($a_obj_id)
Get instance by obj type.
showSearchUserTable($a_usr_ids, $a_parent_cmd)
Show usr table.
addNewSearchButton()
Add new search button.
static getInstance()
Singelton get instance.
$type

References $_GET, $_POST, $_SESSION, $DIC, $type, __appendToStoredResults(), ilObject\_lookupType(), addNewSearchButton(), ilUserFilter\getInstance(), ilParticipants\getInstanceByObjId(), ilParticipants\hasParticipantListAccess(), ilUtil\sendFailure(), showSearchResults(), and showSearchUserTable().

Referenced by storedUserList().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ performSearch()

ilRepositorySearchGUI::performSearch ( )

Perform a search.

Returns

Definition at line 720 of file class.ilRepositorySearchGUI.php.

721 {
722 // only autocomplete input field, no search form if user privay should be respected
723 // see bug 25481
725 return "";
726 }
727 $found_query = false;
728 foreach ((array) $_POST['rep_query'][$_POST['search_for']] as $field => $value) {
729 if (trim(ilUtil::stripSlashes($value))) {
730 $found_query = true;
731 break;
732 }
733 }
734 if (!$found_query) {
735 ilUtil::sendFailure($this->lng->txt('msg_no_search_string'));
736 $this->start();
737 return false;
738 }
739
740 // unset search_append if called directly
741 if ($_POST['cmd']['performSearch']) {
742 unset($_SESSION['search_append']);
743 }
744
745 switch ($this->search_type) {
746 case 'usr':
747 $this->__performUserSearch();
748 break;
749
750 case 'grp':
751 $this->__performGroupSearch();
752 break;
753
754 case 'crs':
755 $this->__performCourseSearch();
756 break;
757
758 case 'role':
759 $this->__performRoleSearch();
760 break;
761
762 default:
763 echo 'not defined';
764 }
765
766 $this->result_obj->setRequiredPermission('read');
767 $this->result_obj->addObserver($this, 'searchResultFilterListener');
768 $this->result_obj->filter(ROOT_FOLDER_ID, QP_COMBINATION_OR);
769
770 // User access filter
771 if ($this->search_type == 'usr') {
772 $callable_name = '';
773 if (is_callable($this->user_filter, true, $callable_name)) {
774 $result_ids = call_user_func_array($this->user_filter, [$this->result_obj->getResultIds()]);
775 } else {
776 $result_ids = $this->result_obj->getResultIds();
777 }
778
779 include_once './Services/User/classes/class.ilUserFilter.php';
780 $this->search_results = array_intersect(
781 $result_ids,
782 ilUserFilter::getInstance()->filter($result_ids)
783 );
784 } else {
785 $this->search_results = array();
786 foreach ((array) $this->result_obj->getResults() as $res) {
787 $this->search_results[] = $res['obj_id'];
788 }
789 }
790
791 if (!count($this->search_results)) {
792 ilUtil::sendFailure($this->lng->txt('search_no_match'));
793 $this->showSearch();
794 return true;
795 }
796 $this->__updateResults();
797 if ($this->result_obj->isLimitReached()) {
798 $message = sprintf($this->lng->txt('search_limit_reached'), $this->settings->getMaxHits());
800 return true;
801 }
802 // show results
803 $this->show();
804 return true;
805 }
catch(Exception $e) $message
foreach($_POST as $key=> $value) $res

References $_POST, $_SESSION, $message, $res, __performCourseSearch(), __performGroupSearch(), __performRoleSearch(), __performUserSearch(), __updateResults(), ilUserFilter\getInstance(), getPrivacyMode(), ilUserAutoComplete\PRIVACY_MODE_RESPECT_USER_SETTING, QP_COMBINATION_OR, ilUtil\sendFailure(), ilUtil\sendInfo(), show(), showSearch(), start(), and ilUtil\stripSlashes().

Referenced by appendSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ removeFromClipboard()

ilRepositorySearchGUI::removeFromClipboard ( )
protected

Remove from clipboard.

Definition at line 500 of file class.ilRepositorySearchGUI.php.

501 {
502 $GLOBALS['DIC']['ilCtrl']->setParameter($this, 'user_type', (int) $_REQUEST['user_type']);
503 $users = (array) $_POST['uids'];
504 if (!count($users)) {
505 ilUtil::sendFailure($this->lng->txt('select_one'), true);
506 $GLOBALS['DIC']['ilCtrl']->redirect($this, 'showClipboard');
507 }
508
509 include_once './Services/User/classes/class.ilUserClipboard.php';
510 $clip = ilUserClipboard::getInstance($GLOBALS['DIC']['ilUser']->getId());
511 $clip->delete($users);
512 $clip->save();
513
514 ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
515 $this->ctrl->redirect($this, 'showClipboard');
516 }

References $_POST, $GLOBALS, $users, ilUserClipboard\getInstance(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ searchResultFilterListener()

ilRepositorySearchGUI::searchResultFilterListener (   $a_ref_id,
  $a_data 
)

Listener called from ilSearchResult Id is obj_id for role, usr Id is ref_id for crs grp.

Parameters
int$a_id
array$a_data
Returns

Definition at line 1247 of file class.ilRepositorySearchGUI.php.

1248 {
1249 if ($a_data['type'] == 'usr') {
1250 if ($a_data['obj_id'] == ANONYMOUS_USER_ID) {
1251 return false;
1252 }
1253 }
1254 return true;
1255 }

◆ selectObject()

ilRepositorySearchGUI::selectObject ( )
protected

Return selection of course/group/roles to calling script.

Definition at line 1270 of file class.ilRepositorySearchGUI.php.

1271 {
1272 // get parameter is used e.g. in exercises to provide
1273 // "add members of course" link
1274 if ($_GET["list_obj"] != "" && !is_array($_POST['obj'])) {
1275 $_POST['obj'][0] = $_GET["list_obj"];
1276 }
1277 if (!is_array($_POST['obj']) or !$_POST['obj']) {
1278 ilUtil::sendFailure($this->lng->txt('select_one'));
1279 $this->showSearchResults();
1280 return false;
1281 }
1282
1283 $this->ctrl->setParameter($this->callback["class"], "obj", implode(";", $_POST["obj"]));
1284 $this->ctrl->redirect($this->callback["class"], $this->callback["method"]);
1285 }

References $_GET, $_POST, ilUtil\sendFailure(), and showSearchResults().

+ Here is the call graph for this function:

◆ setCallback()

ilRepositorySearchGUI::setCallback ( $class,
  $method,
  $a_add_options = array() 
)

Definition at line 546 of file class.ilRepositorySearchGUI.php.

547 {
548 $this->callback = array('class' => $class,'method' => $method);
549 $this->add_options = $a_add_options ? $a_add_options : array();
550 }

◆ setPermissionQueryCallback()

ilRepositorySearchGUI::setPermissionQueryCallback (   $class,
  $method 
)

Set callback method for user permission access queries.

Definition at line 555 of file class.ilRepositorySearchGUI.php.

556 {
557 }

◆ setPrivacyMode()

ilRepositorySearchGUI::setPrivacyMode (   $privacy_mode)
Parameters
int$privacy_mode

Definition at line 147 of file class.ilRepositorySearchGUI.php.

148 {
149 $this->privacy_mode = $privacy_mode;
150 }

References $privacy_mode.

◆ setString()

ilRepositorySearchGUI::setString (   $a_str)

Set/get search string @access public.

Definition at line 362 of file class.ilRepositorySearchGUI.php.

363 {
364 $_SESSION['search']['string'] = $this->string = $a_str;
365 }

References $_SESSION.

◆ setTitle()

ilRepositorySearchGUI::setTitle (   $a_title)

Set form title.

Parameters
string$a_title

Definition at line 112 of file class.ilRepositorySearchGUI.php.

113 {
114 $this->search_title = $a_title;
115 }

Referenced by __construct().

+ Here is the caller graph for this function:

◆ setUserLimitations()

ilRepositorySearchGUI::setUserLimitations (   $a_limitations)

allow user limitations like inactive and access limitations

Parameters
bool$a_limitations

Definition at line 1292 of file class.ilRepositorySearchGUI.php.

1293 {
1294 $this->user_limitations = (bool) $a_limitations;
1295 }

◆ show()

ilRepositorySearchGUI::show ( )

Definition at line 705 of file class.ilRepositorySearchGUI.php.

706 {
707 $this->showSearchResults();
708 }

References showSearchResults().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showClipboard()

ilRepositorySearchGUI::showClipboard ( )
protected

Definition at line 456 of file class.ilRepositorySearchGUI.php.

457 {
458 $GLOBALS['DIC']['ilCtrl']->setParameter($this, 'user_type', (int) $_REQUEST['user_type']);
459
460 ilLoggerFactory::getLogger('crs')->dump($_REQUEST);
461
462 $GLOBALS['DIC']['ilTabs']->clearTargets();
463 $GLOBALS['DIC']['ilTabs']->setBackTarget(
464 $GLOBALS['DIC']['lng']->txt('back'),
465 $GLOBALS['DIC']['ilCtrl']->getParentReturn($this)
466 );
467
468 include_once './Services/User/classes/class.ilUserClipboardTableGUI.php';
469 $clip = new ilUserClipboardTableGUI($this, 'showClipboard', $GLOBALS['DIC']['ilUser']->getId());
470 $clip->setFormAction($GLOBALS['DIC']['ilCtrl']->getFormAction($this));
471 $clip->init();
472 $clip->parse();
473
474 $GLOBALS['DIC']['tpl']->setContent($clip->getHTML());
475 }
static getLogger($a_component_id)
Get component logger.
Show administrate clipboard content.

References $GLOBALS, and ilLoggerFactory\getLogger().

+ Here is the call graph for this function:

◆ showSearch()

ilRepositorySearchGUI::showSearch ( )

Definition at line 559 of file class.ilRepositorySearchGUI.php.

560 {
561 // only autocomplete input field, no search form if user privay should be respected
562 // see bug 25481
564 return;
565 }
566 $this->initFormSearch();
567 $this->tpl->setContent($this->form->getHTML());
568 }
initFormSearch(ilObjUser $user=null)

References getPrivacyMode(), initFormSearch(), and ilUserAutoComplete\PRIVACY_MODE_RESPECT_USER_SETTING.

Referenced by performSearch(), and start().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSearchCourseTable()

ilRepositorySearchGUI::showSearchCourseTable (   $a_obj_ids)
protected
Returns
Parameters
array$a_obj_ids

Definition at line 1142 of file class.ilRepositorySearchGUI.php.

1143 {
1144 include_once './Services/Search/classes/class.ilRepositoryObjectResultTableGUI.php';
1145
1146 $table = new ilRepositoryObjectResultTableGUI($this, 'showSearchResults', $this->object_selection);
1147 $table->parseObjectIds($a_obj_ids);
1148
1149 $this->tpl->setVariable('RES_TABLE', $table->getHTML());
1150 }
TableGUI class object (course,group and role) search results Used in member search.
if(empty($password)) $table
Definition: pwgen.php:24

References $table.

Referenced by showSearchResults().

+ Here is the caller graph for this function:

◆ showSearchGroupTable()

ilRepositorySearchGUI::showSearchGroupTable (   $a_obj_ids)
protected
Returns
Parameters
array$a_obj_ids

Definition at line 1127 of file class.ilRepositorySearchGUI.php.

1128 {
1129 include_once './Services/Search/classes/class.ilRepositoryObjectResultTableGUI.php';
1130
1131 $table = new ilRepositoryObjectResultTableGUI($this, 'showSearchResults', $this->object_selection);
1132 $table->parseObjectIds($a_obj_ids);
1133
1134 $this->tpl->setVariable('RES_TABLE', $table->getHTML());
1135 }

References $table.

Referenced by showSearchResults().

+ Here is the caller graph for this function:

◆ showSearchResults()

ilRepositorySearchGUI::showSearchResults ( )

Definition at line 1048 of file class.ilRepositorySearchGUI.php.

1049 {
1050 $counter = 0;
1051 $f_result = array();
1052
1053 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.rep_search_result.html', 'Services/Search');
1054 $this->addNewSearchButton();
1055
1056 switch ($this->search_type) {
1057 case "usr":
1058 $this->showSearchUserTable($_SESSION['rep_search']['usr'], 'showSearchResults');
1059 break;
1060
1061 case 'grp':
1062 $this->showSearchGroupTable($_SESSION['rep_search']['grp']);
1063 break;
1064
1065 case 'crs':
1066 $this->showSearchCourseTable($_SESSION['rep_search']['crs']);
1067 break;
1068
1069 case 'role':
1070 $this->showSearchRoleTable($_SESSION['rep_search']['role']);
1071 break;
1072 }
1073 }
showSearchRoleTable($a_obj_ids)
Show usr table.

References $_SESSION, addNewSearchButton(), showSearchCourseTable(), showSearchGroupTable(), showSearchRoleTable(), and showSearchUserTable().

Referenced by addUser(), handleMultiCommand(), listUsers(), selectObject(), and show().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showSearchRoleTable()

ilRepositorySearchGUI::showSearchRoleTable (   $a_obj_ids)
protected

Show usr table.

Returns
Parameters
object$a_usr_ids

Definition at line 1112 of file class.ilRepositorySearchGUI.php.

1113 {
1114 include_once './Services/Search/classes/class.ilRepositoryObjectResultTableGUI.php';
1115
1116 $table = new ilRepositoryObjectResultTableGUI($this, 'showSearchResults', $this->object_selection);
1117 $table->parseObjectIds($a_obj_ids);
1118
1119 $this->tpl->setVariable('RES_TABLE', $table->getHTML());
1120 }

References $table.

Referenced by showSearchResults().

+ Here is the caller graph for this function:

◆ showSearchSelected()

ilRepositorySearchGUI::showSearchSelected ( )

submit from autocomplete

Definition at line 573 of file class.ilRepositorySearchGUI.php.

574 {
575 $selected = (int) $_REQUEST['selected_id'];
576
577 #include_once './Services/Object/classes/class.ilObjectFactory.php';
578 #$factory = new ilObjectFactory();
579 #$user = $factory->getInstanceByObjId($selected);
580
581 #$this->initFormSearch($user);
582 #$this->tpl->setContent($this->form->getHTML());
583
584 $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.rep_search_result.html', 'Services/Search');
585 $this->addNewSearchButton();
586 $this->showSearchUserTable(array($selected), 'showSearchResults');
587 }

References addNewSearchButton(), and showSearchUserTable().

+ Here is the call graph for this function:

◆ showSearchUserTable()

ilRepositorySearchGUI::showSearchUserTable (   $a_usr_ids,
  $a_parent_cmd 
)
protected

Show usr table.

Returns
Parameters
object$a_usr_ids

Definition at line 1080 of file class.ilRepositorySearchGUI.php.

1081 {
1082 $is_in_admin = ($_REQUEST['baseClass'] == 'ilAdministrationGUI');
1083 if ($is_in_admin) {
1084 // remember link target to admin search gui (this)
1085 $_SESSION["usr_search_link"] = $this->ctrl->getLinkTarget($this, 'show');
1086 }
1087
1088 include_once './Services/Search/classes/class.ilRepositoryUserResultTableGUI.php';
1089
1090 $table = new ilRepositoryUserResultTableGUI($this, $a_parent_cmd, $is_in_admin);
1091 if (count($this->add_options)) {
1092 $table->addMultiItemSelectionButton(
1093 'selectedCommand',
1094 $this->add_options,
1095 'handleMultiCommand',
1096 $this->lng->txt('execute')
1097 );
1098 } else {
1099 $table->addMultiCommand('addUser', $this->lng->txt('btn_add'));
1100 }
1101 $table->setUserLimitations($this->getUserLimitations());
1102 $table->parseUserIds($a_usr_ids);
1103
1104 $this->tpl->setVariable('RES_TABLE', $table->getHTML());
1105 }

References $_SESSION, $table, and getUserLimitations().

Referenced by listUsers(), showSearchResults(), and showSearchSelected().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start()

ilRepositorySearchGUI::start ( )

Definition at line 410 of file class.ilRepositorySearchGUI.php.

411 {
412 // delete all session info
413 $this->__clearSession();
414 $this->showSearch();
415
416 return true;
417 }

References __clearSession(), and showSearch().

Referenced by performSearch().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ storedUserList()

ilRepositorySearchGUI::storedUserList ( )
protected

Called from table sort.

Returns

Definition at line 1232 of file class.ilRepositorySearchGUI.php.

1233 {
1234 $_POST['obj'] = $_SESSION['rep_search']['objs'];
1235 $this->listUsers();
1236 return true;
1237 }
listUsers()
List users of course/group/roles.

References $_POST, $_SESSION, and listUsers().

+ Here is the call graph for this function:

Field Documentation

◆ $add_options

ilRepositorySearchGUI::$add_options = array()
protected

Definition at line 46 of file class.ilRepositorySearchGUI.php.

◆ $object_selection

ilRepositorySearchGUI::$object_selection = false
protected

Definition at line 47 of file class.ilRepositorySearchGUI.php.

◆ $privacy_mode

ilRepositorySearchGUI::$privacy_mode = ilUserAutoComplete::PRIVACY_MODE_IGNORE_USER_SETTING
private

Definition at line 63 of file class.ilRepositorySearchGUI.php.

Referenced by getPrivacyMode(), and setPrivacyMode().

◆ $search_results

ilRepositorySearchGUI::$search_results = array()
private

Definition at line 44 of file class.ilRepositorySearchGUI.php.

◆ $search_title

ilRepositorySearchGUI::$search_title = ''
protected

Definition at line 50 of file class.ilRepositorySearchGUI.php.

Referenced by getTitle().

◆ $search_type

ilRepositorySearchGUI::$search_type = 'usr'

Definition at line 52 of file class.ilRepositorySearchGUI.php.

Referenced by __updateResults().

◆ $searchable_check

ilRepositorySearchGUI::$searchable_check = true
protected

Definition at line 49 of file class.ilRepositorySearchGUI.php.

Referenced by isSearchableCheckEnabled().

◆ $user_filter

ilRepositorySearchGUI::$user_filter = null
protected

Definition at line 58 of file class.ilRepositorySearchGUI.php.

Referenced by addUserAccessFilterCallable().

◆ $user_limitations

ilRepositorySearchGUI::$user_limitations = true
protected

Definition at line 53 of file class.ilRepositorySearchGUI.php.

Referenced by getUserLimitations().


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