4 include_once
'Services/Search/classes/class.ilSearchSettings.php';
19 $a_str = str_replace(
'"',
"", $a_str);
23 $object_types = array(
'cat',
'dbk',
'crs',
'fold',
'frm',
'grp',
'lm',
'sahs',
'glo',
'mep',
'htlm',
'exc',
'file',
'qpl',
'tst',
'svy',
'spl',
24 'chat',
'icrs',
'icla',
'webr',
'mcst',
'sess',
'pg',
'st',
'gdf',
'wiki');
26 $set = $ilDB->query(
"SELECT title, obj_id FROM object_data WHERE "
27 .$ilDB->like(
'title',
'text', $a_str.
"%").
" AND "
28 .$ilDB->in(
'type', $object_types,
false,
'text').
" ORDER BY title");
29 $max = ($settings->getAutoCompleteLength() > 0)
30 ? $settings->getAutoCompleteLength()
37 while (($rec = $ilDB->fetchAssoc($set)) && $cnt < $max)
39 if (strpos($rec[
"title"],
" ") > 0 || strpos($rec[
"title"],
"-") > 0)
41 $rec[
"title"] =
'"'.$rec[
"title"].
'"';
43 if (!in_array($rec[
"title"], $list) && !in_array($rec[
"obj_id"], $checked))
47 $list[] = $lim.$rec[
"title"];
50 $checked[] = $rec[
"obj_id"];
54 $set = $ilDB->query(
"SELECT rbac_id,obj_id,obj_type, keyword FROM il_meta_keyword WHERE "
55 .$ilDB->like(
'keyword',
'text', $a_str.
"%").
" AND "
56 .$ilDB->in(
'obj_type', $object_types,
false,
'text').
" ORDER BY keyword");
57 while (($rec = $ilDB->fetchAssoc($set)) && $cnt < $max)
59 if (strpos($rec[
"keyword"],
" ") > 0)
61 $rec[
"keyword"] =
'"'.$rec[
"keyword"].
'"';
63 if (!in_array($rec[
"keyword"], $list) && !in_array($rec[
"rbac_id"], $checked))
67 $list[] = $lim.$rec[
"keyword"];
71 $checked[] = $rec[
"rbac_id"];
83 include_once
'./Services/JSON/classes/class.ilJsonUtil.php';
95 foreach ($refs as $ref)
97 if ($ilAccess->checkAccess(
"read",
"", $ref))