示例#1
0
/**
 * Return data for one or more contacts.  Use contact_data() instead.
 * 
 * @param $opts An associative array of options, possible keys are:
 *   'cid' If specified returns the corresponding member (or members for an array);
 *   'filter' An array mapping filter names to filter values
 * @return An array with each element representing a contact.
 * @deprecated
*/
function member_contact_data($opts = array())
{
    return contact_data($opts);
}
示例#2
0
/**
 * Return the form structure to delete a contact.
 *
 * @param $cid The cid of the contact to delete.
 * @return The form structure.
*/
function contact_delete_form($cid)
{
    // Ensure user is allowed to delete contacts
    if (!user_access('contact_delete')) {
        return array();
    }
    // Get contact data
    $data = contact_data(array('cid' => $cid));
    $contact = $data[0];
    if (empty($contact) || count($contact) < 1) {
        error_register('No contact for cid ' . $cid);
        return array();
    }
    // Create form structure
    $name = theme('contact_name', $contact);
    $message = "<p>Are you sure you want to delete the contact \"{$name}\"? This cannot be undone.";
    $form = array('type' => 'form', 'method' => 'post', 'command' => 'contact_delete', 'submit' => 'Delete', 'hidden' => array('cid' => $contact['cid']), 'fields' => array(array('type' => 'fieldset', 'label' => 'Delete Contact', 'fields' => array(array('type' => 'message', 'value' => $message)))));
    return $form;
}