Display User Relationship request dialog on content profile page I need to create an 'add friend' link programatically.

       $content .= '&lt;li&gt;' . l('&lt;span class="icon"&gt;&lt;/span&gt;Add to your friends', 'relationship/' . $tid . '/request/1?destination=user/' . $tid, array('html' =&gt; true, 'attributes' =&gt; array('class' =&gt; 'add`-friend')));


It leads me to another page with confirmation form for the invitation.

Could anybody tell me how (if possible) I can display this confirmation form in dialog?
I've created Add as friend likes in a project once doing this:

l(t('Add as friend'), 'relationship/' . $account-&gt;uid . '/request');


It served me fine, but I'm not sure if you want something different.