<%perl>;
$m->comp('/widgets/wrappers/sharky/header.mc',
	 title =>  "$disp Events",
	 context => "Workflow | Profile | $disp | &quot;"
	 . $obj->get_name . "&quot; | Events"
);
$m->out("<p></p>");
$m->comp('/widgets/eventList/eventList.mc',
	 object => $type,
         obj_id => $id,
	 alert_uri => "/admin/alerts");
$m->out("<br />\n");
$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 ($section, $mode, $type, $oid) = parse_uri($r->uri);
# Redirect if necessary. Should change this to a 404 error page.
$m->comp('/errors/404.mc') unless $type;
# HACK - This really should be correct in the database instead.
$type = 'element' if $type eq 'element';

# Instantiate the object and check permissions.
$id ||= $oid;
my $obj = get_package_name($type)->lookup({ id => $id });
unless ($type eq 'user' && $id == get_user_id()) {
    chk_authz($obj, READ);
}
my $disp = get_disp_name($type);
</%init>
