<? global $lang; ?>
<fieldset>
	<table class='table_browse'>
    <thead>
      <tr>
        <td class='header' style='width:15px; text-align:center;'><?=$lang -> getTrans( 'T_LP' );?></td>
        <td class='header'><?=$lang -> getTrans( 'T_TYTUL' );?></td>
        <td class='header' style='text-align:center;'><?=$lang -> getTrans( 'T_WERSJA' );?></td>
        <td class='header' style="text-align: center;"><?=$lang -> getTrans( 'T_DATA_MODYFIKACJI' );?></td>
        <td class='header' style='width:15px;'></td>
        <td class='header' style='width:15px;'></td>
      </tr>
    </thead>
    <tbody>
      <?
      $i = ( $this -> _bs - 1 ) * $this -> _limit + 1;
      if ( is_array( $this -> _articles ) ) foreach ( $this -> _articles as $article ) {
        ?>
        <tr>
          <td class='row' style='text-align:center;'><?=$i;?>.</td>
          <td class='row'><?=$article['title'];?></td>
          <td class='row' style='text-align:center;'><?=$article['version'];?></td>
          <td class="row" style="text-align: center;"><?=$article['date_modify'];?></td>
          <td class='row'>
            <a href='./?rw=show&amp;id=<?=$article['id'];?>'>
              <span class='icon show'></span>
            </a>
          </td>
          <td class='row'>
            <a onClick="confirmArticleRestor( '<?=$article['id'];?>')"><?=$lang -> getTrans( 'T_PRZYWROC' );?></a>
          </td>
        </tr>
        <?
        $i++;
      }
      ?>
    </tbody>
	</table>
	<? include 'site-paging.php' ;?>
</fieldset>
<form method="POST" action="./" id="article_restore">
  <input type="hidden" name="rw" value="restore">
  <input type='hidden' name='<?=base64_encode("time");?>' value='<?=base64_encode(date("Y-m-d H:i:s"));?>'>
  <input type="hidden" name="id" id="article_id" value="">
</form>
<script type='text/javascript'>
  function mycallbackform(v,m,f){
    if( v == true )
      $( '#article_restore' ).submit();
  }
  function confirmArticleRestor( id ) {
    $( '#article_id' ).val( id );
    $.prompt( '<?=$lang -> getTrans( 'T_POTWIERDZ_PRZYWROCENIE' );?>',{ callback: mycallbackform, buttons: { <?=$lang -> getTrans( 'T_TAK' );?>: true, <?=$lang -> getTrans( 'T_NIE' );?>: false }, focus: 1 })
  }
  
  $(document).ready(function(){
    var cssObj = {
      'display' : 'block',
      'height' : '30px',
      'line-height' : '30px',
	  'color' : '#000000',
	  'font-size' : '10px',
	  'padding-left' : '5px',
	  'text-transform' : 'uppercase'
    }
    $("li.context_menu").children("a").css( cssObj );
    var cssObj2 = {
      'float' : 'left',
      'margin' : '5px 5px 0 0',
	  'color' : '#000000',
	  'font-size' : '10px',
	  'padding-left' : '5px',
	  'text-transform' : 'uppercase'
    }
    $("li.context_menu").children("a").children("span.edit").css( cssObj2 );
    $("li.context_menu").children("a").children("span.delete").css( cssObj2 );
    $("li.context_menu").children("a").children("span.show").css( cssObj2 );
    $("li.context_menu").children("a").children("div.down_main").css( cssObj2 );
    $("li.context_menu").children("a").children("div.up_main").css( cssObj2 );
  });
 </script>