ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilRepositorySearchGUI Class Reference
+ Inheritance diagram for ilRepositorySearchGUI:
+ Collaboration diagram for ilRepositorySearchGUI:

Public Member Functions

 __construct ()
 Constructor 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 public. More...
 
 getString ()
 
 executeCommand ()
 Control 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 public.

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

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

71  {
72  global $ilCtrl,$tpl,$lng;
73 
74  $this->ctrl = $ilCtrl;
75  $this->tpl = $tpl;
76  $this->lng = $lng;
77  $this->lng->loadLanguageModule('search');
78  $this->lng->loadLanguageModule('crs');
79 
80  $this->setTitle($this->lng->txt('add_members_header'));
81 
82  $this->__setSearchType();
83  $this->__loadQueries();
84 
85  $this->result_obj = new ilSearchResult();
86  $this->result_obj->setMaxHits(1000000);
87  $this->settings = new ilSearchSettings();
88  }
setTitle($a_title)
Set form title.
$tpl
Definition: ilias.php:10
global $ilCtrl
Definition: ilias.php:18
settings()
Definition: settings.php:2
global $lng
Definition: privfeed.php:17
+ Here is the call graph for this function:

Member Function Documentation

◆ __appendToStoredResults()

ilRepositorySearchGUI::__appendToStoredResults (   $a_usr_ids)

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

References $_SESSION, and array.

Referenced by listUsers().

994  {
995  if (!$_SESSION['search_append']) {
996  return $_SESSION['rep_search']['usr'] = $a_usr_ids;
997  }
998  $_SESSION['rep_search']['usr'] = array();
999  foreach ($a_usr_ids as $usr_id) {
1000  $_SESSION['rep_search']['usr'][] = $usr_id;
1001  }
1002  return $_SESSION['rep_search']['usr'] ? array_unique($_SESSION['rep_search']['usr']) : array();
1003  }
$_SESSION["AccountId"]
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ __clearSession()

ilRepositorySearchGUI::__clearSession ( )

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

References $_SESSION.

Referenced by start().

384  {
385  unset($_SESSION['rep_search']);
386  unset($_SESSION['append_results']);
387  unset($_SESSION['rep_query']);
388  unset($_SESSION['rep_search_type']);
389  }
$_SESSION["AccountId"]
+ Here is the caller graph for this function:

◆ __loadQueries()

ilRepositorySearchGUI::__loadQueries ( )

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

References $_POST, and $_SESSION.

Referenced by __construct().

950  {
951  if (is_array($_POST['rep_query'])) {
952  $_SESSION['rep_query'] = $_POST['rep_query'];
953  }
954  }
$_SESSION["AccountId"]
$_POST["username"]
+ 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 public

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

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

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

930  {
931  $query_parser = new ilQueryParser(ilUtil::stripSlashes($a_string));
932  $query_parser->setCombination($a_combination_or ? QP_COMBINATION_OR : QP_COMBINATION_AND);
933  $query_parser->setMinWordLength(1);
934 
935  // #17502
936  if (!(bool) $a_ignore_length) {
937  $query_parser->setGlobalMinLength(3); // #14768
938  }
939 
940  $query_parser->parse();
941 
942  if (!$query_parser->validate()) {
943  return $query_parser->getMessage();
944  }
945  return $query_parser;
946  }
const QP_COMBINATION_OR
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
const QP_COMBINATION_AND
+ 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 883 of file class.ilRepositorySearchGUI.php.

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

Referenced by performSearch().

