'; print htmlspecialchars($tag); print ' '; } } /** * Find all tags (markers) starting with the given * string */ function ajax_taglookup($tag){ global $conf; global $LDAP_CON; if(!$FIELDS['_marker']) return; $search = ldap_filterescape($tag); $filter = "(&(objectClass=inetOrgPerson)('.$FIELDS['_marker'].'=$search*))"; $result = ldap_queryabooks($filter,$FIELDS['_marker']); if(!count($result)) return; $tags = array(); foreach ($result as $entry){ if(count($entry[$FIELDS['_marker']])){ foreach($entry[$FIELDS['_marker']] as $marker){ if(preg_match('/^'.preg_quote($tag,'/').'/i',$marker)){ array_push($tags, strtolower($marker)); } } } } $tags = array_unique($tags); sort($tags,SORT_STRING); print ''; } ?>