<& '/widgets/wrappers/sharky/header.mc',
    title => "$disp->{$type} Trail",
    context => "Workflow | Profile | $disp->{$type} | &quot;"
               . $obj->get_name . "&quot; | Trail" &>
<form method="post" action="<% $r->uri %>" name="theForm">

<& '/widgets/eventList/eventList.mc',
    title   => $lang->maketext("Events"),
    object => $type,
    obj_id => $id,
    def_sort_order => 'descending',
    constrain => { key_name => "${type}_moved"} &>

<& '/widgets/profile/button.mc',
    disp    => 'Return',
    widget  => 'event',
    cb      => 'return_cb',
    button  => 'return_dgreen',
    useTable => 0
&>

</form>

<& '/widgets/wrappers/sharky/footer.mc' &>

<%args>
$id => undef
</%args>
<%init>
# Figure out where we are.
my ($type, $oid) = (parse_uri($r->uri))[2,3];

# Redirect if necessary.
$m->comp('/errors/404.mc') unless $type;

# Instantiate the object and check permissions.
$id ||= $oid;
my $obj = $pkg->{$type}->lookup({ id => $id });
chk_authz($obj, READ);
</%init>

<%once>;
my $disp = {
    media    => get_disp_name('media'),
    story    => get_disp_name('story'),
    template => get_disp_name('template')
};
my $pkg =  {
    media    => get_package_name('media'),
    story    => get_package_name('story'),
    template => get_package_name('template')
};
</%once>
