• __section_tree__.msn

    521 522  
    35 35
    36 36 my $sname = decode("utf-8", $sect->name());
    37 37 if ( defined $width_limit && $offset + length($sname) > $width_limit ) {
    38 $sname =~ s/<[^>]+>//sgi;
    38 39 $sname = substr($sname, 0, $width_limit - $offset);
    39 40 $sname .= '&nbsp;...';
    40 41 }
     
    47 48 my $html_sect = '<span'.($statstyle).(!$sect->status ? ' class="hiddensect"' : '').'>'.($section_access ? '<a href="'.$href.'"'.$statstyle.'>' : '').$sname.($section_access ? '</a>' : '') . '&nbsp;'.($sect->status != 1 && $statname ? '&nbsp;<span style="font-size:11px;">('.$statname.')</span>' : '').'</span>';
    48 49 my $style = ($offset == 1) ? ($viewmode ? ' style="font-size:16px;font-weight:bold;"':' style="font-size:14px;"') : ' style="font-size:12px;"';
    49 50
    50 $m->out(<<EOT);
    51 <tr>
    52 <td align="right">&nbsp;${$line_ref}&nbsp;<a href="section.html?id=$sect->{id}&move=up&ret=$root"><img src="/contenido/i/ico-up-9x10.gif" border=0 alt="Переместить секцию на шаг вверх"></a>&nbsp;<a href="section.html?id=$sect->{id}&move=down&ret=$root"><img src="/contenido/i/ico-down-9x10.gif" border=0 alt="Переместить секцию на шаг вниз"></a></td>
    53 <td><table cellpadding="0" cellspacing="0" border="0">
    54 <tr valign="top">
    55 <td width="10">&nbsp;</td>
    56 <td>$spacer</td>
    57 <td nowrap $style>$html_sect</td>
    58 </tr>
    59 </table>
    60 </td>
    61 EOT
    51 $m->out( $m->scomp( '.table_row.msn',
    52 sect => $sect,
    53 root => $root,
    54 style => $style,
    55 spacer => $spacer,
    56 viewmode => $viewmode,
    57 html_sect => $html_sect,
    58 line_ref => $line_ref,
    59 section_access => $section_access,
    60 )
    61 );
    62 62
    63 if ($viewmode) {
    64 my $fhref = '/contenido/?set_context=filter-'.$sect->id();
    65 my $new_doc_class = $sect->default_document_class;
    66 $m->out(qq^\n<td align="center" nowrap>^);
    67 $m->out(qq^<a href="section.html?id=$sect->{id}" title="Редактировать параметры секции"><img src="/contenido/i/actions/edit.gif" width="15" height="17" align="absmiddle" border="0"></a>&nbsp;&nbsp;&nbsp;^);
    68 $m->out(qq^<a href="$fhref">фильтр</a>^);
    69 $m->out(qq^&nbsp;&nbsp;&nbsp;<a href="document.html?sect_id=$sect->{id}&class=$new_doc_class">доб.докум</a>^) if $section_access == 2 and $new_doc_class;
    70 $m->out("</td>");
    71 } else {
    72 $m->out(qq^\n<td align="center" nowrap>^);
    73 $m->out(qq^<a href="section.html?id=$sect->{id}" title="Редактировать параметры секции"><img src="/contenido/i/actions/edit.gif" width="15" height="17" align="absmiddle" border="0"></a>&nbsp;&nbsp;&nbsp;^);
    74 $m->out("</td>");
    75 }
    76
    77 $m->out('</tr>');
    78 63 }
    79 64
    80 65 my $childs = $sect->{children} || [];
     
    109 94 my $line = 0;
    110 95
    111 96 </%init>
    97
    98 <%def .table_row.msn>
    99 <%args>
    100
    101 $sect => undef
    102 $root => undef
    103 $style => ''
    104 $spacer => ''
    105 $viewmode => undef
    106 $html_sect => ''
    107 $line_ref => undef
    108 $section_access => undef
    109
    110 </%args>
    111 <%init>
    112
    113 my ($fhref, $new_doc_class);
    114 if ( $viewmode ) {
    115 $fhref = '/contenido/?set_context=filter-'.$sect->id;
    116 $new_doc_class = $sect->default_document_class;
    117 }
    118
    119 </%init>
    120 <tr>
    121 <td align="right">&nbsp;<% $$line_ref %>&nbsp;<a href="section.html?id=<% $sect->id %>&move=up&ret=<% $root %>"><img src="/contenido/i/ico-up-9x10.gif" border=0 alt="Переместить секцию на шаг вверх"></a>&nbsp;<a href="section.html?id=<% $sect->id %>&move=down&ret=<% $root %>"><img src="/contenido/i/ico-down-9x10.gif" border=0 alt="Переместить секцию на шаг вниз"></a></td>
    122 <td><table cellpadding="0" cellspacing="0" border="0">
    123 <tr valign="top">
    124 <td width="10">&nbsp;</td>
    125 <td><% $spacer %></td>
    126 <td nowrap <% $style %>><% $html_sect %></td>
    127 </tr>
    128 </table>
    129 </td>
    130 % if ( $viewmode ) {
    131 <td align="center" nowrap>
    132 <a href="section.html?id=<% $sect->id %>" title="Редактировать параметры секции"><img src="/contenido/i/actions/edit.gif" width="15" height="17" align="absmiddle" border="0"></a>&nbsp;&nbsp;&nbsp;<a
    133 href="$fhref">фильтр</a>\
    134 % if ( $section_access == 2 and $new_doc_class ) {
    135 &nbsp;&nbsp;&nbsp;<a href="document.html?sect_id=<% $sect->id %>&class=<% $new_doc_class %>">доб.докум</a>\
    136 % }
    137 </td>
    138 % } else {
    139 <td align="center" nowrap><a href="section.html?id=<% $sect->id %>" title="Редактировать параметры секции"><img src="/contenido/i/actions/edit.gif" width="15" height="17" align="absmiddle" border="0"></a></td>
    140 % }
    141 </tr>
    142 </%def>