<%perl>
my $rightText = $m->scomp( '/widgets/profile/imageSubmit.mc',
  formName => "theForm",
  callback => $widget . "|trail_cb",
  image    => "view_trail_teal"
) . '&nbsp;';

$rightText .= $m->scomp( '/widgets/profile/imageSubmit.mc',
  formName => "theForm",
  callback => $widget . "|notes_cb",
  value    => 'view',
  image    => %{ $media->get_notes } ? 'note_fill' : "note",
  useGlobalImage => 1,
);

$m->comp("/widgets/wrappers/sharky/table_top.mc",
  	 caption => "Information",
	 number  => $num++,
         id        => 'mediainfo',
	 rightText => $rightText

);
</%perl>

<table border="0" width="578" cellpadding="0" cellspacing="0">
  <tr>
  <td class="medHeader"><img src="/media/images/spacer.gif" height="18" width="1" /></td>
  <td width="<% $infoIndent %>" align="right" class="medHeader"><span class="label"><%$lang->maketext('ID')%>:&nbsp;</span></td>
  <td width="470">&nbsp;<% $id %></td>
  </tr>
  <tr>
  <td bgcolor="white"><img src="/media/images/spacer.gif" width="1" height="1" /></td>
  </tr>

  <tr>
  <td class="medHeader"><img src="/media/images/spacer.gif" height="18" width="1" /></td>
  <td width="<% $infoIndent %>" align="right" class="medHeader"><span class="label"><% $lang->maketext('Media Type Element')%>:&nbsp;</span></td>
  <td width="470">&nbsp;<% $media->get_element_name %></td>
  </tr>
  <tr>
  <td bgcolor="white"><img src="/media/images/spacer.gif" width="1" height="1" /></td>
  </tr>

  <tr>
  <td class="medHeader"><img src="/media/images/spacer.gif" height="18" width="1" /></td>
  <td width="<% $infoIndent %>" align="right" class="medHeader"><span class="label"><% $lang->maketext('Title') %>:&nbsp;</span></td>
  <td width="470" class="fieldcontent">&nbsp;<% $media->get_title %></td>
  </tr>
  <tr>
  <td bgcolor="white"><img src="/media/images/spacer.gif" width="1" height="1" /></td>
  </tr>

  <tr>
  <td class="medHeader"><img src="/media/images/spacer.gif" height="18" width="1" /></td>
  <td width="<% $infoIndent %>" align="right" class="medHeader"><span class="label"><%$lang->maketext('URI') %>:&nbsp;</span></td>
% if ($media->get_file_name) {
  <td width="470">&nbsp;<% $m->comp('/widgets/profile/preview_link.mc',
                                    type  => 'media',
                                    title => $media->get_primary_uri,
                                    doc   => $media,
                                    style => 'blackUnderlinedLink') %></td>
% } else {
  <td width="470">&nbsp;</td>
% }
  </tr>
  <tr>
  <td bgcolor="white"><img src="/media/images/spacer.gif" width="1" height="1" /></td>
  </tr>

  <tr>
  <td class="medHeader"><img src="/media/images/spacer.gif" height="18" width="1" /></td>
  <td width="<% $infoIndent %>" align="right" class="medHeader"><span class="label"><% $lang->maketext('Source') %>:&nbsp;</span></td>
  <td width="470">&nbsp;<% Bric::Biz::Org::Source->lookup({ id => $media->get_source__id })->get_source_name %></td>
  </tr>
  <tr>
  <td bgcolor="white"><img src="/media/images/spacer.gif" width="1" height="1" /></td>
  </tr>

  <tr>
  <td class="medHeader"><img src="/media/images/spacer.gif" height="18" width="1" /></td>
  <td width="<% $infoIndent %>" align="right" class="medHeader"><span class="label"><% $lang->maketext('Description') %>:&nbsp;</span></td>
  <td width="470" class="fieldcontent">&nbsp;<% $media->get_description %></td>
  </tr>
  <tr>
  <td bgcolor="white"><img src="/media/images/spacer.gif" width="1" height="1" /></td>
  </tr>

  <tr>
  <td class="medHeader"><img src="/media/images/spacer.gif" height="18" width="1" /></td>
  <td width="<% $infoIndent %>" align="right" class="medHeader"><span class="label"><% $lang->maketext('Current Version') %>:&nbsp;</span></td>
  <td width="470">&nbsp;<% $media->get_version() %></td>
  </tr>
  <tr>
  <td bgcolor="white"><img src="/media/images/spacer.gif" width="1" height="1" /></td>
  </tr>

  <tr>
  <td class="medHeader"><img src="/media/images/spacer.gif" height="18" width="1" /></td>
  <td width="<% $infoIndent %>" align="right" class="medHeader"><span class="label"><% $lang->maketext('Published Version') %>:&nbsp;</span></td>
  <td width="470">&nbsp;<% $media->get_published_version || '' %></td>
  </tr>
  <tr>
  <td bgcolor="white"><img src="/media/images/spacer.gif" width="1" height="1" /></td>
  </tr>

  <tr>
  <td class="medHeader"><img src="/media/images/spacer.gif" height="18" width="1" /></td>
  <td width="<% $infoIndent %>" align="right" class="medHeader"><span class="label"><% $lang->maketext('First Published') %>:&nbsp;</span></td>
  <td width="470">&nbsp;<% $media->get_first_publish_date || '' %></td>
  </tr>
  <tr>
  <td bgcolor="white"><img src="/media/images/spacer.gif" width="1" height="1" /></td>
  </tr>
  <tr>
  <td class="medHeader"><img src="/media/images/spacer.gif" height="18" width="1" /></td>
  <td width="<% $infoIndent %>" align="right" class="medHeader"><span class="label"><% $lang->maketext('Last Published') %>:&nbsp;</span></td>
  <td width="470">&nbsp;<% $media->get_publish_date || '' %></td>
  </tr>
  <tr>
  <td bgcolor="white"><img src="/media/images/spacer.gif" width="1" height="1" /></td>
  </tr>

  <tr>
  <td class="medHeader"><img src="/media/images/spacer.gif" height="18" width="1" /></td>
  <td width="<% $infoIndent %>" align="right" class="medHeader"><span class="label"><% $lang->maketext('Priority') %>:&nbsp;</span></td>
  <td width="470">&nbsp;<% $media->get_priority() %></td>
  </tr>

  <tr>
  <td bgcolor="white"><img src="/media/images/spacer.gif" width="1" height="1" /></td>
  </tr>

  <tr>
  <td class="medHeader"><img src="/media/images/spacer.gif" height="18" width="1" /></td>
  <td width="<% $infoIndent %>" align="right" class="medHeader"><span class="label"><% $lang->maketext('Output Channels') %>:&nbsp;</span></td>
  <td width="470">&nbsp;<% join ', ', (map { $_->get_name } $media->get_output_channels) %></td>
  </tr>
