parser

Написать ответ на текущее сообщение

 

 
   команды управления поиском

Ответ

AK666 07.05.2012 12:44

а вот вроде ничего тяжеловесного и нету
   
^rusage[print_start]

 <table id="Print">	
 <thead>
  <tr class="caption">
   <td>MCR
   <td colspan="2">Pbl
   <td colspan="2">Lt
   <td>&plusmn^; pct
   <td>Ld
   <td>Dr
   <td>Cr
   <td>LY
   <td>CN
   <td>Cm
   <td>Ant
   <td>Sl
   <td>Msg<br>age
 </thead>
 <tbody>
 ^if($mData && $mData is table){ 
  ^mData.menu{ $Even(1-$Even)
	$dLY[^cdate::create[$mData.LY]]
	$dCN[^cdate::create[$mData.CN]]
   <tr class="^if($Even){Even}{Odd}">
   <td title="ID:$mData.ID ^#0D ^__dbe_print[$mData._editor;_editor] ^#0D ^__dbe_print[$mData._edited;_edited]">$mData.Is
   <td title="$mData.PCHint">$mData.PC
   <td title="$mData.PSHint">$mData.PS
   <td class="r">^Lib:numberFormat[$mData.Lt] 
   <td class="l">$mData.LtUnit 
   <td class="c" ^if(def $mData.Mn){$lPct($mData.Lt * $mData.Mn \ 100) $lMin(${mData.Lt}-$lPct) $lMax(${mData.Lt}+$lPct) title="^Lib:numberFormat[$lMin] - ^Lib:numberFormat[$lMax]"}>${mData.Mn}
   <td title="$mData.LdHint">$mData.Ld
   <td title="$mData.DrHint">$mData.Dr
   <td class="nowrap" title="$mData.CrDescription">$mData.Cr
   ^if($dLY.month == $dCN.month && $dLY.year == $dCN.year && $mData.LC ne "S"){
    <td class="c" colspan="2"> ^cdate:print[$mData.LY;%h %d;$cdate:es_locale] / ^cdate:print[$mData.CN;%d;$cdate:es_locale]
   }(def $mData.LC && $mData.LC eq "S"){
    <td class="c" colspan="2" title="^cdate:print[$mData.LY;%h %d;$cdate:es_locale] / ^cdate:print[$mData.CN;%h %d;$cdate:es_locale]"> !
   }{
    <td class="c"> ^cdate:print[$mData.LY;%h %d;$cdate:es_locale]
    <td class="c"> ^cdate:print[$mData.CN;%h %d;$cdate:es_locale]
   }
   <td class="r">$mData.Cm
   <td>&nbsp^;
   <td class="c">^__dbe_print[$mData.Sl;bool]
   <td class="c" title="^__dbe_print[$mData.Published;datetime]">^__published[$mData.Published]
  }
 }
 </tbody>
 </table>

   ^rusage[print_done]
^__dbe_print - процедура форматирования в зависимости от параметра (ничего не вычисляет)
^__published :
@__published[lDateTime][locals;result]
 $dNow[^date::now[]]
 $dDate[^date::create[$lDateTime]]

 $ago($dNow - $dDate)
 $period[d]

 ^if($ago < 1 ){
   $ago(($dNow - $dDate)*24*60*60 \1)
   $period[s]
   ^if($ago > 60){
    $ago($ago \ 60)
    $period[m]
   }
   ^if($ago > 60){
    $ago($ago \ 60)
    $period[h]
   }
 }{ $ago($ago \ 1)}


 $result[^ago.format[%02u] $period]