Contact display widget for MidCOM

There are several places in OpenPsa where persons are displayed in some list: Search results, campaigns, buddy lists, project participants, etc. To make them more informative, I've now implemented a contact widget library that can be used anywhere in MidCOM.

With this library the listings provide all the basic contact information in a nicely formatted manner:

MidCOM contact widget in action

The nice part about this is that the output is in the hCard microformat, enabling it to be machine-readable, and easily converted into vCards.

In addition to hCard support, the widget has also integrated support for photos from Gravatar and Jabber instant messaging presence from Edgar. The Edgar server can also be installed and used locally. Other ideas I've had include blog RSS integration.

To use the org.openpsa.contactwidget library, add it to the _autoload_libraries array of your component interface class. Then to display a person object, do the following:

// Fetch the person
$person = new MidgardPerson($id);

// Display the contact
$contact = new org_openpsa_contactwidget($person);
$contact->show();

Updated 2005-08-02: This is now documented and maintained in the Midgard Wiki.


Read more Midgard posts.