884  {
885  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
886 
887  $query_string = $_SESSION['rep_query']['crs']['title'];
888  if (!is_object($query_parser = $this->__parseQueryString($query_string))) {
889  ilUtil::sendInfo($query_parser, true);
890  return false;
891  }
892 
893  include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
894  $object_search = new ilLikeObjectSearch($query_parser);
895  $object_search->setFilter(array('crs'));
896  $this->__storeEntries($object_search->performSearch());
897 
898  return true;
899  }
$_SESSION["AccountId"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
& __parseQueryString($a_string, $a_combination_or=true, $a_ignore_length=false)
parse query string, using query parser instance
+ 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 861 of file class.ilRepositorySearchGUI.php.

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

Referenced by performSearch().

862  {
863  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
864 
865  $query_string = $_SESSION['rep_query']['grp']['title'];
866  if (!is_object($query_parser = $this->__parseQueryString($query_string))) {
867  ilUtil::sendInfo($query_parser, true);
868  return false;
869  }
870 
871  include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
872  $object_search = new ilLikeObjectSearch($query_parser);
873  $object_search->setFilter(array('grp'));
874  $this->__storeEntries($object_search->performSearch());
875 
876  return true;
877  }
$_SESSION["AccountId"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
& __parseQueryString($a_string, $a_combination_or=true, $a_ignore_length=false)
parse query string, using query parser instance
+ 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 905 of file class.ilRepositorySearchGUI.php.

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

Referenced by performSearch().

906  {
907  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
908 
909  $query_string = $_SESSION['rep_query']['role']['title'];
910  if (!is_object($query_parser = $this->__parseQueryString($query_string))) {
911  ilUtil::sendInfo($query_parser, true);
912  return false;
913  }
914 
915  // Perform like search
916  include_once 'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
917  $object_search = new ilLikeObjectSearch($query_parser);
918  $object_search->setFilter(array('role'));
919  $this->__storeEntries($object_search->performSearch());
920 
921  return true;
922  }
$_SESSION["AccountId"]
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Create styles array
The data for the language used.
& __parseQueryString($a_string, $a_combination_or=true, $a_ignore_length=false)
parse query string, using query parser instance
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __performUserSearch()

ilRepositorySearchGUI::__performUserSearch ( )

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

References $_SESSION, $info, $name, __parseQueryString(), __storeEntries(), ilUserSearchOptions\_getSearchableFieldsInfo(), ilObjectSearchFactory\_getUserDefinedFieldSearchInstance(), ilObjectSearchFactory\_getUserSearchInstance(), array, 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().

792  {
793  include_once 'Services/Search/classes/class.ilUserSearchOptions.php';
794  include_once 'Services/Search/classes/class.ilObjectSearchFactory.php';
795 
797  $name = $info['db'];
798  $query_string = $_SESSION['rep_query']['usr'][$name];
799 
800  // continue if no query string is given
801  if (!$query_string) {
802  continue;
803  }
804 
805  if (!is_object($query_parser = $this->__parseQueryString($query_string, true, ($info['type'] == FIELD_TYPE_SELECT)))) {
806  ilUtil::sendInfo($query_parser);
807  return false;
808  }
809  switch ($info['type']) {
811  // Do a phrase query for select fields
812  $query_parser = $this->__parseQueryString('"' . $query_string . '"');
813 
814  // no break
815  case FIELD_TYPE_UDF_TEXT:
817  $udf_search->setFields(array($name));
818  $result_obj = $udf_search->performSearch();
819 
820  // Store entries
821  $this->__storeEntries($result_obj);
822  break;
823 
824  case FIELD_TYPE_SELECT:
825 
826  if ($info['db'] == 'org_units') {
827  $user_search = ilObjectSearchFactory::getUserOrgUnitAssignmentInstance($query_parser);
828  $result_obj = $user_search->performSearch();
829  $this->__storeEntries($result_obj);
830  break;
831  }
832 
833  // Do a phrase query for select fields
834  $query_parser = $this->__parseQueryString('"' . $query_string . '"', true, true);
835 
836  // no break
837  case FIELD_TYPE_TEXT:
838  $user_search =&ilObjectSearchFactory::_getUserSearchInstance($query_parser);
839  $user_search->setFields(array($name));
840  $result_obj = $user_search->performSearch();
841 
842  // store entries
843  $this->__storeEntries($result_obj);
844  break;
845 
846  case FIELD_TYPE_MULTI:
847  $multi_search = ilObjectSearchFactory::getUserMultiFieldSearchInstance($query_parser);
848  $multi_search->setFields(array($name));
849  $result_obj = $multi_search->performSearch();
850  $this->__storeEntries($result_obj);
851  break;
852 
853  }
854  }
855  }
$_SESSION["AccountId"]
const FIELD_TYPE_MULTI
const FIELD_TYPE_UDF_TEXT
const FIELD_TYPE_SELECT
static getUserMultiFieldSearchInstance($query_parser)
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
if($format !==null) $name
Definition: metadata.php:146
static _getUserSearchInstance($query_parser)
get reference of ilLikeUserSearch
const FIELD_TYPE_UDF_SELECT
Class ilUserSearchOptions.
Create styles array
The data for the language used.
& __parseQueryString($a_string, $a_combination_or=true, $a_ignore_length=false)
parse query string, using query parser instance
const FIELD_TYPE_TEXT
$info
Definition: index.php:5
static getUserOrgUnitAssignmentInstance($query_parser)
get orgunit search instance
static _getUserDefinedFieldSearchInstance($query_parser)
get reference of ilLikeUserDefinedFieldSearch
static _getSearchableFieldsInfo($a_admin=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ __setSearchType()

ilRepositorySearchGUI::__setSearchType ( )

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

References $_POST, and $_SESSION.

Referenced by __construct().

958  {
959  // Update search type. Default to user search
960  if ($_POST['search_for']) {
961  #echo 1;
962  $_SESSION['rep_search_type'] = $_POST['search_for'];
963  }
964  if (!$_POST['search_for'] and !$_SESSION['rep_search_type']) {
965  #echo 2;
966  $_SESSION['rep_search_type'] = 'usr';
967  }
968 
969  $this->search_type = $_SESSION['rep_search_type'];
970  #echo $this->search_type;
971 
972  return true;
973  }
$_SESSION["AccountId"]
$_POST["username"]
+ Here is the caller graph for this function:

◆ __storeEntries()

ilRepositorySearchGUI::__storeEntries ( $new_res)

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

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

1006  {
1007  if ($this->stored == false) {
1008  $this->result_obj->mergeEntries($new_res);
1009  $this->stored = true;
1010  return true;
1011  } else {
1012  $this->result_obj->intersectEntries($new_res);
1013  return true;
1014  }
1015  }
+ Here is the caller graph for this function:

◆ __updateResults()

ilRepositorySearchGUI::__updateResults ( )

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

References $_SESSION, $result, $search_type, and array.

Referenced by performSearch().

977  {
978  if (!$_SESSION['search_append']) {
979  $_SESSION['rep_search'] = array();
980  }
981  foreach ($this->search_results as $result) {
982  $_SESSION['rep_search'][$this->search_type][] = $result;
983  }
984  if (!$_SESSION['rep_search'][$this->search_type]) {
985  $_SESSION['rep_search'][$this->search_type] = array();
986  } else {
987  // remove duplicate entries
988  $_SESSION['rep_search'][$this->search_type] = array_unique($_SESSION['rep_search'][$this->search_type]);
989  }
990  return true;
991  }
$_SESSION["AccountId"]
$result
Create styles array
The data for the language used.
+ Here is the caller graph for this function:

◆ addFromClipboard()

ilRepositorySearchGUI::addFromClipboard ( )
protected

add users from clipboard

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

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

467  {
468  $GLOBALS['ilCtrl']->setParameter($this, 'user_type', (int) $_REQUEST['user_type']);
469  $users = (array) $_POST['uids'];
470  if (!count($users)) {
471  ilUtil::sendFailure($this->lng->txt('select_one'), true);
472  $GLOBALS['ilCtrl']->redirect($this, 'showClipboard');
473  }
474  $class = $this->callback['class'];
475  $method = $this->callback['method'];
476  $user_type = isset($_REQUEST['user_type']) ? $_REQUEST['user_type'] : 0;
477 
478  if (!$class->$method($users, $user_type)) {
479  $GLOBALS['ilCtrl']->returnToParent($this);
480  }
481  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
$users
Definition: authpage.php:44
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ addNewSearchButton()

ilRepositorySearchGUI::addNewSearchButton ( )
protected

Add new search button.

Returns

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

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

1022  {
1023  include_once './Services/UIComponent/Toolbar/classes/class.ilToolbarGUI.php';
1024  $toolbar = new ilToolbarGUI();
1025  $toolbar->addButton(
1026  $this->lng->txt('search_new'),
1027  $this->ctrl->getLinkTarget($this, 'showSearch')
1028  );
1029  $this->tpl->setVariable('ACTION_BUTTONS', $toolbar->getHTML());
1030  }
+ Here is the caller graph for this function:

◆ addUser()

ilRepositorySearchGUI::addUser ( )

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

References $_POST, array, and showSearchResults().

407  {
408  $class = $this->callback['class'];
409  $method = $this->callback['method'];
410 
411  // call callback if that function does give a return value => show error message
412  // listener redirects if everything is ok.
413  $class->$method((array) $_POST['user']);
414 
415  $this->showSearchResults();
416  }
Create styles array
The data for the language used.
$_POST["username"]
+ 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 99 of file class.ilRepositorySearchGUI.php.

References $user_filter.

100  {
101  $this->user_filter = $user_filter;
102  }

◆ addUserFromAutoComplete()

ilRepositorySearchGUI::addUserFromAutoComplete ( )
protected

Add user from auto complete input.

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

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

422  {
423  $class = $this->callback['class'];
424  $method = $this->callback['method'];
425 
426  $users = explode(',', $_POST['user_login']);
427  $user_ids = array();
428  foreach ($users as $user) {
429  $user_id = ilObjUser::_lookupId($user);
430  if ($user_id) {
431  $user_ids[] = $user_id;
432  }
433  }
434 
435  $user_type = isset($_REQUEST['user_type']) ? $_REQUEST['user_type'] : 0;
436 
437  if (!$class->$method($user_ids, $user_type)) {
438  $GLOBALS['ilCtrl']->returnToParent($this);
439  }
440  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static _lookupId($a_user_str)
Lookup id by login.
Create styles array
The data for the language used.
$users
Definition: authpage.php:44
$_POST["username"]
+ 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 1244 of file class.ilRepositorySearchGUI.php.

1245  {
1246  $this->object_selection = (bool) $a_value;
1247  }

◆ appendSearch()

ilRepositorySearchGUI::appendSearch ( )

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

References $_SESSION, and performSearch().

695  {
696  $_SESSION['search_append'] = true;
697  $this->performSearch();
698  }
$_SESSION["AccountId"]
+ Here is the call graph for this function:

◆ cancel()

ilRepositorySearchGUI::cancel ( )

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

392  {
393  $this->ctrl->returnToParent($this);
394  }

◆ doUserAutoComplete()

ilRepositorySearchGUI::doUserAutoComplete ( )
protected

Do auto completion.

Returns
void

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

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

310  {
311  // hide anonymout request
312  if ($GLOBALS['ilUser']->getId() == ANONYMOUS_USER_ID) {
313  include_once './Services/JSON/classes/class.ilJsonUtil.php';
314  return ilJsonUtil::encode(new stdClass());
315  exit;
316  }
317 
318 
319  if (!isset($_GET['autoCompleteField'])) {
320  $a_fields = array('login','firstname','lastname','email');
321  $result_field = 'login';
322  } else {
323  $a_fields = array((string) $_GET['autoCompleteField']);
324  $result_field = (string) $_GET['autoCompleteField'];
325  }
326 
327  include_once './Services/User/classes/class.ilUserAutoComplete.php';
328  $auto = new ilUserAutoComplete();
329  $auto->setPrivacyMode($this->getPrivacyMode());
330 
331  if (($_REQUEST['fetchall'])) {
332  $auto->setLimit(ilUserAutoComplete::MAX_ENTRIES);
333  }
334 
335  $auto->setMoreLinkAvailable(true);
336  $auto->setSearchFields($a_fields);
337  $auto->setResultField($result_field);
338  $auto->enableFieldSearchableCheck(true);
339  $auto->setUserLimitations($this->getUserLimitations());
340 
341  echo $auto->getList($_REQUEST['term']);
342  exit();
343  }
Add rich text string
$_GET["client_id"]
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Auto completion class for user lists.
static encode($mixed, $suppress_native=false)
getUserLimitations()
allow user limitations like inactive and access limitations
Create styles array
The data for the language used.
+ Here is the call graph for this function:

◆ emptyClipboard()

ilRepositorySearchGUI::emptyClipboard ( )
protected

Remove from clipboard.

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

References $GLOBALS, ilUserClipboard\getInstance(), and ilUtil\sendSuccess().

508  {
509  include_once './Services/User/classes/class.ilUserClipboard.php';
510  $clip = ilUserClipboard::getInstance($GLOBALS['ilUser']->getId());
511  $clip->clear();
512  $clip->save();
513 
514  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
515  $this->ctrl->returnToParent($this);
516  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getInstance($a_usr_id)
Get singelton instance.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
+ 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 126 of file class.ilRepositorySearchGUI.php.

127  {
128  $this->searchable_check = $a_status;
129  }

◆ executeCommand()

ilRepositorySearchGUI::executeCommand ( )

Control public.

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

364  {
365  global $rbacsystem;
366 
367  $next_class = $this->ctrl->getNextClass($this);
368  $cmd = $this->ctrl->getCmd();
369 
370  $this->ctrl->setReturn($this, '');
371 
372  switch ($next_class) {
373  default:
374  if (!$cmd) {
375  $cmd = "showSearch";
376  }
377  $this->$cmd();
378  break;
379  }
380  return true;
381  }

◆ 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

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

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

Referenced by ilOrgUnitStaffGUI\addOtherRolesToolbar(), ilOrgUnitStaffGUI\addStaffToolbar(), ilObjBlogGUI\contributors(), ilForumModeratorsGUI\detachModeratorRole(), ilSurveyParticipantsGUI\editRatersObject(), ilOrgUnitUserAssignmentGUI\index(), ilSurveyParticipantsGUI\inviteObject(), ilSurveyParticipantsGUI\listAppraiseesObject(), ilExerciseManagementGUI\membersObject(), ilObjTestGUI\participantsObject(), ilMembershipGUI\showParticipantsToolbar(), ilSkillProfileGUI\showUsers(), ilExSubmissionTeamGUI\submissionScreenTeamObject(), ilObjRoleGUI\userassignmentObject(), and ilIndividualAssessmentMembersGUI\view().

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

◆ getPrivacyMode()

ilRepositorySearchGUI::getPrivacyMode ( )
Returns
int

Definition at line 151 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 354 of file class.ilRepositorySearchGUI.php.

355  {
356  return $this->string;
357  }

◆ getTitle()

ilRepositorySearchGUI::getTitle ( )

Get search form title.

Returns
string

Definition at line 117 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 1283 of file class.ilRepositorySearchGUI.php.

References $user_limitations.

Referenced by doUserAutoComplete(), and showSearchUserTable().

1284  {
1285  return $this->user_limitations;
1286  }
+ Here is the caller graph for this function:

◆ handleMultiCommand()

ilRepositorySearchGUI::handleMultiCommand ( )
protected

Handle multi command.

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

References $_POST, array, and showSearchResults().

522  {
523  $class = $this->callback['class'];
524  $method = $this->callback['method'];
525 
526  // Redirects if everything is ok
527  if (!$class->$method((array) $_POST['user'], $_POST['selectedCommand'])) {
528  $this->showSearchResults();
529  }
530  }
Create styles array
The data for the language used.
$_POST["username"]
+ Here is the call graph for this function:

◆ initFormSearch()

ilRepositorySearchGUI::initFormSearch ( ilObjUser  $user = null)

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

References $ilCtrl, $info, $txt, $users, ilUserSearchOptions\_getSearchableFieldsInfo(), ilRadioOption\addSubItem(), FIELD_TYPE_MULTI, FIELD_TYPE_SELECT, FIELD_TYPE_TEXT, FIELD_TYPE_UDF_SELECT, FIELD_TYPE_UDF_TEXT, getTitle(), isSearchableCheckEnabled(), and ilRadioGroupInputGUI\setValue().

Referenced by showSearch().

576  {
577  global $ilCtrl;
578 
579  include_once './Services/Form/classes/class.ilPropertyFormGUI.php';
580 
581  $this->form = new ilPropertyFormGUI();
582  $this->form->setFormAction($this->ctrl->getFormAction($this, 'search'));
583  $this->form->setTitle($this->getTitle());
584  $this->form->addCommandButton('performSearch', $this->lng->txt('search'));
585  $this->form->addCommandButton('cancel', $this->lng->txt('cancel'));
586 
587 
588  $kind = new ilRadioGroupInputGUI($this->lng->txt('search_type'), 'search_for');
589  $kind->setValue($this->search_type);
590  $this->form->addItem($kind);
591 
592  // Users
593  $users = new ilRadioOption($this->lng->txt('search_for_users'), 'usr');
594 
595  // UDF
596  include_once 'Services/Search/classes/class.ilUserSearchOptions.php';
598  switch ($info['type']) {
600  case FIELD_TYPE_SELECT:
601 
602  $sel = new ilSelectInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
603  $sel->setOptions($info['values']);
604  $users->addSubItem($sel);
605  break;
606 
607  case FIELD_TYPE_MULTI:
608  case FIELD_TYPE_UDF_TEXT:
609  case FIELD_TYPE_TEXT:
610 
611  if (isset($info['autoComplete']) and $info['autoComplete']) {
612  $ilCtrl->setParameterByClass(get_class($this), 'autoCompleteField', $info['db']);
613  $ul = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
614  $ul->setDataSourceSubmitOnSelection(true);
615  $ul->setDataSourceSubmitUrl(
616  $this->ctrl->getLinkTarget(
617  $this,
618  'showSearchSelected',
619  '',
620  false,
621  false
622  )
623  );
624  $ul->setDataSource($ilCtrl->getLinkTarget(
625  $this,
626  "doUserAutoComplete",
627  "",
628  true
629  ));
630  $ul->setSize(30);
631  $ul->setMaxLength(120);
632 
633  if ($user instanceof ilObjUser) {
634  switch ($info['db']) {
635  case 'firstname':
636  $ul->setValue($user->getFirstname());
637  break;
638  case 'lastname':
639  $ul->setValue($user->getLastname());
640  break;
641  case 'login':
642  $ul->setValue($user->getLogin());
643  break;
644  }
645  }
646 
647 
648 
649  $users->addSubItem($ul);
650  } else {
651  $txt = new ilTextInputGUI($info['lang'], "rep_query[usr][" . $info['db'] . "]");
652  $txt->setSize(30);
653  $txt->setMaxLength(120);
654  $users->addSubItem($txt);
655  }
656  break;
657  }
658  }
659  $kind->addOption($users);
660 
661 
662 
663  // Role
664  $roles = new ilRadioOption($this->lng->txt('search_for_role_members'), 'role');
665  $role = new ilTextInputGUI($this->lng->txt('search_role_title'), 'rep_query[role][title]');
666  $role->setSize(30);
667  $role->setMaxLength(120);
668  $roles->addSubItem($role);
669  $kind->addOption($roles);
670 
671  // Course
672  $groups = new ilRadioOption($this->lng->txt('search_for_crs_members'), 'crs');
673  $group = new ilTextInputGUI($this->lng->txt('search_crs_title'), 'rep_query[crs][title]');
674  $group->setSize(30);
675  $group->setMaxLength(120);
676  $groups->addSubItem($group);
677  $kind->addOption($groups);
678 
679  // Group
680  $groups = new ilRadioOption($this->lng->txt('search_for_grp_members'), 'grp');
681  $group = new ilTextInputGUI($this->lng->txt('search_grp_title'), 'rep_query[grp][title]');
682  $group->setSize(30);
683  $group->setMaxLength(120);
684  $groups->addSubItem($group);
685  $kind->addOption($groups);
686  }
This class represents an option in a radio group.
getLogin()
get login / username public
This class represents a selection list property in a property form.
This class represents a property form user interface.
getFirstname()
get firstname public
const FIELD_TYPE_MULTI
const FIELD_TYPE_UDF_TEXT
const FIELD_TYPE_SELECT
global $ilCtrl
Definition: ilias.php:18
This class represents a property in a property form.
getLastname()
get lastname public
addSubItem($a_item)
Add Subitem.
This class represents a text property in a property form.
getTitle()
Get search form title.
const FIELD_TYPE_UDF_SELECT
Class ilUserSearchOptions.
$txt
Definition: error.php:11
$users
Definition: authpage.php:44
const FIELD_TYPE_TEXT
$info
Definition: index.php:5
static _getSearchableFieldsInfo($a_admin=false)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ isSearchableCheckEnabled()

ilRepositorySearchGUI::isSearchableCheckEnabled ( )
Returns
bool

Definition at line 135 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 1140 of file class.ilRepositorySearchGUI.php.

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

Referenced by storedUserList().

1141  {
1142  // get parameter is used e.g. in exercises to provide
1143  // "add members of course" link
1144  if ($_GET["list_obj"] != "" && !is_array($_POST['obj'])) {
1145  $_POST['obj'][0] = $_GET["list_obj"];
1146  }
1147  if (!is_array($_POST['obj']) or !$_POST['obj']) {
1148  ilUtil::sendFailure($this->lng->txt('select_one'));
1149  $this->showSearchResults();
1150  return false;
1151  }
1152 
1153  $_SESSION['rep_search']['objs'] = $_POST['obj'];
1154 
1155  // Get all members
1156  $members = array();
1157  foreach ($_POST['obj'] as $obj_id) {
1158  $type = ilObject::_lookupType($obj_id);
1159  switch ($type) {
1160  case 'crs':
1161  case 'grp':
1162 
1163  include_once './Services/Membership/classes/class.ilParticipants.php';
1165  $part = [];
1166  if (is_callable($this->user_filter)) {
1167  $part = call_user_func_array(
1168  $this->user_filter,
1169  [
1170  ilParticipants::getInstanceByObjId($obj_id)->getParticipants()
1171  ]
1172  );
1173  } else {
1174  $part = ilParticipants::getInstanceByObjId($obj_id)->getParticipants();
1175  }
1176 
1177  $members = array_merge((array) $members, $part);
1178  }
1179  break;
1180 
1181  case 'role':
1182  global $rbacreview;
1183 
1184  $assigned = [];
1185  if (is_callable($this->user_filter)) {
1186  $assigned = call_user_func_array(
1187  $this->user_filter,
1188  [
1189  $rbacreview->assignedUsers($obj_id)
1190  ]
1191  );
1192  } else {
1193  $assigned = $rbacreview->assignedUsers($obj_id);
1194  }
1195 
1196  $members = array_merge($members, ilUserFilter::getInstance()->filter($assigned));
1197  break;
1198  }
1199  }
1200  $members = array_unique((array) $members);
1201  $this->__appendToStoredResults($members);
1202 
1203  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.rep_search_result.html', 'Services/Search');
1204 
1205  $this->addNewSearchButton();
1206  $this->showSearchUserTable($_SESSION['rep_search']['usr'], 'storedUserList');
1207  return true;
1208  }
$_SESSION["AccountId"]
$type
$_GET["client_id"]
addNewSearchButton()
Add new search button.
static getInstance()
Singelton get instance.
static hasParticipantListAccess($a_obj_id, $a_usr_id=null)
Check if (current) user has access to the participant list.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
showSearchUserTable($a_usr_ids, $a_parent_cmd)
Show usr table.
$_POST["username"]
static getInstanceByObjId($a_obj_id)
Get instance by obj type.
+ 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 704 of file class.ilRepositorySearchGUI.php.

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

Referenced by appendSearch().

705  {
706  // only autocomplete input field, no search form if user privay should be respected
707  // see bug 25481
709  return "";
710  }
711  $found_query = false;
712  foreach ((array) $_POST['rep_query'][$_POST['search_for']] as $field => $value) {
713  if (trim(ilUtil::stripSlashes($value))) {
714  $found_query = true;
715  break;
716  }
717  }
718  if (!$found_query) {
719  ilUtil::sendFailure($this->lng->txt('msg_no_search_string'));
720  $this->start();
721  return false;
722  }
723 
724  // unset search_append if called directly
725  if ($_POST['cmd']['performSearch']) {
726  unset($_SESSION['search_append']);
727  }
728 
729  switch ($this->search_type) {
730  case 'usr':
731  $this->__performUserSearch();
732  break;
733 
734  case 'grp':
735  $this->__performGroupSearch();
736  break;
737 
738  case 'crs':
739  $this->__performCourseSearch();
740  break;
741 
742  case 'role':
743  $this->__performRoleSearch();
744  break;
745 
746  default:
747  echo 'not defined';
748  }
749 
750  $this->result_obj->setRequiredPermission('read');
751  $this->result_obj->addObserver($this, 'searchResultFilterListener');
752  $this->result_obj->filter(ROOT_FOLDER_ID, QP_COMBINATION_OR);
753 
754  // User access filter
755  if ($this->search_type == 'usr') {
756  $callable_name = '';
757  if (is_callable($this->user_filter, true, $callable_name)) {
758  $result_ids = call_user_func_array($this->user_filter, [$this->result_obj->getResultIds()]);
759  } else {
760  $result_ids = $this->result_obj->getResultIds();
761  }
762 
763  include_once './Services/User/classes/class.ilUserFilter.php';
764  $this->search_results = array_intersect(
765  $result_ids,
766  ilUserFilter::getInstance()->filter($result_ids)
767  );
768  } else {
769  $this->search_results = array();
770  foreach ((array) $this->result_obj->getResults() as $res) {
771  $this->search_results[] = $res['obj_id'];
772  }
773  }
774 
775  if (!count($this->search_results)) {
776  ilUtil::sendFailure($this->lng->txt('search_no_match'));
777  $this->showSearch();
778  return true;
779  }
780  $this->__updateResults();
781  if ($this->result_obj->isLimitReached()) {
782  $message = sprintf($this->lng->txt('search_limit_reached'), $this->settings->getMaxHits());
784  return true;
785  }
786  // show results
787  $this->show();
788  return true;
789  }
$_SESSION["AccountId"]
static getInstance()
Singelton get instance.
const QP_COMBINATION_OR
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
catch(Exception $e) $message
foreach($_POST as $key=> $value) $res
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
settings()
Definition: settings.php:2
$_POST["username"]
+ 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 486 of file class.ilRepositorySearchGUI.php.

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

487  {
488  $GLOBALS['ilCtrl']->setParameter($this, 'user_type', (int) $_REQUEST['user_type']);
489  $users = (array) $_POST['uids'];
490  if (!count($users)) {
491  ilUtil::sendFailure($this->lng->txt('select_one'), true);
492  $GLOBALS['ilCtrl']->redirect($this, 'showClipboard');
493  }
494 
495  include_once './Services/User/classes/class.ilUserClipboard.php';
496  $clip = ilUserClipboard::getInstance($GLOBALS['ilUser']->getId());
497  $clip->delete($users);
498  $clip->save();
499 
500  ilUtil::sendSuccess($this->lng->txt('settings_saved'), true);
501  $this->ctrl->redirect($this, 'showClipboard');
502  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getInstance($a_usr_id)
Get singelton instance.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Create styles array
The data for the language used.
$users
Definition: authpage.php:44
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ 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 1229 of file class.ilRepositorySearchGUI.php.

1230  {
1231  if ($a_data['type'] == 'usr') {
1232  if ($a_data['obj_id'] == ANONYMOUS_USER_ID) {
1233  return false;
1234  }
1235  }
1236  return true;
1237  }

◆ selectObject()

ilRepositorySearchGUI::selectObject ( )
protected

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

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

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

1253  {
1254  // get parameter is used e.g. in exercises to provide
1255  // "add members of course" link
1256  if ($_GET["list_obj"] != "" && !is_array($_POST['obj'])) {
1257  $_POST['obj'][0] = $_GET["list_obj"];
1258  }
1259  if (!is_array($_POST['obj']) or !$_POST['obj']) {
1260  ilUtil::sendFailure($this->lng->txt('select_one'));
1261  $this->showSearchResults();
1262  return false;
1263  }
1264 
1265  $this->ctrl->setParameter($this->callback["class"], "obj", implode(";", $_POST["obj"]));
1266  $this->ctrl->redirect($this->callback["class"], $this->callback["method"]);
1267  }
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ setCallback()

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

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

References array.

533  {
534  $this->callback = array('class' => $class,'method' => $method);
535  $this->add_options = $a_add_options ? $a_add_options : array();
536  }
Create styles array
The data for the language used.

◆ setPermissionQueryCallback()

ilRepositorySearchGUI::setPermissionQueryCallback (   $class,
  $method 
)

Set callback method for user permission access queries.

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

542  {
543  }

◆ setPrivacyMode()

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

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

References $privacy_mode.

144  {
145  $this->privacy_mode = $privacy_mode;
146  }

◆ setString()

ilRepositorySearchGUI::setString (   $a_str)

Set/get search string public.

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

References $_SESSION.

351  {
352  $_SESSION['search']['string'] = $this->string = $a_str;
353  }
$_SESSION["AccountId"]

◆ setTitle()

ilRepositorySearchGUI::setTitle (   $a_title)

Set form title.

Parameters
string$a_title

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

Referenced by __construct().

109  {
110  $this->search_title = $a_title;
111  }
+ 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 1274 of file class.ilRepositorySearchGUI.php.

1275  {
1276  $this->user_limitations = (bool) $a_limitations;
1277  }

◆ show()

ilRepositorySearchGUI::show ( )

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

References showSearchResults().

Referenced by performSearch().

690  {
691  $this->showSearchResults();
692  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showClipboard()

ilRepositorySearchGUI::showClipboard ( )
protected

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

References $GLOBALS, and ilLoggerFactory\getLogger().

443  {
444  $GLOBALS['ilCtrl']->setParameter($this, 'user_type', (int) $_REQUEST['user_type']);
445 
446  ilLoggerFactory::getLogger('crs')->dump($_REQUEST);
447 
448  $GLOBALS['ilTabs']->clearTargets();
449  $GLOBALS['ilTabs']->setBackTarget(
450  $GLOBALS['lng']->txt('back'),
451  $GLOBALS['ilCtrl']->getParentReturn($this)
452  );
453 
454  include_once './Services/User/classes/class.ilUserClipboardTableGUI.php';
455  $clip = new ilUserClipboardTableGUI($this, 'showClipboard', $GLOBALS['ilUser']->getId());
456  $clip->setFormAction($GLOBALS['ilCtrl']->getFormAction($this));
457  $clip->init();
458  $clip->parse();
459 
460  $GLOBALS['tpl']->setContent($clip->getHTML());
461  }
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
Show administrate clipboard content.
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

◆ showSearch()

ilRepositorySearchGUI::showSearch ( )

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

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

Referenced by performSearch(), and start().

546  {
547  // only autocomplete input field, no search form if user privay should be respected
548  // see bug 25481
550  return;
551  }
552  $this->initFormSearch();
553  $this->tpl->setContent($this->form->getHTML());
554  }
initFormSearch(ilObjUser $user=null)
+ 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 1126 of file class.ilRepositorySearchGUI.php.

References $table.

Referenced by showSearchResults().

1127  {
1128  include_once './Services/Search/classes/class.ilRepositoryObjectResultTableGUI.php';
1129 
1130  $table = new ilRepositoryObjectResultTableGUI($this, 'showSearchResults', $this->object_selection);
1131  $table->parseObjectIds($a_obj_ids);
1132 
1133  $this->tpl->setVariable('RES_TABLE', $table->getHTML());
1134  }
TableGUI class object (course,group and role) search results Used in member search.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the caller graph for this function:

◆ showSearchGroupTable()

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

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

References $table.

Referenced by showSearchResults().

1112  {
1113  include_once './Services/Search/classes/class.ilRepositoryObjectResultTableGUI.php';
1114 
1115  $table = new ilRepositoryObjectResultTableGUI($this, 'showSearchResults', $this->object_selection);
1116  $table->parseObjectIds($a_obj_ids);
1117 
1118  $this->tpl->setVariable('RES_TABLE', $table->getHTML());
1119  }
TableGUI class object (course,group and role) search results Used in member search.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the caller graph for this function:

◆ showSearchResults()

ilRepositorySearchGUI::showSearchResults ( )

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

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

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

1033  {
1034  $counter = 0;
1035  $f_result = array();
1036 
1037  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.rep_search_result.html', 'Services/Search');
1038  $this->addNewSearchButton();
1039 
1040  switch ($this->search_type) {
1041  case "usr":
1042  $this->showSearchUserTable($_SESSION['rep_search']['usr'], 'showSearchResults');
1043  break;
1044 
1045  case 'grp':
1046  $this->showSearchGroupTable($_SESSION['rep_search']['grp']);
1047  break;
1048 
1049  case 'crs':
1050  $this->showSearchCourseTable($_SESSION['rep_search']['crs']);
1051  break;
1052 
1053  case 'role':
1054  $this->showSearchRoleTable($_SESSION['rep_search']['role']);
1055  break;
1056  }
1057  }
$_SESSION["AccountId"]
addNewSearchButton()
Add new search button.
showSearchRoleTable($a_obj_ids)
Show usr table.
$counter
Create styles array
The data for the language used.
showSearchUserTable($a_usr_ids, $a_parent_cmd)
Show usr table.
+ 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 1096 of file class.ilRepositorySearchGUI.php.

References $table.

Referenced by showSearchResults().

1097  {
1098  include_once './Services/Search/classes/class.ilRepositoryObjectResultTableGUI.php';
1099 
1100  $table = new ilRepositoryObjectResultTableGUI($this, 'showSearchResults', $this->object_selection);
1101  $table->parseObjectIds($a_obj_ids);
1102 
1103  $this->tpl->setVariable('RES_TABLE', $table->getHTML());
1104  }
TableGUI class object (course,group and role) search results Used in member search.
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the caller graph for this function:

◆ showSearchSelected()

ilRepositorySearchGUI::showSearchSelected ( )

submit from autocomplete

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

References addNewSearchButton(), array, and showSearchUserTable().

560  {
561  $selected = (int) $_REQUEST['selected_id'];
562 
563  #include_once './Services/Object/classes/class.ilObjectFactory.php';
564  #$factory = new ilObjectFactory();
565  #$user = $factory->getInstanceByObjId($selected);
566 
567  #$this->initFormSearch($user);
568  #$this->tpl->setContent($this->form->getHTML());
569 
570  $this->tpl->addBlockFile('ADM_CONTENT', 'adm_content', 'tpl.rep_search_result.html', 'Services/Search');
571  $this->addNewSearchButton();
572  $this->showSearchUserTable(array($selected), 'showSearchResults');
573  }
addNewSearchButton()
Add new search button.
Create styles array
The data for the language used.
showSearchUserTable($a_usr_ids, $a_parent_cmd)
Show usr table.
+ 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 1064 of file class.ilRepositorySearchGUI.php.

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

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

1065  {
1066  $is_in_admin = ($_REQUEST['baseClass'] == 'ilAdministrationGUI');
1067  if ($is_in_admin) {
1068  // remember link target to admin search gui (this)
1069  $_SESSION["usr_search_link"] = $this->ctrl->getLinkTarget($this, 'show');
1070  }
1071 
1072  include_once './Services/Search/classes/class.ilRepositoryUserResultTableGUI.php';
1073 
1074  $table = new ilRepositoryUserResultTableGUI($this, $a_parent_cmd, $is_in_admin);
1075  if (count($this->add_options)) {
1076  $table->addMultiItemSelectionButton(
1077  'selectedCommand',
1078  $this->add_options,
1079  'handleMultiCommand',
1080  $this->lng->txt('execute')
1081  );
1082  } else {
1083  $table->addMultiCommand('addUser', $this->lng->txt('btn_add'));
1084  }
1085  $table->setUserLimitations($this->getUserLimitations());
1086  $table->parseUserIds($a_usr_ids);
1087 
1088  $this->tpl->setVariable('RES_TABLE', $table->getHTML());
1089  }
$_SESSION["AccountId"]
getUserLimitations()
allow user limitations like inactive and access limitations
if(empty($password)) $table
Definition: pwgen.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ start()

ilRepositorySearchGUI::start ( )

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

References __clearSession(), and showSearch().

Referenced by performSearch().

397  {
398  // delete all session info
399  $this->__clearSession();
400  $this->showSearch();
401 
402  return true;
403  }
+ 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 1214 of file class.ilRepositorySearchGUI.php.

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

1215  {
1216  $_POST['obj'] = $_SESSION['rep_search']['objs'];
1217  $this->listUsers();
1218  return true;
1219  }
$_SESSION["AccountId"]
listUsers()
List users of course/group/roles.
$_POST["username"]
+ 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: