function rdfui_datatype_autocomplete in RDF Extensions 7.2
Menu callback for datatype autocomplete
1 string reference to 'rdfui_datatype_autocomplete'
- rdfui_menu in rdfui/
rdfui.module - Implements hook_menu().
File
- rdfui/
rdfui.module, line 379
Code
function rdfui_datatype_autocomplete($string) {
//@todo Make sure datatype is only active if property is the relationship.
$datatypes = 'xsd:string, xsd:boolean, xsd:decimal, xsd:float, xsd:double, xsd:dateTime, xsd:time, xsd:date, xsd:gYearMonth, xsd:gYear, xsd:gMonthDay, xsd:gDay, xsd:gMonth, xsd:hexBinary, xsd:base64Binary, xsd:anyURI, xsd:normalizedString, xsd:token, xsd:language, xsd:NMTOKEN, xsd:Name, xsd:NCName, xsd:integer, xsd:nonPositiveInteger, xsd:negativeInteger, xsd:long, xsd:int, xsd:short, xsd:byte, xsd:nonNegativeInteger, xsd:unsignedLong, xsd:unsignedInt, xsd:unsignedShort, xsd:unsignedByte, xsd:positiveInteger';
$datatypes = explode(', ', $datatypes);
$matches = array();
foreach ($datatypes as $datatype) {
if (preg_match("/^{$string}/", $datatype)) {
$matches[$datatype] = $datatype;
}
}
drupal_json_output($matches);
}