<%perl>
$m->comp('/widgets/wrappers/sharky/header.mc',
         title => "$disp->{$type} Events",
         context => "Workflow | Profile | $disp->{$type} | &quot;"
         . $obj->get_name . "&quot; | Events"
);

$m->comp('/widgets/eventList/eventList.mc',
         object => $type,
         obj_id => $id,
         alert_uri => "/workflow/alerts");

$m->comp('/lib/util/back_button.mc');
$m->comp('/widgets/wrappers/sharky/footer.mc');
</%perl>

<%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>
