<?
global $lang;

if ( isset( $this -> _articles ) && is_array( $this -> _articles ) ) foreach ( $this -> _articles as $art )
{
  ?>
  <div class="article_full">
    <?
    if ( $art -> get_show_title() )
    {
      ?>
      <div class='article_title'>
        <?=stripslashes( $art -> get_title() );?>
      </div>
    <?
    }
    if ( $art -> get_show_date() )
    {
      ?><div class='article_date'><?=date( 'Y-m-d H:s' , strtotime( $art -> get_date_add() ) );?></div><?
    }
    
    if ( $art -> get_print_enabled() )
    {
      ?>
      <a class='print' href='print.php?art=<?=$art-> get_id();?>' target='_blank'>
        <img src='images/system/sico_print.png' alt='<?=$lang -> getTrans('T_DRUKUJ' );?>' style='border:0px;'>
      </a>
      <?
    }
    ?>
    <div class='article_text'><?=$art -> getModifyText();?></div>
  
    <?
    if ( is_array( $art -> get_images() ) )
    {
      ?>
      <div class="article_gallery">
        <?
        foreach ( $art -> get_images() as $img )
        {
          ?>      
          <a href='<?=$img['src'];?>' class="fancybox-buttons" rel='<?=$art -> get_id();?>'>
            <div class="gallery_picture">
              <div style="background: url( 'resources/thumber.php?img=<?=$img['src'];?>&h=200&w=200' ) no-repeat center;"></div>
            </div>
          </a>
          <?
        }
        ?>
      </div>
      <?
    }
    ?>
    
    <?
    if ( is_array( $art -> get_files() ) )
    {
      ?>
      <ul class="article_files">
        <?
        foreach ( $art -> get_files() as $file )
        {
          ?>      
          <li>
            <a href="pobierz,<?=$file['id'];?>">
              <?=$file['name'];?>
            </a>
          </li>
          <?
        }
        ?>
      </ul>
      <?
    }
    ?>
  </div>
<?
}
?>

<script type="text/javascript">
  $(document).ready(function() {
    var i = 0;
    $( '.article_gallery div.gallery_picture' ).each(function(){
      var me = this;
      $(this).hide()
      var j = i;
      setTimeout(function(){
        $(me).fadeIn(3000);
      }, i)
      i += 300
    });
  });
</script>