'; print htmlspecialchars($tag); print ' '; } } /** * Find all tags (markers) starting with the given * string */ function ajax_taglookup($tag){ global $conf; global $LDAP_CON; if(!$conf[extended]) return; $search = ldap_filterescape($tag); $filter = "(&(objectClass=contactPerson)(marker=$search*))"; $result = ldap_queryabooks($filter,'marker'); if(!count($result)) return; $tags = array(); foreach ($result as $entry){ if(count($entry['marker'])){ foreach($entry['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 ''; } ?>