| 1 |
<?php |
<?php |
| 2 |
// $Id: foaf.module,v 1.10 2005/08/18 03:16:57 walkah Exp $ |
// $Id: foaf.module,v 1.11 2005/11/29 18:23:01 walkah Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* Implements hook_help |
* Implements hook_help |
| 491 |
return $children; |
return $children; |
| 492 |
} |
} |
| 493 |
|
|
| 494 |
|
function _foaf_xpath($xml, $path) { |
| 495 |
|
$parts = explode('/', $path); |
| 496 |
|
|
| 497 |
|
$value = $xml; |
| 498 |
|
foreach ($parts as $part) { |
| 499 |
|
$value = $value[$parts][0]; |
| 500 |
|
} |
| 501 |
|
|
| 502 |
|
return $value['VALUE']; |
| 503 |
|
} |
| 504 |
|
|
| 505 |
function _foaf_allow_export($account) { |
function _foaf_allow_export($account) { |
| 506 |
if (isset($account->foaf_export)) { |
if (isset($account->foaf_export)) { |
| 507 |
return $account->foaf_export; |
return $account->foaf_export; |
| 510 |
return variable_get('foaf_export_default', 0); |
return variable_get('foaf_export_default', 0); |
| 511 |
} |
} |
| 512 |
} |
} |
| 513 |
|
|
| 514 |
|
/** |
| 515 |
|
* returns an array of supported FOAF fields. |
| 516 |
|
* |
| 517 |
|
* variable name => label. |
| 518 |
|
*/ |
| 519 |
|
function _foaf_fields() { |
| 520 |
|
return array('foaf_name' => t('foaf:name'), |
| 521 |
|
'foaf_title' => t('foaf:title'), |
| 522 |
|
'foaf_firstName' => t('foaf:firstName'), |
| 523 |
|
'foaf_surname' => t('foaf:surname'), |
| 524 |
|
'foaf_Organization' => t('foaf:Organization'), |
| 525 |
|
'foaf_phone' => t('foaf:phone'), |
| 526 |
|
'foaf_aimChatID' => t('foaf:aimChatID'), |
| 527 |
|
'foaf_icqChatID' => t('foaf:icqChatID'), |
| 528 |
|
'foaf_msnChatID' => t('foaf:msnChatID'), |
| 529 |
|
'foaf_yahooChatID' => t('foaf:yahooChatID'), |
| 530 |
|
'foaf_jabberID' => t('foaf:jabberID'), |
| 531 |
|
'foaf_workplaceHomepage' => t('foaf:workplaceHomepage'), |
| 532 |
|
'foaf_street' => t('vCard:Street'), |
| 533 |
|
'foaf_locality' => t('vCard:Locality'), |
| 534 |
|
'foaf_region' => t('vCard:Region'), |
| 535 |
|
'foaf_pcode' => t('vCard:Pcode'), |
| 536 |
|
'foaf_country' => t('vCard:Country'), |
| 537 |
|
'foaf_keywords' => t('Field for bio:keywords')); |
| 538 |
|
} |
| 539 |
|
|
| 540 |
|
function _foaf_paths() { |
| 541 |
|
return array('foaf_name' => '/RDF:RDF/FOAF:PERSON/FOAF:NAME', |
| 542 |
|
'foaf_title' => '/RDF:RDF/FOAF:PERSON/FOAF:TITLE', |
| 543 |
|
'foaf_firstName' => '/RDF:RDF/FOAF:PERSON/FOAF:FIRSTNAME', |
| 544 |
|
'foaf_surname' => '/RDF:RDF/FOAF:PERSON/FOAF:SURNAME', |
| 545 |
|
'foaf_Organization' => '/RDF:RDF/FOAF:PERSON/FOAF:ORGANIZATION', |
| 546 |
|
'foaf_phone' => '/RDF:RDF/FOAF:PERSON/FOAF:PHONE', |
| 547 |
|
'foaf_aimChatID' => '/RDF:RDF/FOAF:PERSON/FOAF:AIMCHATID', |
| 548 |
|
'foaf_icqChatID' => '/RDF:RDF/FOAF:PERSON/FOAF:ICQCHATID', |
| 549 |
|
'foaf_msnChatID' => '/RDF:RDF/FOAF:PERSON/FOAF:MSNCHATID', |
| 550 |
|
'foaf_yahooChatID' => '/RDF:RDF/FOAF:PERSON/FOAF:YAHOOCHATID', |
| 551 |
|
'foaf_jabberID' => '/RDF:RDF/FOAF:PERSON/FOAF:JABBERID' |
| 552 |
|
'foaf_workplaceHomepage' => '/RDF:RDF/FOAF:PERSON/FOAF:WORKPLACEHOMEPAGE[@RDF:RESOURCE]', |
| 553 |
|
'foaf_street' => '/RDF:RDF/FOAF:PERSON/VCARD:ADR/VCARD:STREET', |
| 554 |
|
'foaf_locality' => '/RDF:RDF/FOAF:PERSON/VCARD:ADR/VCARD:LOCALITY', |
| 555 |
|
'foaf_region' => '/RDF:RDF/FOAF:PERSON/VCARD:ADR/VCARD:REGION', |
| 556 |
|
'foaf_pcode' => '/RDF:RDF/FOAF:PERSON/VCARD:ADR/VCARD:PCODE', |
| 557 |
|
'foaf_country' => '/RDF:RDF/FOAF:PERSON/VCARD:ADR/VCARD:COUNTRY', |
| 558 |
|
'foaf_keywords' => '/RDF:RDF/FOAF:PERSON/BIO:KEYWORDS'); |
| 559 |
|
} |
| 560 |
?> |
?> |