</table>

% $m->comp("/widgets/wrappers/sharky/table_bottom.mc");
% $m->comp('file_section.mc',
%          media     => $media,
%          widget    => $widget,
%          num       => 2,
%          read_only => 1,
%          indent    => $infoIndent );
<& '/widgets/container_prof/container_prof.mc',
  tile        => $tile,
  tile_type   => 'media',
  action      => 'view',
  num         => 3,
  title       => 'Content',
  start_count => 6
&>

% $m->comp("/widgets/wrappers/sharky/table_top.mc",
%          caption => "Associations",
%          number => 4);

<table border=0 width=578 cellpadding=0 cellspacing=0>
<tr>
  <td width=121 align=right valign=top><span class=label><% $lang->maketext('Category') %>:&nbsp;</span></td>
  <td width=457 valign=top height="25">
<%perl>
my $cat = $media->get_category;
$m->out($cat->get_name);
</%perl>
</tr>
</table>

<table border=0 cellpadding=0 cellspacing=0 width=578>
<tr><td class="medHeader"><img src="/media/images/spacer.gif" width="578" height="1" /></td></tr>
</table>

<table border=0 width=578 cellpadding=0 cellspacing=0>
<tr>
  <td width=121 align=right valign=top><span class=label><% $lang->maketext('Keywords') %>:&nbsp;</span></td>
  <td width=457 valign=top height="25">
<%perl>
my @keywords;
foreach my $kw ($media->get_keywords) {
    push @keywords, $kw->get_name;
}

$m->out(scalar(@keywords) ? join(", ", @keywords) : $lang->maketext("No keywords defined."));
</%perl>
</tr>
</table>

<table border=0 cellpadding=0 cellspacing=0 width=578>
<tr><td class="medHeader"><img src="/media/images/spacer.gif" width="578" height="1" /></td></tr>
</table>

<table border=0 cellpadding=0 cellspacing=0 width=578>
<tr>
  <td align=right width=121 valign=top><span class=label><% $lang->maketext('Contributors') %>:&nbsp;</span></td>
  <td width=457 valign=top height="25">

<%perl>
my @contribs;
foreach my $cntr ($media->get_contributors) {
    push @contribs,  $cntr->get_name;
}
$m->out(scalar(@contribs) ? join(", ", @contribs) : $lang->maketext("No contributors defined."));

</%perl>

  </td>
</table>
% $m->comp("/widgets/wrappers/sharky/table_bottom.mc");

<input type="image" src="/media/images/<% $lang_key %>/return_dgreen.gif" border=0 name="<% $widget %>|return_cb" value="Return To Desk">

<%args>
$widget
</%args>

<%init>
my $media = get_state_data($widget, 'media');
my $id = $media->get_id;
my $tile = $media->get_tile();

set_state_data('container_prof', 'tile', $tile);

my $agent = detect_agent();
my $infoIndent = $agent->nav4 ? FIELD_INDENT - 5 : FIELD_INDENT + 8;
my $num = 1;
</%init>
