<h2><?= ucfirst($this->localization['edycja_artykulu']);?></h2>
<table>
<?php
	echo form_open_multipart('admin/edit_article_language');
	echo form_hidden('idarticles', $idarticles);
	echo form_hidden('idarticle_languages', $idarticle_languages);
		echo '<tr><td>'.ucfirst($this->localization['nazwa']).': </td><td>'.form_input(array('name'=>'name', 'value'=>$name, 'size'=>'50')).'</td></tr>';
		echo '<tr><td>'.ucfirst($this->localization['tytul_seo']).': </td><td>'.form_input(array('name'=>'title', 'value'=>$title, 'size'=>'50')).'</td></tr>';
		echo '<tr><td>'.ucfirst($this->localization['jezyk']).': </td><td>'.form_dropdown('idlanguage', $languages, 'large').'</td></tr>';//

		echo '<tr><td>'.ucfirst($this->localization['obrazek_naglowek']).': </td><td>'.form_upload(array('name'=>'header_image')).'</td></tr>';//
                if(!empty($header_image))
                    echo '<tr><td></td><td><a href="" class="screenshot" rel="'.base_url().substr($header_image,1).'" title="">'.$header_image.'</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="del_image" href="/admin/del_article_header_image/'.$idarticle_languages.'">USUŃ</a></td>';


		echo '<tr><td>'.ucfirst($this->localization['obrazek']).' 1: </td><td>'.form_upload(array('name'=>'image1')).'</td></tr>';//
                if(!empty($image1))
                    echo '<tr><td></td><td><a href="" class="screenshot" rel="'.base_url().substr($image1,1).'" title="">'.$image1.'</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="del_image" href="/admin/del_article_image/'.$idarticles.'/1">USUŃ</a></td>';

                echo '<tr><td>'.ucfirst($this->localization['obrazek']).' 2: </td><td>'.form_upload(array('name'=>'image2')).'</td></tr>';//
                if(!empty($image2))
                    echo '<tr><td></td><td><a href="'.base_url().$image2.'" class="screenshot" rel="'.base_url().substr($image2,1).'" title="">'.$image2.'</a>&nbsp;&nbsp;&nbsp;&nbsp;<a class="del_image" href="/admin/del_article_image/'.$idarticles.'/2">USUŃ</a></td>';



                echo '<tr><td>'.ucfirst($this->localization['lista']).': </td><td>'.form_dropdown('idlists', $lists, $idlists).'</td></tr>';//
                echo '<tr><td>'.ucfirst($this->localization['pokaz_slajdow']).': </td><td>'.form_dropdown('idslideshow', $slideshows, $idslideshow).'</td></tr>';


		echo '<tr><td>'.ucfirst($this->localization['tresc']).': </td><td>'.form_textarea(array('name'=>'artcontent', 'value'=>$content)).'</td></tr>';
		echo '<tr><td>'.ucfirst($this->localization['opis_seo']).': </td><td>'.form_textarea(array('name'=>'shortdesc', 'value'=>$shortdesc)).'</td></tr>';
		echo '<tr><td>'.ucfirst($this->localization['slowa_kluczowe']).': </td><td>'.form_input(array('name'=>'keywords', 'value'=>$keywords, 'size'=>'180')).'</td></tr>';
		echo '<tr><td>Abstract: </td><td>'.form_input(array('name'=>'abstract', 'value'=>$abstract, 'size'=>'180')).'</td></tr>';
		echo '<tr><td>Subject: </td><td>'.form_input(array('name'=>'subject', 'value'=>$subject, 'size'=>'180')).'</td></tr>';
		echo '<tr><td>Topic: </td><td>'.form_input(array('name'=>'topic', 'value'=>$topic, 'size'=>'180')).'</td></tr>';
		echo '<tr><td>'.ucfirst($this->localization['prawa_autorskie']).': </td><td>'.form_input(array('name'=>'copyrights', 'value'=>$copyrights, 'size'=>'50')).'</td></tr>';
		echo '<tr><td>URL: </td><td>'.form_input(array('name'=>'friendlyurl', 'value'=>$friendlyurl, 'size'=>'50')).'</td></tr>';
		echo '<tr><td>'.ucfirst($this->localization['cos_jeszcze']).': </td><td>'.form_textarea(array('name'=>'additional_data', 'value'=>$additional_data)).'</td></tr>';
                echo '<tr><td>'.ucfirst($this->localization['mapa_google']).': </td><td>'.form_checkbox('google_map', '1', $google_map).'</td></tr>';//
                echo '<tr><td>'.ucfirst($this->localization['formularz_kontaktowy']).': </td><td>'.form_checkbox('contact_form', '1', $contact_form).'</td></tr>';//
		echo '<tr><td>'.ucfirst($this->localization['aktywny']).': </td><td>'.form_checkbox('active', '1', $active).'</td></tr>';//
		echo '<tr><td></td><td>'.form_submit('submit', ucfirst($this->localization['wyslij'])).'</td></tr>';
	echo form_close();
?>
	<script type="text/javascript">
		window.onload = function()
		{
            var oFCKeditor = new FCKeditor( 'artcontent' ) ;
            oFCKeditor.Height = '300';
            oFCKeditor.BasePath = "/files/fckeditor/" ;
            oFCKeditor.ReplaceTextarea();
		}
        $(document).ready(function(){
            $("a.del_header_image").click(function(){
                if(confirm("Czy jesteś pewien?"))
                    {
                        var link = $(this).attr('href');
                        var anhor =$(this);
                        $.ajax({url:link, success:function(data){
                            if(data == 1)
                                anhor.parent().html('');
                            else
                                alert("Wystąpił błąd");
                        }});
                    }
                return false;
            });

           $("a.del_image").click(function(){
                if(confirm("Czy jesteś pewien?"))
                    {
                        var link = $(this).attr('href');
                        var anhor =$(this);
                        $.ajax({url:link, success:function(data){
                            if(data == 1)
                                anhor.parent().html('');
                            else
                                alert("Wystąpił błąd");
                        }});
                    }
                return false;
           });
        });
	</script>
</table>