Example #1
0
/**
 * Removes the specified address from the specified list
 * @param gu_list $list The list to modify
 * @param string $address The address to remove 
 * @param int $address_id The id of the address - only used to reference a HTML element on the calling page
 */
function gu_ajax_remove_address($list, $address, $address_id)
{
    if (!$list) {
        return gu_error(t('Invalid list'));
    }
    if ($list->remove($address, TRUE)) {
        gu_success(t('Address <b><i>%</i></b> removed', array($address)));
        gu_ajax_return('gu_ajax_on_remove_address(' . $address_id . ')');
    }
}