| 491 |
return $children; |
return $children; |
| 492 |
} |
} |
| 493 |
|
|
|
function _foaf_xpath($xml, $path) { |
|
|
$parts = explode('/', $path); |
|
|
|
|
|
$value = $xml; |
|
|
foreach ($parts as $part) { |
|
|
$value = $value[$parts][0]; |
|
|
} |
|
|
|
|
|
return $value['VALUE']; |
|
|
} |
|
|
|
|
| 494 |
function _foaf_allow_export($account) { |
function _foaf_allow_export($account) { |
| 495 |
if (isset($account->foaf_export)) { |
if (isset($account->foaf_export)) { |
| 496 |
return $account->foaf_export; |
return $account->foaf_export; |
| 499 |
return variable_get('foaf_export_default', 0); |
return variable_get('foaf_export_default', 0); |
| 500 |
} |
} |
| 501 |
} |
} |
|
|
|
|
/** |
|
|
* returns an array of supported FOAF fields. |
|
|
* |
|
|
* variable name => label. |
|
|
*/ |
|
|
function _foaf_fields() { |
|
|
return array('foaf_name' => t('foaf:name'), |
|
|
'foaf_title' => t('foaf:title'), |
|
|
'foaf_firstName' => t('foaf:firstName'), |
|
|
'foaf_surname' => t('foaf:surname'), |
|
|
'foaf_Organization' => t('foaf:Organization'), |
|
|
'foaf_phone' => t('foaf:phone'), |
|
|
'foaf_aimChatID' => t('foaf:aimChatID'), |
|
|
'foaf_icqChatID' => t('foaf:icqChatID'), |
|
|
'foaf_msnChatID' => t('foaf:msnChatID'), |
|
|
'foaf_yahooChatID' => t('foaf:yahooChatID'), |
|
|
'foaf_jabberID' => t('foaf:jabberID'), |
|
|
'foaf_workplaceHomepage' => t('foaf:workplaceHomepage'), |
|
|
'foaf_street' => t('vCard:Street'), |
|
|
'foaf_locality' => t('vCard:Locality'), |
|
|
'foaf_region' => t('vCard:Region'), |
|
|
'foaf_pcode' => t('vCard:Pcode'), |
|
|
'foaf_country' => t('vCard:Country'), |
|
|
'foaf_keywords' => t('Field for bio:keywords')); |
|
|
} |
|
|
|
|
|
function _foaf_paths() { |
|
|
return array('foaf_name' => '/RDF:RDF/FOAF:PERSON/FOAF:NAME', |
|
|
'foaf_title' => '/RDF:RDF/FOAF:PERSON/FOAF:TITLE', |
|
|
'foaf_firstName' => '/RDF:RDF/FOAF:PERSON/FOAF:FIRSTNAME', |
|
|
'foaf_surname' => '/RDF:RDF/FOAF:PERSON/FOAF:SURNAME', |
|
|
'foaf_Organization' => '/RDF:RDF/FOAF:PERSON/FOAF:ORGANIZATION', |
|
|
'foaf_phone' => '/RDF:RDF/FOAF:PERSON/FOAF:PHONE', |
|
|
'foaf_aimChatID' => '/RDF:RDF/FOAF:PERSON/FOAF:AIMCHATID', |
|
|
'foaf_icqChatID' => '/RDF:RDF/FOAF:PERSON/FOAF:ICQCHATID', |
|
|
'foaf_msnChatID' => '/RDF:RDF/FOAF:PERSON/FOAF:MSNCHATID', |
|
|
'foaf_yahooChatID' => '/RDF:RDF/FOAF:PERSON/FOAF:YAHOOCHATID', |
|
|
'foaf_jabberID' => '/RDF:RDF/FOAF:PERSON/FOAF:JABBERID' |
|
|
'foaf_workplaceHomepage' => '/RDF:RDF/FOAF:PERSON/FOAF:WORKPLACEHOMEPAGE[@RDF:RESOURCE]', |
|
|
'foaf_street' => '/RDF:RDF/FOAF:PERSON/VCARD:ADR/VCARD:STREET', |
|
|
'foaf_locality' => '/RDF:RDF/FOAF:PERSON/VCARD:ADR/VCARD:LOCALITY', |
|
|
'foaf_region' => '/RDF:RDF/FOAF:PERSON/VCARD:ADR/VCARD:REGION', |
|
|
'foaf_pcode' => '/RDF:RDF/FOAF:PERSON/VCARD:ADR/VCARD:PCODE', |
|
|
'foaf_country' => '/RDF:RDF/FOAF:PERSON/VCARD:ADR/VCARD:COUNTRY', |
|
|
'foaf_keywords' => '/RDF:RDF/FOAF:PERSON/BIO:KEYWORDS'); |
|
|
} |
|
| 502 |
?> |
?> |