def elem2rec_detailed(ar, elem, with_navinfo=True, **rec):
    """Adds additional information for this record, used only by detail
        views.

        The "navigation information" is a set of pointers to the next,
        previous, first and last record relative to this record in
        this report.  (This information can be relatively expensive
        for records that are towards the end of the queryset.  See
        `/blog/2010/0716`, `/blog/2010/0721`, `/blog/2010/1116`,
        `/blog/2010/1207`.)

        recno 0 means "the requested element exists but is not
        contained in the requested queryset".  This can happen after
        changing the quick filter (search_change) of a detail view.

        """
    rh = ar.ah
    rec = ar.elem2rec1(rh, elem, None, **rec)
    if ar.actor.hide_top_toolbar or ar.bound_action.action.hide_top_toolbar:
        rec.update(title=ar.get_detail_title(elem))
    else:
        rec.update(title=ar.get_breadcrumbs(elem))
    rec.update(id=elem.pk)
    if ar.actor.editable:
        rec.update(disable_delete=rh.actor.disable_delete(elem, ar))
    if rh.actor.show_detail_navigator and with_navinfo:
        rec.update(navinfo=rh.actor.get_navinfo(ar, elem))
    if ar.actor.parameters:
        rec.update(param_values=ar.actor.params_layout.params_store.pv2dict
            (ar, ar.param_values))
    return rec
