Revision 195 (by ahitrov, 2012/03/15 18:26:13) Users plugin
<& "/contenido/components/title.msn" &>
<div style="font:bold 13px Verdana; margin:4px;">�����: <span style="color:teal;"><% $class %></span>
<span style="font:11px Verdana;">(<a href="document.html?class=<% $class %>&<% $field %>=<% $id %>" target="_blank">������� �����</a>)</span></div>
% if ( ref $docs eq 'ARRAY' && @$docs ) {
%	if ($total > $size) {
<div style="font-size:75%; font-family:Arial; text-align:center;">
<& /inc/pages_.msn, p => $p, n => $size, total => $total, params => {%ARGS} &></div>
%	}
%	my @props = sort { $a->{column} <=> $b->{column} } grep { exists $_->{column} } $docs->[0]->required_properties;
<table width="100%" border="0" cellpadding="4" cellspacing="0" class="tlistdocs">
<tr bgcolor="#efefef">
%	foreach my $prop (@props) {
<th><% $prop->{rusname} %></th>
%	}
</tr>
%	foreach my $doc (@$docs) {
%		my $color = $doc->contenido_status_style ? $doc->contenido_status_style : 
%				$doc->status == 1 ? 'blue' :
%				$doc->status == 0 ? 'gray' : 'blue';

%#		my ($stat) = grep { $_->{attr} eq 'status' } @props;
%#		my ($case) = grep { $_->[0] == $banner->status } @{ $stat->{cases} }	if ref $stat eq 'HASH' && exists $stat->{cases};
<tr>
%	foreach my $prop (@props) {
%		my $attr = $prop->{attr};
%		if ( $attr =~ /dtime/ ) {
<td><a href="document.html?id=<% $doc->id %>&class=<% $doc->class %>"
 style="<% $color %>" target="_blank"><& "/contenido/components/show_dtime.msn", dtime => $doc->$attr &></a></td>
%		}else{
<td><a href="document.html?id=<% $doc->id %>&class=<% $doc->class %>"
 style="<% $color %>" target="_blank"><% $doc->$attr %></a></td>
%		}
%	}
</tr>
%	}
</table>
% }
%#<pre><% Dumper($docs->[0]->required_properties) %></pre>
<%args>
	$id	=> undef
	$filter	=> undef
	$field	=> undef
	$class	=> undef
	$order_by	=> undef
	$p	=> 1
</%args>
<%init>

  my ($docs, $total);
  my $size = 15;
  if ( $id && $filter && $class ) {
	my %opts = ();
	$opts{$filter} = $id;
	$opts{order_by} = $order_by	if $order_by;
	$docs = $keeper->get_documents (
		class		=> $class,
		return_mode	=> 'array_ref',
		offset		=> ($p-1)*$size,
		limit		=> $size,
		%opts,
        );
	$total = $keeper->get_documents (
		class		=> $class,
		count		=> 1,
		%opts,
        );
  } else {
	return;
  }

</%init>