'Import another user\'s dataset via a shared URL; dataset is added to user\'s current history.'

@web.expose
def imp(self, trans, dataset_id=None, **kwd):

    referer = trans.request.referer
    if referer:
        referer_message = ("<a    href='%s'>return    to    the    previous    page</a>" % escape(referer))
    else:
        referer_message = ("<a    href='%s'>go    to    Galaxy's    start    page</a>" % url_for('/'))
    if (not dataset_id):
        return trans.show_error_message(('You    must    specify    a    dataset    to    import.    You    can    %s.' % referer_message), use_panels=True)
    cur_history = trans.get_history(create=True)
    (status, message) = self._copy_datasets(trans, [dataset_id], [cur_history], imported=True)
    message = ("Dataset    imported.    <br>You    can    <a    href='%s'>start    using    the    dataset</a>    or    %s." % (url_for('/'), referer_message))
    return trans.show_message(message, type=status, use_panels=True)
